$sleek.setUser() after authentication to identify who is logged in. This page covers setUser(), addMetadata(), and resetUser().
Set the current user
Call$sleek.setUser(data) as soon as you know who is logged in — typically right after your application authenticates the user.
Parameters
string
Email address of the logged-in user. Used to uniquely identify the user in Sleekplan and send them notifications.
string
A signed JSON Web Token (JWT) for Single Sign-On. Required if your workspace has private boards enabled or if you have selected “Registration requires email verification” or “Login requires email confirmation” in your preferences. Passing a valid token bypasses email confirmation prompts.
string | number
Your application’s internal identifier for the user — for example, a database user ID or UUID. Useful for correlating Sleekplan users with records in your own system.
string
Display name for the user. Must use lowercase letters only and must not contain spaces or special characters (e.g.,
janesmith not Jane Smith).string
Publicly accessible URL of the user’s avatar image. Sleekplan fetches and displays this image alongside the user’s activity.
integer
Weighting factor between
1 and 10. A higher weight makes this user’s feedback and votes count more in the impact score calculation — useful for prioritizing input from high-value customers.boolean
When
true, automatically subscribes the user to the changelog so they receive update notifications without having to opt in manually.If you only pass
mail and your workspace requires email confirmation, Sleekplan will prompt the user to verify their address. To bypass this, include a signed token via SSO.SSO with a JWT token
If your workspace uses private boards or enforces email verification, pass a signed JWT as thetoken field. Generate the token server-side using your Sleekplan SSO secret.
Add metadata
Use$sleek.addMetadata(meta) to attach arbitrary key-value data to the current user. There are no restrictions on the object structure, so you can pass any additional context that is useful for your team — plan tier, company name, MRR, region, and so on.
You can call
addMetadata() multiple times. Each call merges the provided object into the existing metadata for the current session.object
required
An object containing any key-value pairs you want to attach to the user. Keys and values can be any type — strings, numbers, booleans, or nested objects.
Reset the session on logout
Call$sleek.resetUser() whenever the current user logs out of your application. This clears all user data from the session and removes any stored identifiers, so the next visitor does not inherit the previous user’s session.
