/neon:setup-neon-js [--generate-types]from neon
Set up the unified Neon JS SDK with auth and data API
Ships in neon. Installing the plugin adds it to Claude Code.
Set up the unified Neon JS SDK for combined authentication and database operations.
Install the Neon JS SDK:
npm install @neondatabase/neon-js
Determine if this is Next.js or Vite/React:
next.config.js → Next.jsvite.config.ts → ViteCreate the client configuration:
For Next.js (lib/neon-client.ts):
import { createClient } from '@neondatabase/neon-js';
export const client = createClient({
auth: {
url: process.env.NEXT_PUBLIC_NEON_AUTH_URL!,
},
dataApi: {
url: process.env.NEON_DATA_API_URL!,
},
});
For Vite (src/neon-client.ts):
import { createClient } from '@neondatabase/neon-js';
export const client = createClient({
auth: {
url: import.meta.env.VITE_NEON_AUTH_URL,
},
dataApi: {
url: import.meta.env.VITE_NEON_DATA_API_URL,
},
});
Update environment variables:
For Next.js (.env.local):
NEXT_PUBLIC_NEON_AUTH_URL=https://ep-xxx.neonauth.us-east-2.aws.neon.build/dbname/auth
NEON_DATA_API_URL=https://ep-xxx.apirest.us-east-2.aws.neon.build/dbname/rest/v1
For Vite (.env):
VITE_NEON_AUTH_URL=https://ep-xxx.neonauth.us-east-2.aws.neon.build/dbname/auth
VITE_NEON_DATA_API_URL=https://ep-xxx.apirest.us-east-2.aws.neon.build/dbname/rest/v1
If --generate-types flag, generate TypeScript types:
npx @neondatabase/neon-js gen-types \
--db-url "$DATABASE_URL" \
--output src/types/database.ts
Then update the client to use types:
import type { Database } from './types/database';
const client = createClient<Database>({...});
Create example usage file showing common operations:
Print next steps:
client.from('table').select() for queriesFiles this command reads when invoked
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub innocraft-systems/innocraft-plugin --plugin neon11 commands in this plugin
/add-docsAdd Neon best practices documentation to the project/branchNeon Branch CommandCreate a Neon database branch for testing, development, or preview environments. Branches are instant copy-on-write snapshots./create-ephemeral-dbCreate an ephemeral Neon database for testing/migrateNeon Migrate CommandRun Drizzle migrations on your Neon database. Supports generate, migrate, push, and studio commands with proper connection handling./setup-auth-nextjsSet up Neon Auth for a Next.js App Router application/setup-auth-reactSet up Neon Auth for a React SPA (Vite)