Skip to content
SDK

SDK 0.12.0

  • verifyWebhook({ body, timestamp, signature, secret }) and tagsForEvent(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 (toleranceSeconds changes that). It answers { valid: true, event, data, tags } or { valid: false, reason }, with reason "signature" or "expired". createRevalidateHandler and tagsForEvent from @bifrost-orbit-cms/sdk/next work as before and use the same code.
  • cms.checkPreview(token) checks a preview token with CMS Orbit and answers { valid, path }, where path is the address of the page the preview link was made for. Use it instead of calling ${cms.origin}/preview?token=… yourself. createPreviewHandler uses it too.
  • npx cms-orbit --help, -h and cms-orbit generate --help print the usage instead of crashing, and an unknown option prints a short error and the usage instead of a stack trace.
  • cms-orbit generate reads CMS_API_URL and CMS_PUBLIC_KEY from .env and .env.local in the folder it runs in, so node --env-file is no longer needed. Variables already set in the environment win, then .env.local, then .env; --url and --key win over all of them. Without CMS_API_URL and CMS_PUBLIC_KEY, it uses VITE_CMS_API_URL and VITE_CMS_PUBLIC_KEY, then NUXT_CMS_API_URL and NUXT_CMS_PUBLIC_KEY.
  • Generated TypeScript types pass strict settings without changes to your project: the file imports only the SDK types it uses, so noUnusedLocals no longer fails, and a content type without fields is Record<string, never> instead of an empty interface, so ESLint's no-empty-object-type, which eslint-config-next turns on, finds nothing. Run npx cms-orbit generate again to update your types, and remove any noUnusedLocals or ESLint exceptions you added for the file.
  • Fixes ReferenceError: React is not defined from CmsPage, CmsBridge, JsonLd and 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 global React. Nothing to change in your code.