SDK
SDK 0.12.0
verifyWebhook({ body, timestamp, signature, secret })andtagsForEvent(event, data)come from the main entry point, so websites on Astro, Nuxt, SvelteKit, Angular, Vue, React or any other server check CMS Orbit's webhooks without Next.js and without writing the HMAC check themselves. It uses Web Crypto, so it runs on Node.js 20 and later, Bun, Deno and Workers, compares the signature in constant time and refuses messages more than five minutes old (toleranceSecondschanges that). It answers{ valid: true, event, data, tags }or{ valid: false, reason }, withreason"signature"or"expired".createRevalidateHandlerandtagsForEventfrom@bifrost-orbit-cms/sdk/nextwork as before and use the same code.cms.checkPreview(token)checks a preview token with CMS Orbit and answers{ valid, path }, wherepathis the address of the page the preview link was made for. Use it instead of calling${cms.origin}/preview?token=…yourself.createPreviewHandleruses it too.npx cms-orbit --help,-handcms-orbit generate --helpprint the usage instead of crashing, and an unknown option prints a short error and the usage instead of a stack trace.cms-orbit generatereadsCMS_API_URLandCMS_PUBLIC_KEYfrom.envand.env.localin the folder it runs in, sonode --env-fileis no longer needed. Variables already set in the environment win, then.env.local, then.env;--urland--keywin over all of them. WithoutCMS_API_URLandCMS_PUBLIC_KEY, it usesVITE_CMS_API_URLandVITE_CMS_PUBLIC_KEY, thenNUXT_CMS_API_URLandNUXT_CMS_PUBLIC_KEY.- Generated TypeScript types pass strict settings without changes to your project: the file imports only the SDK types it uses, so
noUnusedLocalsno longer fails, and a content type without fields isRecord<string, never>instead of an empty interface, so ESLint'sno-empty-object-type, which eslint-config-next turns on, finds nothing. Runnpx cms-orbit generateagain to update your types, and remove anynoUnusedLocalsor ESLint exceptions you added for the file. - Fixes
ReferenceError: React is not definedfromCmsPage,CmsBridge,JsonLdand the other components in 0.10.0 and 0.11.x: the published build now uses React's automatic JSX runtime, so the components no longer expect a globalReact. Nothing to change in your code.