JSPM

  • Created
  • Published
  • Downloads 780
  • Score
    100M100P100Q125082F
  • License MIT

Sanity SDK React toolkit for Content OS

Package Exports

  • @sanity/sdk-react
  • @sanity/sdk-react/package.json

Readme

Sanity SDK - React

React hooks for creating Sanity applications.

💻 Installation

npm i @sanity/sdk-react @sanity/sdk

💡 Looking to build a Sanity application? Check out the Quick Start section.

📚 SDK Documentation

See the SDK Documentation for more information.

🚀 Quick Start

Here's how to implement your Sanity application:

  1. Create a new React TypeScript project using the Sanity template
pnpx sanity@latest init --template app-quickstart
cd my-content-os-app
  1. Install dependencies
npm i
  1. Run the app
npm run dev
  1. Open the App in Sanity Dashboard with your organization ID
https://core.sanity.io/<your-organization-id>?dev=http://localhost:3333
  1. Update the src/App.tsx file with your Sanity project and dataset
// src/App.tsx
import {createSanityInstance} from '@sanity/sdk'
...

const sanityConfig: SanityConfigs = [
  {
    projectId: 'abc123',
    dataset: 'production',
  },
]

...

License

MIT © Sanity.io