Skip to contentSkip to navigation

Quickstart

Create an app, make a delivery key, then let Own Auth Delivery send auth emails for that app.

Create An App

  1. Sign in to the Own Auth Delivery dashboard.
  2. Add a standalone app.
  3. Add the URLs that are allowed to receive auth redirects.
  4. Create a delivery key for that app.
  5. Save the raw delivery key in your backend environment.

Configure Own Auth

auth.ts
import { OwnAuthManagedEmailProvider, createOwnAuth } from "own-auth";

export const auth = createOwnAuth({
  tokenPepper: process.env.OWN_AUTH_TOKEN_PEPPER,
  baseUrl: "https://your-app.com",
  emailProvider: new OwnAuthManagedEmailProvider({
    deliveryKey: process.env.OWN_AUTH_EMAIL_DELIVERY_KEY
  })
});

For the managed service, the delivery key is the only delivery-specific value your app needs. Own Auth uses https://api.own-auth.com/v1/email by default. Set a custom endpoint only when you run this delivery service yourself.

Send Email

login.ts
await auth.requestMagicLink({
  email: "user@example.com",
  redirectUrl: "/dashboard"
});

Own Auth creates the login URL. The managed email provider sends that URL through Own Auth Delivery.