learnerId. Learners do not need Cybr accounts. Your server decides who the learner is and sends that ID.
Learner IDs
Prefix every ID with your platform’s name so it stays unique:- Start with a prefix for your platform, such as
acme_. - Follow it with a stable ID from your own database:
acme_8412. - Never use an email address, a name, or anything else that can change or identify the person.
- Resolve the ID on the server from the learner’s session. Never accept a learner ID from the browser.
Guest learners
Guests can use labs without signing in. Your server issues each browser a guest ID and keeps it in a cookie:createGuestLearnerId() returns guest_<uuid> by default. The prefix accepts 1 to 64 letters, digits, underscores, or hyphens.
On later requests, read the ID from the cookie and reuse it. Accept only values in the format your server issues, so a visitor cannot edit the cookie into a signed-in learner’s ID.
A guest who clears cookies gets a new ID and loses access to earlier deployments and progress.
When a guest signs in
Past completions stay under the guest ID. Keep that ID on the new account, and combine both IDs to show full progress:Membership
Each launch sendsmembership: 'free' or 'premium'. The SDK defaults to free.
If your platform does not sell tiers, pass
premium for every learner you admit. Membership is your access decision. Cybr trusts the value your server sends, so the browser never chooses it.
Membership is separate from sign-in. A guest can launch as premium if your platform allows it.
