superwebpros

payload lms plugin

by superwebpros
Other
v3
^3.71.1
MIT

Overview

Summary generated from the README

Adds six collections to Payload for a learning management system: courses, modules, lessons, enrollments, lesson progress and file downloads. Video progress is tracked with auto-completion at a configurable watch threshold, and optional Mautic CRM and Stripe integrations are available. Requires Payload 3.71.1 or later and exports helper functions for enrollment checks and duration calculation.

Features

  • Hierarchical courses, modules and lessons collections
  • Video support for Vimeo, YouTube and Mux
  • Auto-completion of lessons at a configurable watch percentage
  • Enrollment records with payment status and progress caching
  • Audit trail collection for downloadable resources
  • Optional Mautic CRM and Stripe integrations

Use cases

  • Build an online course platform with paid enrollments inside Payload
  • Track which lessons students watch and complete
  • Offer video-based training with downloadable resources

From the author

Comprehensive Learning Management System plugin for Payload CMS with course management, progress tracking, and enrollment

Installation

npm i @superwebpros/payload-lms-plugin

14

Stars

2

Forks

0

Open Issues

10 months ago

Last Updated

0

Weekly Downloads

v

npm Version

Dependencies

GitHub stars

14+1 since Sep 6

Show data
GitHub stars by day (UTC)
DateStars
Dec 5, 202614
Dec 4, 202614
Dec 3, 202614
Dec 2, 202614
Dec 1, 202614
Nov 30, 202614
Nov 29, 202614
Nov 28, 202614
Nov 27, 202614
Nov 26, 202614
Nov 25, 202614
Nov 24, 202614
Nov 23, 202614
Nov 22, 202614
Nov 21, 202614
Nov 20, 202614
Nov 19, 202614
Nov 18, 202614
Nov 17, 202614
Nov 16, 202614
Nov 15, 202614
Nov 14, 202614
Nov 13, 202614
Nov 12, 202614
Nov 11, 202614
Nov 10, 202614
Nov 9, 202614
Nov 8, 202614
Nov 7, 202614
Nov 6, 202614
Nov 5, 202614
Nov 4, 202614
Nov 3, 202614
Nov 2, 202614
Nov 1, 202614
Oct 31, 202614
Oct 30, 202614
Oct 29, 202614
Oct 28, 202614
Oct 27, 202614
Oct 26, 202614
Oct 25, 202614
Oct 24, 202614
Oct 23, 202614
Oct 22, 202614
Oct 21, 202614
Oct 20, 202614
Oct 19, 202614
Oct 18, 202614
Oct 17, 202614
Oct 16, 202614
Oct 15, 202614
Oct 14, 202614
Oct 13, 202614
Oct 12, 202614
Oct 11, 202614
Oct 10, 202614
Oct 9, 202614
Oct 8, 202614
Oct 7, 202614
Oct 6, 202614
Oct 5, 202614
Oct 4, 202614
Oct 3, 202614
Oct 2, 202614
Oct 1, 202614
Sep 30, 202614
Sep 29, 202614
Sep 28, 202614
Sep 27, 202614
Sep 26, 202614
Sep 25, 202614
Sep 24, 202614
Sep 23, 202614
Sep 22, 202614
Sep 21, 202614
Sep 20, 202614
Sep 19, 202614
Sep 18, 202614
Sep 17, 202614
Sep 16, 202614
Sep 15, 202614
Sep 14, 202614
Sep 13, 202613
Sep 12, 202613
Sep 11, 202613
Sep 10, 202613
Sep 9, 202613
Sep 8, 202613
Sep 7, 202613
Sep 6, 202613
npm weekly downloads

Trends appear after 7 days of data. Daily snapshots have not started yet.

Each point is npm's rolling 7-day download count.

Health Score

26/100Fair

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1142870023-root.svg)](https://payloaddirectory.dev/plugins/1142870023-root)
HTML
<a href="https://payloaddirectory.dev/plugins/1142870023-root"><img src="https://payloaddirectory.dev/badge/1142870023-root.svg" alt="Payload Directory"></a>
Updated Jan 27, 2026Created Jan 27, 2026

README

Payload LMS Plugin

A comprehensive Learning Management System (LMS) plugin for Payload CMS featuring course management, video progress tracking, enrollment management, and payment integration.

Status: Active Development | Payload Compatibility: ^3.71.1

Features

  • 📚 Course Management - Hierarchical structure: Courses → Modules → Lessons
  • 🎥 Video Integration - Support for Vimeo, YouTube, and Mux
  • 📊 Progress Tracking - Auto-completion at 90% video watched (configurable)
  • 👥 Enrollment Management - Track student enrollments with payment status
  • 📥 Download Tracking - Audit trail for downloadable resources
  • 🔗 External Integrations - Mautic CRM and Stripe payments (optional)
  • 🎓 Certificate Support - Auto-generate certificates on completion (coming soon)

Installation

From GitHub Packages

  1. Add to your .npmrc file:
@superwebpros:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}
  1. Install the plugin:
pnpm add @superwebpros/payload-lms-plugin

Configuration

Add the plugin to your payload.config.ts:

import { buildConfig } from 'payload'
import { lmsPlugin } from '@superwebpros/payload-lms-plugin'

export default buildConfig({
  // ... your config
  plugins: [
    lmsPlugin({
      enabled: true,
      defaultCompletionThreshold: 90,
      enableMauticIntegration: true,
      enableStripeIntegration: true,
    })
  ]
})

Configuration Options

interface LMSPluginConfig {
  /**
   * Enable or disable the entire plugin
   * @default true
   */
  enabled?: boolean

  /**
   * Enable certificate generation on course completion
   * @default false
   */
  enableCertificates?: boolean

  /**
   * Enable Mautic CRM integration for enrollment and progress tracking
   * @default true
   */
  enableMauticIntegration?: boolean

  /**
   * Enable Stripe payment integration for course purchases
   * @default true
   */
  enableStripeIntegration?: boolean

  /**
   * Default completion threshold (percentage of video watched to auto-complete)
   * @default 90
   */
  defaultCompletionThreshold?: number

  /**
   * Admin group name in Payload admin panel
   * @default 'LMS'
   */
  adminGroupName?: string

  /**
   * Disable specific collections if you don't need them
   * @default []
   */
  disableCollections?: Array<'courses' | 'modules' | 'lessons' | 'enrollments' | 'progress' | 'downloads'>

  /**
   * Insert LMS collections after this collection slug
   * @example 'categories' - LMS appears after Categories in admin sidebar
   */
  insertAfter?: string
}

Collections

The plugin adds 6 collections to your Payload instance:

1. Courses

Main course collection with pricing, instructor assignment, and module relationships.

Admin: /admin/collections/courses

2. Modules

Module collection with lesson relationships and duration calculation.

Admin: /admin/collections/modules

3. Lessons

Lesson collection with video integration, rich text content, and downloadable resources.

Admin: /admin/collections/lessons

4. CourseEnrollments

Enrollment tracking with payment status and progress caching.

Admin: /admin/collections/course-enrollments

5. LessonProgress

Individual lesson progress with video tracking and auto-completion.

Admin: /admin/collections/lesson-progress

6. FileDownloads

Audit trail for downloadable resources (admin-only).

Admin: /admin/collections/file-downloads

Environment Variables

Required

PAYLOAD_SECRET=your-secret-key
DATABASE_URI=mongodb://localhost:27017/your-db

Optional (for integrations)

# Mautic CRM Integration
MAUTIC_BASE_URL=https://mautic.example.com
MAUTIC_USERNAME=your-username
MAUTIC_PASSWORD=your-password

# Stripe Payment Integration
STRIPE_SECRET_KEY=sk_...
STRIPE_PUBLISHABLE_KEY=pk_...
STRIPE_WEBHOOK_SECRET=whsec_...

Usage

Creating a Course

  1. Navigate to /admin/collections/courses
  2. Click "Create New"
  3. Fill in course details (name, description, pricing)
  4. Assign an instructor
  5. Add modules and lessons

Managing Enrollments

Manual Enrollment:

  1. Navigate to /admin/collections/course-enrollments
  2. Create enrollment: select user and course
  3. Set payment status and source

Webhook Enrollment: Enrollments can be created automatically via Mautic or Stripe webhooks.

Tracking Progress

Navigate to /admin/collections/lesson-progress to view:

  • Which lessons users are watching
  • Watch time and completion percentages
  • Completion methods (auto vs manual)

Helper Functions

The plugin exports useful helper functions:

import {
  calculateCourseDuration,
  calculateModuleDuration,
  isUserEnrolled,
  getUserEnrollment
} from '@superwebpros/payload-lms-plugin'

// Check if user is enrolled
const enrolled = await isUserEnrolled(userId, courseId, payload)

// Get enrollment with progress
const enrollment = await getUserEnrollment(userId, courseId, payload)

// Calculate duration
const duration = await calculateCourseDuration(courseId, payload)

Development

Running the Dev Environment

# Install dependencies
pnpm install

# Start dev server
pnpm dev

Visit http://localhost:3000/admin to access the Payload admin.

Running Tests

# Run all tests
pnpm test

# Run tests in watch mode
pnpm test:watch

# Type checking
pnpm typecheck

Contributing

Contributions are welcome! Please read our Contributing Guide for details.

License

MIT © Super Web Pros

Support

Roadmap

  • Core collections (Courses, Modules, Lessons)
  • Enrollment and progress tracking
  • Helper utilities
  • Progress tracking API endpoints
  • Lesson player UI components
  • Course catalog components
  • Certificate generation
  • Instructor dashboard
  • Advanced analytics

Built with ❤️ by Super Web Pros

Similar plugins