Skip to content
Migrate

Migrate from Better Auth

Move to Paycux from Better Auth without a flag day, keeping existing sessions alive.

Introduction

Migrate from Better Auth is part of the Paycux platform. This page explains what it does, when to reach for it, and the smallest working setup you can ship.

Everything below applies to both environments. Build and test in staging, then promote the same configuration to production without changing your code — only the API key and client ID differ.

Export Better Auth data

Export Better Auth data is handled by Migrate from Better Auth rather than by your application code. Paycux exposes it through the same API surface as the rest of the platform, so the client you already configured needs no additional setup.

Configuration lives in the dashboard and is versioned per environment. Change it in staging, confirm the behaviour, then apply the same change to production.

Accessing your database

Accessing your database is handled by Migrate from Better Auth rather than by your application code. Paycux exposes it through the same API surface as the rest of the platform, so the client you already configured needs no additional setup.

Configuration lives in the dashboard and is versioned per environment. Change it in staging, confirm the behaviour, then apply the same change to production.

Exporting user data

A user record holds the identity Paycux resolved for the person: email, name, verification state, and the identities they have linked. It is the object your application should key on.

Users are unique by email within a project. When the same person arrives through a second provider, Paycux links the identity to the existing user rather than creating a duplicate.

Exporting passwords

Exporting passwords is handled by Migrate from Better Auth rather than by your application code. Paycux exposes it through the same API surface as the rest of the platform, so the client you already configured needs no additional setup.

Configuration lives in the dashboard and is versioned per environment. Change it in staging, confirm the behaviour, then apply the same change to production.

Import users into Paycux

Migrations run alongside your current system rather than replacing it in one step. Import the accounts you already have, run both paths in parallel, then cut over once the numbers agree.

  1. 1Export your existing users with their stable identifiers and email addresses.
  2. 2Import them into Paycux; imported users keep their original ID under external_id so your foreign keys stay valid.
  3. 3Send new sign-ins through Paycux while old sessions continue to work.
  4. 4Retire the old path once sign-in volume through Paycux matches your baseline.

Using the Paycux migrations CLI

Using the Paycux migrations CLI applies specifically to Migrate from Better Auth. It behaves the same in both environments, and the values it depends on are visible in the dashboard for the environment you have selected.

If the behaviour you see does not match this description, check which environment your API key belongs to before anything else — a staging key against production data is the most common cause.

Using Paycux APIs

Using Paycux APIs is handled by Migrate from Better Auth rather than by your application code. Paycux exposes it through the same API surface as the rest of the platform, so the client you already configured needs no additional setup.

Configuration lives in the dashboard and is versioned per environment. Change it in staging, confirm the behaviour, then apply the same change to production.