@starlightcms/js-sdk
TypeScript icon, indicating that this package has built-in type declarations

2.2.1 • Public • Published
Starlight JS SDK logo

Starlight JavaScript SDK

This is the official Starlight SDK for websites and JavaScript 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 JS SDK, install it into your project:

npm install @starlightcms/js-sdk

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

import Starlight from '@starlightcms/js-sdk'

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

And, finally, start requesting data:

import Starlight from '@starlightcms/js-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')

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

React SDK

If you use React on your application, take a look at the Starlight React SDK. It's based in the JS SDK, and also provide useful React components to simplify content and image rendering.

Issues

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

Readme

Keywords

Package Sidebar

Install

npm i @starlightcms/js-sdk

Weekly Downloads

3

Version

2.2.1

License

BSD-3-Clause

Unpacked Size

446 kB

Total Files

283

Last publish

Collaborators

  • lucasvarela