Database token access
Connect to Postgres with a Supabase access token instead of the database password.
Database token access replaces the database password with a Supabase access token. Team members, approved OAuth apps, and automated jobs each connect with their own token. You decide which Postgres roles each person can assume, for how long, and from which networks.
Database token access is in public alpha on the Supabase platform. In the Supabase Dashboard, turn on the Database token access feature preview to manage it.
Key features
- Personal credentials: Each team member connects with their own token. Nobody needs the
postgrespassword. - Supabase access tokens: Connect with a personal access token or an approved OAuth app's token. A scoped personal access token needs the Database token access permission. Vercel Marketplace projects can also connect with Vercel resource tokens.
- Member access rules: Map each team member to the Postgres roles they can assume. The role's own permissions apply.
- Expiry and network limits: End a rule on a date you set. Limit it to the IP ranges a team member connects from.
- Preview branches: Rules on your main project apply to all of its preview branches. You can also limit a role to preview branches only.
- Existing connection strings: Replace the password in a direct or shared pooler connection string with your token and connect as a role your member access rule allows. Direct connections work as they are. Shared pooler connections also need SSL and the
jit=trueoption.
Database token access is particularly valuable for:
- Teams where everyone connects to the database directly or through the shared pooler
- Contractors and support engineers who need database access for a limited time
- CI jobs such as GitHub Actions that should use their own scoped token instead of the role's password
- Removing one person's access without rotating the database password
Frequently asked questions
Which permission does a scoped personal access token need?
When you create the token, set Database token access to at least Read only for the project.
Does the role's password stop working?
No. The role's own password keeps working. Long-lived service connections that use it don't change.
Does removing access close open connections?
No. Removing access, an expiry passing, or a revoked token blocks new connections only. Connections that are already open remain open until you terminate them.
The shared pooler in transaction mode is the exception. After one of these changes it can disconnect clients, including team members whose access hasn't changed. Reconnect with a valid token to continue.
Revoking a Trusted Partner app also closes the app's open connections. See OAuth apps with database token access.
What does a project need?
The project needs SSL enforcement turned on and Postgres 17.6.1.081 or later.