$sleek.sso, your server generates a signed token, and Sleekplan accepts it to authenticate the user instantly.
How it works
- A user performs an authenticated action (vote, submit feedback) in the widget.
- The JavaScript SDK calls
$sleek.sso. - Your server generates a JWT signed with your private SSO key.
- You pass the token back via the
callback()parameter. - Sleekplan verifies the token and logs the user in seamlessly.
Get your SSO secret key
Find your private SSO key in Settings → Developer inside the Sleekplan dashboard at https://app.sleekplan.com/settings/developer.
The SSO secret key is available on the Starter and Business plans.
Generate a JWT on your server
Use your language’s JWT library to create a token signed with HMAC SHA-256 (
HS256). Replace PRIVATE_SSO_KEY with the key from the previous step. The localUser parameter in each example represents your application’s user record.- Node.js
- PHP
- Python
- Ruby
- Java
- C#/.NET
Install the libraryGenerate a token
JWT payload attributes
Sleekplan requires an email address to uniquely identify each user. All other attributes are optional but recommended.| Attribute | Required | Description |
|---|---|---|
mail | Yes | Email address of the user. Used as the primary identifier for the Sleekplan user record. |
id | No | Your internal user ID. Highly recommended — allows Sleekplan to match users even if their email address changes. |
name | No | Username. Use lowercase letters and numbers only — no spaces or special characters. |
full_name | No | Full display name shown in the Sleekplan UI. |
img | No | URL to the user’s avatar image. |
weight | No | User weighting from 1 to 10 (e.g., based on MRR). Used for impact scoring on feedback items. |
meta | No | Object of additional key-value pairs stored on the user profile. |
Authenticate the user with the token
Once you have a token, pass it to Sleekplan using the method that fits your integration type.
- Widget — on page load
- Widget — single-page apps
- Widget — async / on-demand
- Standalone page
- Iframe
Set
window.SLEEK_USER before the widget snippet loads. This is the simplest approach for server-rendered pages where the user is already authenticated when the page is served.