@auth/surrealdb-adapter
Official SurrealDB adapter for Auth.js / NextAuth.js.
Installation
npm install @auth/surrealdb-adapter surrealdb.jsAccountDoc<T>
type AccountDoc<T> = Document<RecordId<"account">> & {
  access_token: string;
  expires_at: number;
  provider: string;
  providerAccountId: string;
  refresh_token: string;
  type: AdapterAccountType;
  userId: T;
};Type declaration
access_token?
optional access_token: string;expires_at?
optional expires_at: number;provider
provider: string;providerAccountId
providerAccountId: string;refresh_token?
optional refresh_token: string;type
type: AdapterAccountType;userId
userId: T;Type Parameters
| Type Parameter | Default type | 
|---|---|
| T | RecordId<"user"> | 
AuthenticatorDoc<T>
type AuthenticatorDoc<T> = Document<RecordId<"authenticator">> & Omit<AdapterAuthenticator, "userId"> & {
  counter: number;
  userId: T;
};Type declaration
counter
counter: number;userId
userId: T;Type Parameters
| Type Parameter | Default type | 
|---|---|
| T | RecordId<"user"> | 
SessionDoc<T>
type SessionDoc<T> = Document<RecordId<"session">> & {
  expires:   | string
     | Date;
  sessionToken: string;
  userId: T;
};Type declaration
expires
expires: 
  | string
  | Date;sessionToken
sessionToken: string;userId
userId: T;Type Parameters
| Type Parameter | Default type | 
|---|---|
| T | RecordId<"user"> | 
UserDoc
type UserDoc = Document<RecordId<"user">> & {
  email: string;
  emailVerified:   | string
     | Date;
};Type declaration
email: string;emailVerified?
optional emailVerified: 
  | string
  | Date;VerificationTokenDoc
type VerificationTokenDoc = Document<RecordId<"verification_token">> & {
  expires: Date;
  identifier: string;
  token: string;
};Type declaration
expires
expires: Date;identifier
identifier: string;token
token: string;SurrealDBAdapter()
function SurrealDBAdapter(client): AdapterParameters
| Parameter | Type | 
|---|---|
| client | Promise<Surreal> |