Skip to content

LMSMore/connectors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Sanity LMS Connectors

Scripts for seeding Learning Management System (LMS) content to Sanity CMS.

Scripts

sanity/sanity-install-schema.ts

Tests Sanity connection and validates write access. Outputs schema definitions for Sanity Studio.

npx tsx sanity/sanity-install-schema.ts

sanity/seed-course-to-sanity.ts

Seeds course content from JSON files to Sanity CMS.

# Seed a single course
npx tsx sanity/seed-course-to-sanity.ts <course-slug>

# Seed all courses
npx tsx sanity/seed-course-to-sanity.ts --all

Environment Variables

Create a .env file with:

SANITY_PROJECT_ID=your-project-id
SANITY_DATASET=production
SANITY_API_TOKEN=your-api-token

Getting Sanity Credentials

  1. Go to sanity.io/manage
  2. Select your project (or create one)
  3. Project ID is in the URL or project settings
  4. Go to API → Tokens → Add API token
  5. Create a token with "Editor" permissions

Content Structure

The scripts create the following document types in Sanity:

Type Description
course Learning course with modules
module Course module containing lessons
lesson Individual lesson with content and quizzes
question Quiz question with answers
answer Quiz answer option
contentItem Content item for content groups
learningPath Learning path containing multiple courses
certificate Completion certificate for learning paths

Dependencies

npm install @sanity/client dotenv

About

Sample connector code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •