Minor Changes
-
7784fd2: Add optional
nonceprop to all JSON-LD components for Content Security Policy (CSP) complianceSites that send a strict CSP header such as
script-src 'nonce-{RANDOM}'block inline scripts without a matching nonce. Every JSON-LD component now accepts an optionalnonceprop, which is forwarded to the rendered<script type="application/ld+json">tag. Omit the prop and nononceattribute is rendered, so existing usage is unchanged.import { headers } from "next/headers"; import { ArticleJsonLd } from "next-seo"; const nonce = (await headers()).get("x-nonce") ?? undefined; <ArticleJsonLd headline="My Article" nonce={nonce} />;