Add nonce support for @next/third-parties package's scripts #65452
naveen-bharathi
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goals
Add nonce prop to
GoogleAnalytics
andGoogleTapManager
components in@next/third-parties
packageNon-Goals
No response
Background
Enabling Content-Security-Policy using nonces requires the nonce to be passed to the Script element. Ref: https://nextjs.org/docs/app/building-your-application/configuring/content-security-policy#reading-the-nonce
Since the
GoogleTagManager
andGoogleAnalytics
components exported from@next/third-parties
package do not have anonce
part, using these Components with Content-Security-Policy using nonces becomes impossible as the script inside these components won't be loaded.Proposal
Add a
nonce
property to both theGoogleTagManager
andGoogleAnalytics
components exported from@next/third-parties
packageBeta Was this translation helpful? Give feedback.
All reactions