When you run online courses, paid newsletters, audio programs, or digital downloads on your own frontend, the most challenging parts to maintain are usually "buyer login," "entitlement checks (who can access which unit)," "private video/PDF anti-leeching signatures," and "cross-device progress synchronization."
Kanorio encapsulates these underlying capabilities into two layers, allowing you to choose based on your customization needs:
<kanorio-*> elements (@kanorio/elements, fastest): Use a single tag or React component to bring Kanorio’s built-in passwordless login, public curriculum, and protected player directly into your external website.https://{your-site}/api/v1/customer/*): Use your own UI to call passwordless authentication, fetch the tree structure of purchased deliverables, exchange for 600-second short-lived signed URLs, and report progress.Full Specification Reference (SSOT):
- All customer endpoints, parameters, and response structures: Customer API Reference
- Component attributes, custom events, and CSS variables: Kanorio Elements Reference
@kanorio/elements (Recommended)@kanorio/elements provides standard Web Components (compatible with any framework or plain HTML) and React components, with 58 built-in locales and light/dark theme variables:
| Component Name | Requires Buyer Login | Purpose |
|---|---|---|
<kanorio-curriculum> | No (Public) | Placed on product sales pages to automatically fetch the curriculum outline (chapters, unit types, duration) via GET /api/v1/products/{slug} and allow visitors to preview units marked as "Free Preview" |
<kanorio-login> | Login Portal | Provides email-based 6-digit verification codes and magic link passwordless login. Upon successful verification, it issues a buyer-specific Bearer Session and triggers the kanorio:login event |
<kanorio-unit> | Yes (Except for preview units) | A complete, protected learning and delivery interface: includes chapter sidebar, video/audio player, PDF reader, file download cards, and locked/drip-content notifications, while automatically reporting watch time and completion status to the server |
<kanorio-media>/<kanorio-lightbox> | No (Public) | Public media player and an image lightbox that supports zooming, keyboard navigation, and image-saving protection |
import { KanorioProvider, KanorioLogin, KanorioUnit } from "@kanorio/elements"; import "@kanorio/elements/elements.css"; export function CoursePlayerPage() { return ( <KanorioProvider siteUrl="https://s-k4m9x2p7q8w3.kanorio.com" locale="en" theme="auto"> <KanorioLogin siteName="My Online Academy" /> <KanorioUnit deliverable="react-masterclass" onProgress={(e) => console.log("Progress updated:", e)} /> </KanorioProvider> ); }
If you prefer to design your own curriculum and learning interface from scratch, you can call the Customer API directly from your browser (after adding your frontend domain to "Allowed Origins" in "Site Settings › Developer") or from your server:
POST /api/v1/customer/auth/challenge to send a 6-digit verification code and login link.POST /api/v1/customer/auth/verify to obtain the buyer's sessionToken (knr_cat_*, double-bound to the site and the contact).Authorization: Bearer knr_cat_... in the header and call GET /api/v1/customer/deliverables to list all deliverables the buyer has valid for.GET /api/v1/customer/deliverables/{key} to retrieve the full chapter tree, unlock status for each unit, and current viewing progress.POST /api/v1/customer/units/{id}/open (the server will verify entitlement and check if the releaseAt/releaseAfterDays condition is met) to receive a 600-second private media signed URL.POST /api/v1/customer/progress to report positionSeconds. The server will determine completion based on the deliverable's rules and trigger the deliverables.progress.completed Webhook.When designing your headless frontend, please note that Kanorio strictly separates these three types of rights:
<kanorio-unit>.knr_pat_). "Ability to view a course" never equals "ability to modify the curriculum."Place a checkout link on your product page that points to your Kanorio site's checkout page, including a return_to URL. Once the buyer completes the payment, Kanorio will automatically grant the Entitlement based on the product's linked deliverables, send receipts and access emails, and redirect the buyer back to your external frontend to start watching immediately.