Skip to main content
Home

latest
It is unknown whether this package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Node.js
It is unknown whether this package works with Deno
It is unknown whether this package works with Bun
It is unknown whether this package works with Browsers
JSR Score
52%
Published
10 months ago (0.0.1)

@neondatabase/toolkit

This is a toolkit that Bundles Neon's API Client as well as Neon's Serverless Driver.

You can use it to simplify the process of creating a Neon project and running SQL queries. This is ideal for test environments, where you don't want to set up a Neon project manually.

Furthermore, it's also a great choice for AI agents which need to interact with Neon.

Caution

This is in very early development and API stability is not guaranteed.

import { NeonToolkit } from "@neondatabase/toolkit";

const toolkit = new NeonToolkit(process.env.API_KEY!);
const project = await toolkit.createProject();

await toolkit.sql(
  project,
  `
    CREATE TABLE IF NOT EXISTS
        users (
            id UUID PRIMARY KEY,
            name VARCHAR(255) NOT NULL
        );
`,
);

await toolkit.sql(
  project,
  `
    INSERT INTO users (id, name) VALUES (gen_random_uuid(), 'Sam Smith');
`,
);

console.log(
  await toolkit.sql(
    project,
    `
    SELECT name FROM users;
`,
  ),
);

await toolkit.deleteProject(project);

To run this:

API_KEY=<YOUR_API_KEY> node index.js # bun also works

Accessing the API Client

import { NeonToolkit } from "@neondatabase/toolkit";

const toolkit = new NeonToolkit(process.env.API_KEY!);

const project = await toolkit.createProject();

const apiClient = toolkit.apiClient;

// Now, you have the underlying API client which lets you interact with Neon's API.

Security

Neon adheres to the securitytxt.org standard for transparent and efficient security reporting. For details on how to report potential vulnerabilities, please visit our Security reporting page or refer to our security.txt file.

If you have any questions about our security protocols or would like a deeper dive into any aspect, our team is here to help. You can reach us at security@neon.tech.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@neon/toolkit

Import symbol

import * as toolkit from "@neon/toolkit";
or

Import directly with a jsr specifier

import * as toolkit from "jsr:@neon/toolkit";

Add Package

pnpm i jsr:@neon/toolkit
or (using pnpm 10.8 or older)
pnpm dlx jsr add @neon/toolkit

Import symbol

import * as toolkit from "@neon/toolkit";

Add Package

yarn add jsr:@neon/toolkit
or (using Yarn 4.8 or older)
yarn dlx jsr add @neon/toolkit

Import symbol

import * as toolkit from "@neon/toolkit";

Add Package

vlt install jsr:@neon/toolkit

Import symbol

import * as toolkit from "@neon/toolkit";

Add Package

npx jsr add @neon/toolkit

Import symbol

import * as toolkit from "@neon/toolkit";

Add Package

bunx jsr add @neon/toolkit

Import symbol

import * as toolkit from "@neon/toolkit";