Skip to contentSkip to navigation

Run The Service

Run the web service, database, queue, and worker when you operate Own Auth Delivery yourself.

Database

Run the Own Auth migration first, then run the Delivery Knex migrations. The dashboard uses Own Auth for its own sign-in flow.

bash
npx own-auth migrate
npm run db:migrate

Required Environment

bash
DATABASE_URL=postgresql://...
OWN_AUTH_TOKEN_PEPPER=...
OWN_AUTH_DELIVERY_KEY_PEPPER=...
EMAIL_FROM="Own Auth <auth@mail.own-auth.com>"
RESEND_API_KEY=...
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
AWS_REGION=us-east-1
OWN_AUTH_DELIVERY_QUEUE_URL=https://sqs.us-east-1.amazonaws.com/...
OWN_AUTH_DELIVERY_MAX_PER_KEY_MINUTE=60
OWN_AUTH_DELIVERY_MAX_PER_RECIPIENT_HOUR=5

New delivery projects send from {app name} <auth@mail.own-auth.com> unless a custom sender is configured. Platform account emails use EMAIL_FROM, which must be verified with the configured outbound sender.

Web And Worker

The web service accepts delivery requests and queues email jobs. The worker pulls jobs from the queue and sends them. Soft failures are retried three times with 30 second, 2 minute, and 10 minute delays. Hard bounces are marked failed immediately.

bash
npm run dev
npm run worker