Skip to content

Nuxt Neon

Nuxt module allowing smooth integration with Neon database

Neon is a serverless PostgreSQL database provider, offering scalable and efficient database solutions for modern applications. They are shipping raw SQL interface via their serverless driver allowing easy integration with various platforms. This module builds upon this driver allowing you to start working with Neon in Nuxt v4 application right away.

How to use?

Install the module to your Nuxt application via Nuxt DevTools or manually with command:

sh
pnpx nuxi module add nuxt-neon
sh
npx nuxi module add nuxt-neon
sh
yarn dlx nuxi module add nuxt-neon
sh
$ bunx nuxi module add nuxt-neon
sh
$ deno run --allow-run npm:npx nuxi module add nuxt-neon

Provide connection details via env variables:

.env
sh
NUXT_NEON_HOST=your-neon-host
NUXT_NEON_USER=your-neon-user
NUXT_NEON_PASS=your-neon-password
NUXT_NEON_DB=your-neon-database

Obtain the Neon serverless driver instance on the Nuxt server with:

ts
const { neon } = useNeonDriver()

That's it! Your Nuxt app is now connected to a Neon database instance ✨

TIP

Note that Nuxt Neon module requires Nitro server runtime to work. Therefore, it cannot be used in static builds.

More info