跳至內容
從 NextAuth.js v4 遷移?請閱讀 我們的遷移指南.
API 參考@auth/typeorm-adapter

@auth/typeorm-adapter

適用於 Auth.js / NextAuth.js 的官方 TypeORM 适配器。

安裝

npm install @auth/typeorm-adapter typeorm

TypeORMAdapterOptions

這是 TypeORM 适配器選項的介面。

屬性

entities?

optional entities: entities;

用於建立資料庫表格的 TypeORM 實體


實體

type Entities: typeof entities;

entities

const entities: entities = defaultEntities;

TypeORMAdapter()

TypeORMAdapter(dataSource, options?): Adapter

參數

參數類型
dataSourcestring | DataSourceOptions
options?TypeORMAdapterOptions

返回

Adapter


getManager()

getManager(options): Promise<EntityManager>

參數

參數類型
options物件
options.dataSourcestring | DataSourceOptions
options.entities實體

返回

Promise<EntityManager>

Auth.js © Balázs Orbán 和團隊 -2024