Skip to main content
This quickstart gets Didit Authentication working end to end in about 10 minutes. You register a callback in a sandbox application, turn on a sign-in method, sign a person in with the hosted sign-in page, verify their access token on your server, and see the sign-in in the console.

Prerequisites

  • A Didit account with a Sandbox application. Creating an account is free, and every Sandbox application has Authentication turned on.
  • Node.js 20 or later, and a web app you can run on http://localhost:3000.

Steps

1

Open your sandbox application

In the Business Console, use the application switcher to select your Sandbox application, then open Authentication.A Sandbox application accepts http://localhost callbacks and Didit’s test credentials for social sign-in, and it is never billed. A Live application turns Authentication on from the Products page instead: see prepare your application.
2

Register your callback and origin

Open Authentication > Security and sessions > Redirect URLs and allowed origins and add:Didit only returns a person to a redirect URL you registered, character by character. The allowed origin lets the browser exchange the code with your application’s Didit origin.
The Redirect URLs and allowed origins card in the Didit Business Console, next to the allowlist and blocklist and the sign-in URL

Redirect URLs and allowed origins, under Authentication > Security and sessions.

3

Turn on a sign-in method

Open Authentication > Sign-in methods and turn on Email code. A new application starts with every method off, and the hosted page offers only the methods you turn on.Add Passkeys too if you like, or a social sign-in method with Didit test credentials, which work in Sandbox without an app of your own. Every method is described in sign-in methods.
The Sign-in methods page in the Didit Business Console, with the hosted sign-in page card, the passwordless and password methods, and a live preview of the hosted page

Authentication > Sign-in methods, with a live preview of the hosted page.

4

Copy your publishable key

Open Authentication > Developers and copy the Publishable key. In a Sandbox application it starts with pk_test_.The publishable key is public and names your application’s Didit sign-in origin. Never put the Secret key in browser or mobile code.
5

Install the SDK and sign in

auth.ts
Click your button: the hosted page asks for an email address and sends a six-digit code. Enter the code, and Didit returns you to your callback, which exchanges the one-time code for the session’s tokens. A first sign-in with an address that has no account creates one, because the default sign-up policy lets anyone sign up.
The hosted sign-in page on a phone, with a passkey button and email and password fields

The hosted sign-in page on a phone. It shows only the methods you turned on.

6

Verify the token on your server

Send the access token from auth.getToken() to your backend in the Authorization header, and verify it there on every protected request:
server.ts
verifyToken checks the ES256 signature against your issuer’s published keys, the issuer and the expiry. Access tokens last at most 5 minutes, and auth.getToken() refreshes them for you. Other languages verify the same token with the server SDKs or any JWT library, as tokens and JWKS shows.
7

See the sign-in in the console

Open Authentication > Sign-ins. Your sign-in is listed with its result, method, device, location and risk, next to the example sign-ins every sandbox starts with. The person appears under Users.
The Sign-ins page in the Didit Business Console, listing sign-in attempts with their state, person, method, device, location, risk and time

Authentication > Sign-ins: every attempt, with filters for state, method and risk.

To receive sign-in activity on your server, subscribe a webhook destination to auth.signup and auth.login. See events and webhooks.

Before you go live

  1. Turn on Authentication for your Live application on the Products page.
  2. Register your production https:// redirect URLs and origins there: a Live application accepts https:// only.
  3. Replace Didit’s test credentials for social sign-in with your own app’s client ID and secret.
  4. Copy the Live publishable key (pk_live_) into your production configuration.
  5. Walk through the go-live checklist.

Next steps

Integration guide

Hosted or your own screens, token storage, sessions, step-up and troubleshooting.

React and Next.js

Components, hooks, HttpOnly cookies and auth() on the server.

iOS, Android, React Native and Flutter

Native sign-in with the system browser, passkeys and protected storage.

Bot protection

Turn on the policies that stop bots and account takeover.
Last modified on November 22, 2026