Skip to content

starlightcms/next-sdk

Repository files navigation

Starlight Next SDK logo

Starlight Next SDK

This is the official Starlight SDK for Next applications, which makes integrating Starlight content into your apps a real breeze.

You can read the usage guide and the API reference in its documentation page.

Quick Start

To quickly start using the Next SDK, install it into your project:

npm install @starlightcms/next-sdk

Then, import the SDK and configure which Starlight workspace it should request data from:

import Starlight from '@starlightcms/next-sdk'

Starlight.configure({
  workspace: '1234567890'
})

And, finally, start requesting data and rendering content:

import Starlight, { VisualContent } from '@starlightcms/next-sdk'

// Listing all entries from the 'posts' model.
const response = Starlight.posts.entries.list()

// Getting content from the 'hello-world' entry.
const response = Starlight.posts.entries.get('hello-world')

// Rendering visual editor content:
<VisualContent content={response.data.data.content} />

The SDK is capable of requesting a myriad of different content from your workspaces. Check out the documentation to learn more.

React and JavaScript SDKs

If you don't use Next, take a look at our React SDK or JavaScript SDK, as they provide functionality specific to React or Vanilla JS applications respectively.

Issues

If you have any questions or you're facing any issues with the SDK, feel free to open an issue.

About

The Starlight SDK for Next.js applications.

Resources

License

Stars

Watchers

Forks

Releases

No releases published