Before you start
- Your role. You are an owner or admin of the project. Only they can set this up.
- The API address.
https://api.getlurk.com, for projects made at app.getlurk.com, both Staging and Production. The project ID picks the project. - Your project ID,
prj_…. It is not a secret. The Project ID under Settings > Project is the project’s short name (organization/project), notprj_…. Choose the project in the dashboard’s project switcher, and the address bar shows?project=prj_….
Set these once
1. Add your provider
In the dashboard, open Settings, the Sign-in tab, and choose Add a provider. Give it a Name, choose the provider and fill in:- Supabase
- Clerk
- OpenID Connect
- Project ref: the 20 letters in
https://<ref>.supabase.co.
2. Turn it on
On the provider’s row:- Check keys.
- Test a token. Sign in to your app and paste the token your provider gave it. A good token answers The token is good, then This provider is paused, as it should before step 3. OpenID Connect needs this to turn on. Clerk tokens last 60 seconds: paste a fresh one.
- Turn on. It shows after a key check in the last 24 hours (and, for OpenID Connect, a
verifiedtoken test). - Allow new people. In Events people’s apps may send, tick Limit new people, set New people an hour, and choose Save.
3. Make your first call
Send the person’s token as the bearer and your project ID inLurk-Project.
Read the signed-in person's balances
starts_at) or a rule gives it.
4. Send an event
- Allow the name. In Events people’s apps may send, add it with Allow an event, such as
checkin.scanned, and choose Save. A name not on the list is refused. Saving is refused while a live or paused rule hears the name with nosourcecondition. - Send it with a unique
idempotency_keyin the body. It is required.
Send an event for the signed-in person
Idempotency-Key header is optional here. If you send it, Lurk uses its key instead of the body’s.
Retrying. After a network failure, a 429 or a 503, resend with the same key: nothing is counted twice. Idempotency and retries
The answer lists the receipts the event made. A device’s event is untrusted: only a rule with source: any hears it (Rules).
If it fails
Run Test a token first: the API never says why it refused a token. Every code: Troubleshooting.What a device may do
A signed-in person’s app is a device. It does the calls above for its own person and nothing else: Lurk reads the person from the token, and a device cannot name another person, change rules, units or settings, or give or take units.What you trust, and what a device cannot choose
You trust the provider you add. A device cannot choose it.- See Add a trusted issuer for setup, approval and address rules.
- Lurk fetches the signing keys itself, from that address. A key or certificate inside a token is never used.
- A device sends only the token. A bearer that starts with
lurk_, or one next to a member’s session cookie, is refused. - Lurk checks the token on every request but does not ask the provider whether the session is alive, so a token works until it expires. Block a person to stop them sooner. See Linking people.
What the token must carry
- A signature from a key in the issuer’s key set, with
RS256orES256, and akidin the header. - An
issequal to the issuer you saved, exactly. - One audience in
aud, one you listed. Clerk is the exception: see Clerk. - An
expand aniat, withexpminusiatno longer than the issuer’s longest token (60 to 86,400 seconds, 3,600 by default). Lurk allows 30 seconds of clock difference. - A
subof 1 to 255 printable ASCII characters, with no spaces. - Whatever the provider’s own rules add. Anonymous sessions are refused.
sub. It never reads a name, an email or a picture from the token.