blade-better-auth (current stable version 3.18.35) functions as a specialized database adapter, integrating the `better-auth` authentication framework with RONIN databases. Its primary role is to facilitate the storage of session and user data within a RONIN backend by translating `better-auth`'s core schema requirements into RONIN's data modeling language. This package provides a `ronin()` factory function that can either operate with a default RONIN client instance or accept a custom `blade-client` instance, offering flexibility for advanced configurations like specific token management. The library ships with comprehensive TypeScript type definitions, ensuring type-safe development. Operating under a rapid versioning scheme, it undergoes continuous maintenance and updates, reflecting its active role within the RONIN ecosystem. It distinguishes itself by providing the specific bridge and schema translations necessary for this particular technology stack.
npm install blade-better-authVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing Better Auth with `blade-better-auth` using both a default and a custom RONIN client instance, highlighting common setup patterns for session management.
Migrate your project to use ECMAScript Modules (ESM) by adding `'type': 'module'` to your `package.json` or use dynamic `import()` for `blade-better-auth`.
Refer to the `blade-better-auth` README and `better-auth` documentation for the exact schema requirements and implement them accurately in your RONIN database via `blade/schema`.
Ensure your `blade-client` version is compatible with your `blade-better-auth` version. Always check both package changelogs before upgrading either dependency.
Set the `RONIN_TOKEN` environment variable with a valid API token or explicitly pass a valid token to `createSyntaxFactory({ token: 'your_token' })`.Switch your project to use ECMAScript Modules (ESM) by adding `'type': 'module'` to your `package.json` or use dynamic `import()` for `blade-better-auth`.
Verify that the `User`, `Session`, `Account`, and `Verification` models are accurately set up in your RONIN database according to the `better-auth` 'core schema' requirements, as detailed in the `blade-better-auth` README.
Install the required version of `blade-client` using `npm install blade-client@^3.16.2` (or `yarn add blade-client@^3.16.2` / `pnpm add blade-client@^3.16.2`).
Ensure the `RONIN_TOKEN` environment variable is correctly set with a valid RONIN API token, or explicitly pass a valid token string to `createSyntaxFactory({ token: 'your_token_here' })` when creating your custom client.