Skip to main content
Lurk accepts the access token Supabase Auth gives a signed-in person. You give Lurk your project ref. Lurk works out the issuer and the key address from it.

What you need from Supabase

  • Asymmetric signing keys. Lurk verifies the token against your project’s public keys. A project that still signs with the legacy shared secret (HS256) has no keys to fetch, and its tokens are refused as unsupported_algorithm. Move the project to asymmetric signing keys in Supabase first.
  • Your project ref. It is the 20 lower-case letters at the start of your project address, https://<ref>.supabase.co.
Lurk derives these from the ref and nothing else:

What Lurk requires of a Supabase token

  • is_anonymous is present and is the boolean false. A person signed in anonymously (true) is refused as anonymous_session. A token without the claim, or with a value that is not a boolean, is refused as invalid_token. A Custom Access Token Hook can remove the claim, so do not remove it.
  • role, if present, is authenticated. The project’s anon and service_role keys are refused.
  • It meets the common rules in the overview.
Supabase access tokens last 3,600 seconds by default.

Add it to Lurk

An owner or admin does this, in person. In the dashboard, open Settings, then the Sign-in tab, and choose Add a provider. Or call POST /v1/trusted-issuers as a member. The issuer is saved paused, and its address cannot be edited later.
The supabase profile takes only a project ref. It cannot take a custom auth domain. Whether a custom domain changes the token’s iss is not settled. Do not register a Supabase project as oidc to get around this: an address ending in .supabase.co is refused there.

Check the keys, then turn it on

  1. Check keys. In the dashboard, choose Check keys. Or POST /v1/trusted-issuers/{id}/check with the expected_revision you read from the issuer. Lurk fetches the key set and saves how many usable keys it found. A problem is shown on the issuer.
  2. Turn it on. Choose Turn on, or POST /v1/trusted-issuers/{id}/activate with expected_revision. The last check must be recent: see Clerk.
  3. Allow new people and events. Save new_people_per_hour (1 to 1,000) and the event names a device may send in Events people’s apps may send, under Settings > Sign-in. Without a limit on new people, a person who has never signed in is refused. See Client API.

Test it

Sign in to your app as a real user, copy the access token Supabase gave it, and test it. In the dashboard, choose Test a token on the issuer and paste it. See Linking people. A good answer is verified with access ready. Anonymous users answer anonymous_session. A token for another project answers wrong_issuer. If nothing matches, see Troubleshooting.