Skip to content

1.0Quick start

Rev. 4.12Passkey autofill now works on Android

Sign-in for your app, fully assembled.

Latch is authentication and user management for web and mobile apps. Passkeys, email codes, social and SAML sign-on, organizations and sessions arrive as one part, already wired together.

Free up to 10,000 monthly active users. No card.

  1. Install the SDK

    One package. No peer dependencies beyond your framework.

    npm install @latch/nextjs
  2. Add two keys

    LATCH_PUBLISHABLE_KEY and LATCH_SECRET_KEY, from the dashboard.

  3. Render <SignIn />

    The component in Fig. 1.1 is the result. It is live: sign in.

Sign in to Acme

or

Secured byLatch

Session layerIdle

header

························

payload

························

signature

························

No session yetSign in on layer 1

User directory1,284 users
  • ines@palletline.io2 min
  • theo.w@quillbase.app9 min
  • marta@okapi.health1 h
Fig. 1.1Sign-in, exploded view. The top layer is live: enter any email, then the code 424242.

Component <SignIn /> renders in your app, on your domain. 14 kB gzipped.

Passkeys WebAuthn built in. Nothing to phish, nothing to reset.

Session A 60-second token, rotated silently and revocable at once.

Directory Every user, method and device, behind one API.

1.1In service at

  • Palletline
  • quillbase
  • Okapi Health
  • Tessera
  • Runwell
  • Sundial Pay
  • Vireo

2.0Configure

Build your sign-in box. The code keeps up.

Every switch on the left is a prop. Flip one and watch the component and the listing change together; copy the listing when it looks right.

2.1Methods

2.2Appearance

Theme
Accent
Radius px
Fig. 2.1 · Preview4 of 6 methods

Sign in to Acme

or

Secured byLatch

2.3  app/sign-in/page.tsx
import { SignIn } from "@latch/nextjs";export default function Page() {  return (    <SignIn      methods={[        "email_code",        "passkey",        "google",        "github",      ]}      appearance={{        theme: "light",        accent: "#0e7c52",        radius: 4,      }}    />  );}

3.0Sessions

See every session. End any of them.

A stolen laptop should be a two-second problem. Latch keeps a row per device and kills a session at the next token check, which is never more than 60 seconds away.

Device Parsed from the client on sign-in and shown in words your users recognise.

Place City-level location from the IP address. A sign-in from a new country can require a second factor.

Last seen Updated on every token rotation, so “active now” means within the last minute.

Revoke Deletes the session server-side. The next request from that device gets a 401 and the sign-in screen.

app.palletline.io/settings/sessions

Your devices

Signed in as ines@palletline.io

  • MacBook ProChrome 142
    Lisbon, PT85.240.18.4
    Active now
    This device
  • iPhone 16Palletline iOS 5.2
    Lisbon, PT85.240.18.4
    12 min ago
  • iPad AirSafari 19
    Porto, PT94.132.7.201
    Yesterday
  • Windows PCEdge 141
    Warsaw, PL178.42.96.13
    3 days ago
4 of 4 sessions active
Fig. 3.1The sessions table your users get. Revoke a row; the count and the token follow.

4.0Organizations

Roles your customers can edit without filing a ticket.

Organizations give each of your customers their own members, invitations and roles. Permissions are plain strings you check in code; the matrix below is the admin screen that ships with it.

app.okapi.health/org/settings/roles
PermissionOwnerAdminMemberBilling
Invite membersmembers:invite
Remove membersmembers:remove
Edit rolesroles:edit
Manage billingbilling:manage
Create API keysapikeys:create
Read audit logaudit:read
Read patient recordsrecords:read
Default roles. Owners always hold every permission.
Fig. 4.1Roles matrix for one organization. Tick a box and the check on the right re-runs.
4.2 · Permission check
await latch.can("sun", "billing:manage")

→ falseSun-hee is a Member. Members do not hold billing:manage. Tick the box to grant it.

The same check runs in your API routes, in middleware and in the <Protect> component. It reads from the session token, so it costs no network call.

5.0Integrate

Three files, whichever framework you picked.

The SDKs share one mental model: a provider at the root, a guard at the edge, a hook where you need the user. The numbered lines are the only ones you write.

Provider Wraps the app once and keeps the session fresh in the background.

Guard Runs before your code. Signed-out requests never reach a protected route.

User Typed, cached and available on the server and the client alike.

npm install @latch/nextjs
app/layout.tsx
import { LatchProvider } from "@latch/nextjs";export default function RootLayout({ children }) {  return (    <html lang="en">      <LatchProvider>        <body>{children}</body>      </LatchProvider>    </html>  );}
middleware.ts
import { latchMiddleware } from "@latch/nextjs/server";export default latchMiddleware({ protect: ["/app(.*)"] });export const config = { matcher: ["/((?!_next|.*\\..*).*)"] };
app/app/page.tsx
import { currentUser } from "@latch/nextjs/server";export default async function Dashboard() {  const user = await currentUser();  return <h1>Hello, {user.firstName}</h1>;}
Fig. 5.1Complete integration. Hover a callout to find its line, or a line to find its note.

6.0Migrate

Moving in is a checklist, not a quarter.

Import your users with their password hashes, run both systems side by side, then cut over. Nobody is signed out and nobody resets a password.

Coming from

npx latch import --from auth0 --tenant acme-prod
Caution
Do not rotate your old signing keys before step 5. Sessions issued by the previous provider are verified with them until cut-over.

Checklist LM-06-M

0 of 6 done

Tick the steps as you go.

7.0Rated values

Latch · Rated values

Rev. 4 · Nov 2026

Sign-in API availability
99.995%26 minutes of downtime in twelve months
Token verification, p50
38 msAt the edge, in 310 locations
Sign-ins a month
412MAcross 9,300 production apps
Time to first sign-in, p50
11 minFrom npm install to a real session

Measured across all production tenants, 1 Nov 2025 to 31 Oct 2026.

8.0Field reports

Field reports

Three installations, in the words of the people who maintain them.

All customer stories
Palletline
We deleted 4,100 lines of auth code and the on-call rota that came with them. The migration checklist was accurate to the minute, which I have never said about a vendor document.
Ines CarvalhoStaff engineer, Palletline
Stack
Next.js, Go
Monthly active users
186,000
Moved from
In-house (Passport)
Cut-over
9 days
Okapi Health
A hospital group asked for SAML on a Tuesday. We sent them the setup link on Wednesday.
Deji OkonkwoCTO, Okapi Health
Runwell
Passkeys took our sign-in failures on mobile from 7.4% to 0.9%. We changed one prop.
Hana SatoMobile lead, Runwell

9.0Pricing

Priced by the people who actually sign in.

A monthly active user is someone who signed in that month. Dormant accounts, test users and failed attempts cost nothing.

Per month at 25,000 active users

$325Pro

$25 platform fee, plus 15,000 users above the free 10k at $0.02 each.

11.0Get started

Step 1 takes about a minute.

Install the SDK, paste two keys and render the component. The free plan covers your first 10,000 monthly active users, with every sign-in method switched on.

npm install @latch/nextjs

Included on Free

Monthly active users
10,000
Passkeys, codes, links
Included
Social providers
3
Organizations
5 members each
Card required
No