@auth/surrealdb-adapter
Auth.js / NextAuth.js 用の公式 SurrealDB アダプター。
インストール
npm install @auth/surrealdb-adapter surrealdb.js
AccountDoc<T>
type AccountDoc<T>: {
access_token: string;
expires_at: number;
id: string;
provider: string;
providerAccountId: string;
refresh_token: string;
type: Extract<ProviderType, "oauth" | "oidc" | "email" | "webauthn">;
userId: T;
};
型パラメータ
型パラメータ | 値 |
---|---|
T | 文字列 |
型宣言
access_token?
optional access_token: string;
expires_at?
optional expires_at: number;
id
id: string;
プロバイダー
provider: string;
providerAccountId
providerAccountId: string;
refresh_token?
optional refresh_token: string;
type
type: Extract<ProviderType, "oauth" | "oidc" | "email" | "webauthn">;
userId
userId: T;
SessionDoc<T>
type SessionDoc<T>: Document & {
userId: T;
};
型宣言
userId
userId: T;
型パラメータ
型パラメータ | 値 |
---|---|
T | 文字列 |
UserDoc
type UserDoc: Document & {
email: string;
};
型宣言
email: string;
SurrealDBAdapter()
SurrealDBAdapter<T>(client): Adapter
型パラメータ
型パラメータ |
---|
T |
パラメータ
パラメータ | 型 |
---|---|
クライアント | Promise <WebSocketStrategy | HTTPStrategy <T >> |
戻り値
toId()
toId(surrealId): string
パラメータ
パラメータ | 型 |
---|---|
surrealId | 文字列 |
戻り値
文字列
toSurrealId()
toSurrealId(id): string
パラメータ
パラメータ | 型 |
---|---|
id | 文字列 |
戻り値
文字列