SurrealDB adapter for Better Auth (v0.2.1) — connects SurrealDB v3 multi-model database to Better Auth's authentication system via the surrealdb@^2.0.3 JS SDK. Integrates with Better Auth CLI to generate SurrealQL schema. Supports multiple ID generation strategies (ULID, UUIDv4, UUIDv7, GUID, auto) either server-side or SDK-side, and accepts both Surreal and SurrealSession instances. Requires Node.js ≥20 or Bun ≥1.2. Key differentiator: native SurrealDB identity generation and datetime handling fixes.
npm install surrealdb-auth-adapterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to instantiate Surreal, configure betterAuth with the surrealdbAdapter, and export an auth function for sign-up.
Upgrade to v0.2.1 or later. The fix ensures DateTime objects are converted to Date via recordIdsToStrings.
Set `usePlural: true` in the adapter configuration or align your SurrealQL schema accordingly.
Use `import` syntax or ensure Node.js ≥20 with `"type": "module"` in package.json.
Run `npm install surrealdb-auth-adapter surrealdb better-auth` (or equivalent with bun).
Upgrade to v0.2.1. No known breaking changes from 0.2.0 to 0.2.1.
Update to surrealdb-auth-adapter v0.2.1 which properly converts DateTime to Date.
Install all required packages: npm install surrealdb-auth-adapter surrealdb better-auth
Use import syntax or enable ESM support (e.g., "type": "module" in package.json).