The Golden Rule of Secure LMS Integration
Never call Click Stream’s encryption endpoint directly from client-side React, Vue, or mobile UI code. Your LMS backend must verify the student’s active course enrollment first, request or retrieve the protected link server-to-server, and pass only the resulting launch URL to the authenticated student.
This separation ensures credentials remain strictly confidential while giving you full control over enrollment rules, coupons, and expiration policies.
Server-Side Code Example (Laravel HTTP Client)
Send a single authenticated POST request from your backend controller or queue worker when publishing a new lecture.
$response = Http::withHeaders([
'X-API-Key' => config('services.clickstream.token'),
])->post('https://click-stream.net/api/v1/encrypt-video', [
'youtube_url' => 'https://youtu.be/LECTURE_ID',
'title' => 'Chapter 04 — Final Revision',
'allow_history' => true,
])->json();
// Response (200 OK):
// {
// "status": "success",
// "embed_token": "cs_9f82a7c4...",
// "universal_play_url": "https://click-stream.net/play?embed_token=cs_9f82a7c4...",
// "scheme_url": "clickplayer://?embed_token=cs_9f82a7c4..."
// }
Production Readiness Checklist
Verify these four engineering standards before rolling your protected player out to enrolled cohorts.
| Integration Check | Recommended Standard | Security & UX Impact |
|---|---|---|
| X-API-Key Storage | Backend .env / Secrets Manager only | Prevents token extraction from client source code |
| Verified Student Metadata | Pass name & phone from authenticated LMS session | Powers accurate dynamic watermarks and Student 360° reports |
| Per-Lecture Policy (allow_history) | Toggle false for sensitive exam walkthroughs | Controls whether watch history persists per lesson |
| Postman Verification | Import official Studio Postman Collection | Validates payload formats in 5 minutes prior to coding |
Unify LMS Events With Studio Telemetry
Alongside playback protection, LMS backends can push enrollment, purchase, and exam-unlock events into Click Stream Activity Logs so operations teams have one cohesive timeline per student.