Skip to content

CSP: Missing nonce attribute on <style> tags injected by Didomi #106

Closed

Description

@plevavas

We’re using a strict Content-Security-Policy with a style-src 'nonce-...' directive.

The <style> tags injected by Didomi (e.g., inside #didomi-host) don’t have a nonce attribute, which causes them to be blocked by the browser.

Would it be possible to add support for setting a nonce?

Thanks.

Activity

  1. honzalo commented on Nov 18, 2025

    @honzalo
    Contributor

    Hi @plevavas,

    Thanks for opening the issue, and apologies for the late reply — this one slipped through.

    We’ve added support for a custom nonce. You can now dynamically add the following code before the SDK is initialized:

    const didomiConfig = {
      app: {
        nonce: nonceValue,
      },
    };
    
    <DidomiSDK
      config={didomiConfig}
    [...]
    

    The SDK will then automatically add the nonce attribute to the injected styles.

    Let me know if you have any questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions