Embedding APIs
The Teacharium embedding APIs enable you to securely embed interactive lessons on your website or application using JWT-based authentication.
Overview
Embedding lessons requires two key APIs:
- Sign Token API - Generate JWT tokens that grant time-limited access to specific lessons
- Embed Player Data API - Retrieve lesson content for the embedded player using the JWT token
Available Endpoints
Sign Token
Generate signed JWT tokens for embedding lessons securely.
POST https://www.teacharium.io/api/public/sign-tokenUse this to:
- Create time-limited access tokens for specific lessons
- Embed learner identification and custom attributes
- Control token expiration (up to 24 hours)
Embed Player Data
Retrieve lesson data for the embedded player.
GET https://www.teacharium.io/api/public/lessons/{id}/player-data?token={jwt}Use this to:
- Load lesson content in an iframe
- Validate JWT tokens on the server side
- Ensure only authorized users access lesson data
How It Works
- Backend: Your server calls the Sign Token API to generate a JWT token for a specific lesson and learner
- Frontend: Your application uses the token with the Embed SDK to create an iframe
- Iframe: The embedded player validates the token and loads the lesson content
- Communication: Progress and completion events are sent from the iframe to your application
Authentication
All embedding APIs require authentication using your organization’s API credentials. See API Tokens for instructions on creating and managing tokens.
Getting Started
Follow our Hosted Embedding Guide for step-by-step instructions on integrating embedded lessons into your application.
Security Best Practices
- Never expose API keys in client-side code - always generate tokens on your backend
- Do not include PII (personally identifiable information) in userAttributes
- Use appropriate token expiration - default 2 hours, maximum 24 hours
- Serve over HTTPS - both your site and API requests must use HTTPS
Support
If you encounter issues or have questions about embedding, please contact support or check our support documentation.
Last updated on