Skip to content

createNeonClient

createNeonClient(opts): object

Defined in: index.ts:21

Creates a Neon API client with branches, connection, databases and users groups, all sharing one REST client.

NeonClientOptions

object

apiKeys: object

create: (keyName) => Promise<NeonApiKeyCreated>

Makes a personal API key for the user the calling key belongs to (POST /api_keys). Neon keys carry the user’s full access and never expire.

string

Promise<NeonApiKeyCreated>

revoke: (keyId) => Promise<NeonApiKeyRevoked>

Revokes a personal API key by its id (DELETE /api_keys/{key_id}); the id goes through encodeURIComponent. A key Neon does not have is a ProviderApiError.

string

Promise<NeonApiKeyRevoked>

branches: object

create: (projectId, input) => Promise<NeonBranchResponse>

string

CreateNeonBranchInput

Promise<NeonBranchResponse>

destroy: (projectId, branchId) => Promise<void>

string

string

Promise<void>

list: (projectId) => Promise<NeonBranchesResponse>

string

Promise<NeonBranchesResponse>

restore: (projectId, branchId, sourceBranchId) => Promise<void>

string

string

string

Promise<void>

connection: object

uri: (projectId, params) => Promise<NeonConnectionUriResponse>

string

NeonConnectionUriParams

Promise<NeonConnectionUriResponse>

databases: object

list: (projectId, branchId) => Promise<NeonDatabasesResponse>

string

string

Promise<NeonDatabasesResponse>

runSql: (projectId, branchId, dbName, query) => Promise<void>

string

string

string

string

Promise<void>

users: object

me: () => Promise<NeonMe>

Promise<NeonMe>