Official SDKs
One content API. Four official SDKs.
Read CMS Orbit content in JavaScript, PHP, Swift or Kotlin. Each SDK is typed, MIT-licensed and reads the same delivery API, so your website and your apps show the same pages, menus and campaigns.
Choose your SDK
Use the language you already know
Every SDK reads pages, redirects, menus, site-wide content, lists, campaigns, products, regions and sitemaps. Pick the one that fits your stack.
JavaScript and TypeScript
Next.js, React and Node.js
Install it with npm install @bifrost-orbit-cms/sdk. It needs Node.js 20 or later and works in any JavaScript runtime.
- A React renderer for your own components
- Next.js helpers for preview, cache refresh and sitemaps
- SEO output and a mock client for tests
import { createCmsClient } from '@bifrost-orbit-cms/sdk'export const cms = createCmsClient({ baseUrl: process.env.CMS_API_URL!, apiKey: process.env.CMS_PUBLIC_KEY!, defaultRegion: 'germany',})const page = await cms.getPage('/products/hiking-boots')console.log(page.name)PHP
Laravel, Symfony and plain PHP
Install it with composer require bifrost-orbit/cms-sdk. It needs PHP 8.1 or later and brings its own transport, or uses any PSR-18 client you already have.
- Head tags, JSON-LD and sitemap XML
- Preview token and webhook checks
- A block renderer that uses your own templates
use BifrostOrbit\Cms\Client;$cms = new Client( apiKey: getenv('CMS_PUBLIC_KEY'), defaultRegion: 'germany',);$page = $cms->getPage('/products/hiking-boots');echo $page['name'];Swift
iOS and macOS apps
Add https://github.com/bifrost-orbit/cms-sdk-swift with Swift Package Manager and use the CMSOrbit product. It needs iOS 15 or later, or macOS 12 or later.
- async/await on URLSession, with no dependencies
- Codable models, or decode into your own types
- SwiftUI examples in the guide
import CMSOrbitlet cms = try CMSOrbitClient( apiKey: "cms_pk_...", region: "germany")let page = try await cms.page("/products/hiking-boots")print(page.name)Kotlin
Android apps and JVM servers
Add implementation("com.bifrostorbit:cms-sdk:0.1.0") to your Gradle build. It runs in Android apps and on servers such as Ktor or Spring Boot.
- Suspend functions for coroutines, and futures for Java
- kotlinx.serialization models on OkHttp
- A Jetpack Compose example in the guide
import com.bifrostorbit.cms.CmsOrbitClientval cms = CmsOrbitClient("cms_pk_...") { defaultRegion = "germany"}val page = cms.getPage("/products/hiking-boots")println(page.name)Types from your schema
Your schema, typed in every language
The type generator reads your space's content types and components and writes a type for each one. It writes TypeScript by default; add --lang php, --lang swift or --lang kotlin for the other SDKs.
It runs with npx, so it needs Node.js where you run it, not in your app. Run it in CI, and a schema change that would break your website or app fails the build instead.
# TypeScript, for the JavaScript SDKnpx cms-orbit generate# Types for the other SDKsnpx cms-orbit generate --lang phpnpx cms-orbit generate --lang swiftnpx cms-orbit generate --lang kotlinThe same in every SDK
Learn it once, use it anywhere
Works with any stack
No SDK for your language? Use the API
The SDKs are a convenience, not a requirement. The delivery API is plain HTTP and JSON, so Python, Ruby, Go, .NET or anything else can read the same content over REST, or several things at once with GraphQL.
Questions
About the SDKs
Which SDK should we use?
The one for the language your website or app is written in: JavaScript for Next.js, React and Node.js, PHP for Laravel, Symfony and plain PHP, Swift for iOS and macOS apps, and Kotlin for Android apps and JVM servers. They read the same content, so a website and an app can use different SDKs side by side.
Are the SDKs free and open source?
Yes. All four are open source under the MIT licence and free to use with every CMS Orbit plan. The PHP, Swift and Kotlin SDKs are on GitHub, and the JavaScript SDK's code ships in its package on npm, so you can read every line.
Do apps need a secret key?
No. Apps use a public key, which starts with cms_pk_ and reads published content only. The SDKs refuse secret keys in browsers and in iOS and Android apps, because anyone who installs an app can read what's inside it. Previews of drafts need a secret key, so they run on a server.
How do we keep our types up to date?
Run npx cms-orbit generate whenever the schema changes, with --lang php, --lang swift or --lang kotlin for the other SDKs. Run it in CI too, so a change to a content type or component that would break your website or app fails the build before it ships.
Read your first page today.
Create a space, add a public key and read a page with the SDK for your language. The trial is free for 14 days.