Auth

Enable Neon Auth for the branch

Enables Neon Auth for the specified branch by connecting it to an authentication provider. Creating the integration provisions the neon_auth schema in the branch database, which stores user identity data synchronized from the provider.

post/projects/{project_id}/branches/{branch_id}/auth

Request

  • Base URL: https://console.neon.tech/api/v2
  • URL: https://console.neon.tech/api/v2/projects/{project_id}/branches/{branch_id}/auth
  • Auth: one of:
    • HTTP bearer
    • API key in cookie zenith
    • API key in cookie keycloak_token

Request body

auth_provider'mock' | 'stack' | 'better_auth' required

Authentication provider integrated with this Neon Auth configuration. better_auth integrates with Better Auth (the current, recommended provider). stack integrates with Stack Auth (deprecated). mock is a simulated provider for local development and testing only.

database_namestring

Name of the database to enable Neon Auth on. When omitted, the integration uses the project's default database.

Response

Enables Neon Auth integration for the branch

auth_provider'mock' | 'stack' | 'better_auth' required

Authentication provider integrated with this Neon Auth configuration. better_auth integrates with Better Auth (the current, recommended provider). stack integrates with Stack Auth (deprecated). mock is a simulated provider for local development and testing only.

auth_provider_project_idstring required

Project ID assigned by the auth provider for this integration.

pub_client_keystring required

Publishable SDK key from the auth provider. Populated only for Stack Auth (deprecated); empty for Better Auth.

secret_server_keystring required

Secret server-side SDK key from the auth provider. Populated only for Stack Auth (deprecated); empty for Better Auth. Treat as a credential.

jwks_urlstring required

URL of the provider's JWKS endpoint used to verify JWTs.

schema_namestring required

Postgres schema containing the auth integration tables. Defaults to neon_auth.

table_namestring required

Postgres table in the integration schema where synced user records are stored.

base_urlstring

Base URL of the Neon Auth service for this integration. Set as the NEON_AUTH_BASE_URL environment variable in your application.

Changes

No recorded changes to this operation across all 15 revisions of this API.