Skip to content
Migrating from NextAuth.js v4? Read our migration guide.
API reference@auth/typeorm-adapter

@auth/typeorm-adapter

Official TypeORM adapter for Auth.js / NextAuth.js.

Installation

npm install @auth/typeorm-adapter typeorm

TypeORMAdapterOptions

This is the interface for the TypeORM adapter options.

Properties

entities?

optional entities: entities;

The TypeORM entities to create the database tables from.


Entities

type Entities: typeof entities;

entities

const entities: entities = defaultEntities;

TypeORMAdapter()

TypeORMAdapter(dataSource, options?): Adapter

Parameters

ParameterType
dataSourcestring | DataSourceOptions
options?TypeORMAdapterOptions

Returns

Adapter


getManager()

getManager(options): Promise<EntityManager>

Parameters

ParameterType
optionsObject
options.dataSourcestring | DataSourceOptions
options.entitiesentities

Returns

Promise<EntityManager>

Auth.js © Balázs Orbán and Team - 2024