saurabhnemade / react-twitter-embed

Simplest way to add twitter widgets to your react project.
https://saurabhnemade.github.io/react-twitter-embed/
363 stars 65 forks source link

ContentSecurityPolicy restriction when using with Next.js #112

Open advantiot opened 2 years ago

advantiot commented 2 years ago

The default ContentSecurityPolicy for a Next.js app (from a starter template) prevents loading of scripts and images required for this component. I was able to overcome this by simply adding a wildcard to all policies but that is not an option in production. What would be the exact permissions required for this component?

jmayergit commented 1 year ago

You can do something like this

<meta httpEquiv="Content-Security-Policy" content={csp} />

And place the source from the console error in the csp variable