Auth

Sign-in and roles, without writing auth.

Add sign-in to your app with passkeys, two-factor codes, or Apple, Google, GitHub, Microsoft and any OpenID Connect provider. Organizations and roles come built in, and they travel in the token your backend already checks.

Sign-in your users expect.

Passkeys, two-factor codes from an authenticator app or by email, and sign-in with Apple, Google, GitHub, Microsoft or any OpenID Connect provider, like Okta or Keycloak. Setup checks your provider credentials as you save them, so a typo shows up before a user does.

Read the guide

Roles your backend can trust.

Each user's organization and role travel in their sign-in token, so your API checks them without a lookup. Every app has its own signing keys.

Read the guide

Move your users over, passwords included.

Bring your users from Auth0 or your own database with the passwords they already have. Nobody has to reset, and nobody notices the move.

Read the guide

Keys for your services and agents, and a log of every change.

Give a backend service or an AI agent its own key, limited to what it needs. Every change lands in an audit log nobody can edit, which you can export or stream to your own system.

Read the guide

How it works

Your first sign-in in three steps.

  1. Create an app in the console and turn on sign-up.
  2. Sign a user in from your app with @productcraft/auth.
  3. Verify the token on your backend and read the user’s organization and role.
server.ts
import { Auth } from "@productcraft/auth";

const auth = new Auth();

// In your app: sign the user in (no API key needed for this call).
const result = await auth.consumer("acme").signin({
  identifier: "ada@example.com",
  password: "CorrectHorse42Battery",
});

// On your backend: verify the token against your app's own keys.
if (result.result === "session") {
  const claims = await auth.verifyToken(result.access_token, { app: "acme" });
  // Their organization and role, read from the token itself:
  console.log(claims.org_id, claims.org_role);
}

More in the box

Everything else Auth does.

For your AI agents

MCP tools for apps, users, roles and keys, behind the policies you set on each key, so you decide whether an agent may only look at your users or change them too. Read about MCP

Your first sign-in, end to end.

Create an app, sign a user up and verify their token on your backend, step by step.

Coming from Auth0? Read the migration guide