Integration
Skillsaint uses Sanity CMS to manage courses and blog content. In this part of the documentation, we are going to show you how you can integrate Sanity into your project.
Follow the steps below to integrate Sanity CMS:
-
Create a Sanity Project: Go to Sanity.io/manage and click on Create new project. If you don’t have an account, create one first.
-
Get Project Credentials:
- Once your project is created, you will see your Project ID. Copy it.
- Go to the Datasets tab to see your dataset name (usually
production). - Go to the API tab and click Add API token. Give it a meaningful name (e.g., “Skillsaint Website”) and choose Editor permissions. Copy the generated token.
- Webhook integration
-
Configure Environment Variables:
- Open your project locally.
- Open your existing
.envfile. - Add or update the following variables with your Sanity credentials:
NEXT_PUBLIC_SANITY_PROJECT_ID="your_project_id_here" NEXT_PUBLIC_SANITY_DATASET="production" NEXT_PUBLIC_SANITY_API_VERSION="2025-11-02" NEXT_PUBLIC_SANITY_TOKEN="your_api_token_here" SANITY_HOOK_SECRET="your_hook_secret_here" -
VerifySanity Studio:
- Run your project locally with
npm run dev. - Navigate to
http://localhost:3000/studio(or/adminif configured) to access the Sanity Studio embedded in your application.
- Run your project locally with
-
Configure CORS:
- Go back to your project dashboard on Sanity.io .
- Go to the API tab and scroll down to CORS origins.
- Add your local URL
http://localhost:3000and your production URL. - Check “Allow credentials” if requested.
The integration is now complete! You can start managing your content through the Studio.