Automate schema migrations using DizzleORM and GitHub Actions - Manage thousands of tenants with this workflow
Docs/SDKs/TypeScript SDK

TypeScript SDK for the Neon API

What you will learn:

  • What is the Neon TypeScript SDK

  • How to get started

Related resources

About the SDK

Neon supports the @neondatabase/api-client library, which is a wrapper for the Neon API. This SDK simplifies integration of TypeScript applications with the Neon platform, providing methods to programmatically manage API keys, Neon projects, branches, databases, endpoints, roles, and operations.

Installation

You can install the library using npm or yarn.

npm:

npm install @neondatabase/api-client

yarn:

yarn add @neondatabase/api-client

Get Started

To get started with the @neondatabase/api-client library, follow these steps:

  1. Obtain an API key from the Account settings page in the Neon Console.

  2. Click Generate new API key.

  3. Enter a name for your API key and click Create.

  4. Save your API key to a secure location that enables you to pass it to your code.

  5. Import the library:

    import { createApiClient } from '@neondatabase/api-client';
  6. Create an instance of the API client by calling the createApiClient function:

    const apiClient = createApiClient({
      apiKey: 'your-api-key',
    });
  7. Use the apiClient instance to make API calls. For example:

    const response = await apiClient.listProjects({});
    console.log(response);

Last updated on

Was this page helpful?