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:
- Create a new React TypeScript project using the Sanity template
pnpx sanity@latest init --template app-quickstart
cd my-content-os-app
- Install dependencies
npm i
- Run the app
npm run dev
- Open the App in Sanity Dashboard with your organization ID
https://core.sanity.io/<your-organization-id>?dev=http://localhost:3333
- 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