0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00
mastra/auth/neon
History 2026-11-12 21:12:29 +00:00
..
src feat: pass the authenticated user to DynamicArgument callbacks (#28612) 2026-11-12 10:55:12 -05:00
CHANGELOG.md chore: version - exit prerelease mode 2026-11-12 21:12:29 +00:00
lint-staged.config.js refactor(lint): replace ESLint with type-aware oxlint (#27476) 2026-10-18 10:38:35 -07:00
package.json chore: version - exit prerelease mode 2026-11-12 21:12:29 +00:00
README.md fix(auth-neon): support hosted Neon Auth and document integration (#29633) 2026-11-06 13:20:33 -08:00
tsconfig.build.json fix(auth-neon): support hosted Neon Auth and document integration (#29633) 2026-11-06 13:20:33 -08:00
tsconfig.json chore: migrate package builds to tsdown (#19829) 2026-07-28 12:32:21 +02:00
tsdown.config.ts chore: migrate package builds to tsdown (#19829) 2026-07-28 12:32:21 +02:00
turbo.json chore: migrate package builds to tsdown (#19829) 2026-07-28 12:32:21 +02:00
vitest.config.ts feat(neon): add Neon Auth adapter (#17864) 2026-06-11 21:25:12 -07:00

@mastra/auth-neon

@mastra/auth-neon connects Neon Auth, the managed authentication service built on Better Auth, to Mastra. Use it when Neon manages your users and you need JWT, session-cookie, Studio sign-in, or organization-based authorization support.

Installation

npm install @mastra/auth-neon

Usage

Set NEON_AUTH_BASE_URL to the Neon Auth URL from the Neon Console (for example https://ep-example-123456.neonauth.us-east-2.aws.neon.tech/neondb/auth) before starting Mastra.

import { MastraAuthNeon } from '@mastra/auth-neon';
import { Mastra } from '@mastra/core/mastra';

export const mastra = new Mastra({
  server: {
    auth: new MastraAuthNeon({
      baseUrl: process.env.NEON_AUTH_BASE_URL,
    }),
  },
});

Documentation

Testing

pnpm test runs the end-to-end suite against a local Neon Auth stand-in. To run the same suite against a live Neon project, enable Neon Auth (with email and password sign-in, sign-up, and Allow localhost on) and set NEON_AUTH_LIVE_BASE_URL:

NEON_AUTH_LIVE_BASE_URL=https://ep-example-123456.neonauth.us-east-2.aws.neon.tech/neondb/auth pnpm test

The live run signs up throwaway @example.com users in that project.

Changelog

See the package changelog for version history and release notes.

Support

We have an open community Discord. Come and say hello and let us know if you have any questions or need any help getting things running.