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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”object
apiKeys
Section titled “apiKeys”apiKeys:
object
apiKeys.create
Section titled “apiKeys.create”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.
Parameters
Section titled “Parameters”keyName
Section titled “keyName”string
Returns
Section titled “Returns”Promise<NeonApiKeyCreated>
apiKeys.revoke
Section titled “apiKeys.revoke”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.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<NeonApiKeyRevoked>
branches
Section titled “branches”branches:
object
branches.create
Section titled “branches.create”create: (
projectId,input) =>Promise<NeonBranchResponse>
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
Returns
Section titled “Returns”Promise<NeonBranchResponse>
branches.destroy
Section titled “branches.destroy”destroy: (
projectId,branchId) =>Promise<void>
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
branchId
Section titled “branchId”string
Returns
Section titled “Returns”Promise<void>
branches.list
Section titled “branches.list”list: (
projectId) =>Promise<NeonBranchesResponse>
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
Returns
Section titled “Returns”Promise<NeonBranchesResponse>
branches.restore
Section titled “branches.restore”restore: (
projectId,branchId,sourceBranchId) =>Promise<void>
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
branchId
Section titled “branchId”string
sourceBranchId
Section titled “sourceBranchId”string
Returns
Section titled “Returns”Promise<void>
connection
Section titled “connection”connection:
object
connection.uri
Section titled “connection.uri”uri: (
projectId,params) =>Promise<NeonConnectionUriResponse>
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
params
Section titled “params”Returns
Section titled “Returns”Promise<NeonConnectionUriResponse>
databases
Section titled “databases”databases:
object
databases.list
Section titled “databases.list”list: (
projectId,branchId) =>Promise<NeonDatabasesResponse>
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
branchId
Section titled “branchId”string
Returns
Section titled “Returns”Promise<NeonDatabasesResponse>
databases.runSql
Section titled “databases.runSql”runSql: (
projectId,branchId,dbName,query) =>Promise<void>
Parameters
Section titled “Parameters”projectId
Section titled “projectId”string
branchId
Section titled “branchId”string
dbName
Section titled “dbName”string
string
Returns
Section titled “Returns”Promise<void>
users:
object
users.me
Section titled “users.me”me: () =>
Promise<NeonMe>
Returns
Section titled “Returns”Promise<NeonMe>