Authentication (NextAuth)
NextAuth needs a session secret and the app's public URL — two variables, no account to create.
NextAuth is what keeps people logged in after they come back from Discord. It does not need an account or a dashboard: the only two things it wants from you are a session secret and the app's public URL.
Generate the session secret
This produces a random string. Run it once and keep the output.
openssl rand -base64 32The generated string has to be kept — it is your NEXTAUTH_SECRET.
NEXTAUTH_URL is the app's public URL: localhost:3000 in a local
environment, and in production your own domain (or the one the deploy provider
generates).
You may not know the domain yet
NEXTAUTH_URL only becomes final once the app is deployed and has an
address. Locally it is http://localhost:3000; in production it is the
domain from Production deploy (Railway) or Demo
deploy (Render). Come back and set it then.
Who becomes admin
The first account to sign in on an empty database is created with the ADMIN
role, and a Geral text channel and a Geral voice channel are created along
with it. There is no environment variable for this: sign in yourself before
sharing the URL with anyone.
Everyone who signs in after that starts with no channel access. The admin
grants it in /admin/channels.
Variables from this step
| Variable | Value |
|---|---|
NEXTAUTH_SECRET | The random string generated above |
NEXTAUTH_URL | https://YOUR-DOMAIN (no trailing slash) |