Skip to content

Releases: oskar-gmerek/surreal-better-auth

Beta Release 2.0.0-beta.4

28 Feb 14:52

Choose a tag to compare

Pre-release

Beta Release 2.0.0-beta.3

28 Feb 01:14

Choose a tag to compare

Pre-release

Beta Release 2.0.0-beta.1

28 Feb 00:36

Choose a tag to compare

Pre-release

Full Changelog: v1.0.0...2.0.0-beta.1

Release v2.0.0-beta.8

04 Mar 03:02

Choose a tag to compare

Release v2.0.0-beta.8 Pre-release
Pre-release

What's Changed

Full Changelog: 1.0.0-beta.8...v2.0.0-beta.8

Release v2.0.0-beta.7

04 Mar 01:48

Choose a tag to compare

Release v2.0.0-beta.7 Pre-release
Pre-release

What's Changed

Full Changelog: 1.0.0-beta.8...v2.0.0-beta.7

Release v2.0.0-beta.6

01 Mar 01:11

Choose a tag to compare

Release v2.0.0-beta.6 Pre-release
Pre-release

What's Changed

Full Changelog: 1.0.0-beta.8...v2.0.0-beta.6

Release v1.0.0

12 Sep 22:34

Choose a tag to compare

SurrealDB Adapter for Better Auth

surreal-better-auth v1

🚀 Features & Enhancements

  • Official Adapter Compliance: The adapter now uses the createAdapter utility from better-auth, ensuring full compatibility with the core library and its features, including CLI-based schema generation.
  • Advanced ID Generation: Introduced a powerful idGenerator configuration option. It provides out-of-the-box support for:
    • SDK-generated IDs: sdk.UUIDv4, sdk.UUIDv7
    • Database-generated IDs: surreal, surreal.ULID, surreal.UUID, surreal.UUIDv4, surreal.UUIDv7, surreal.guid
  • Priority for Custom ID Functions: The adapter fully respects the advanced.database.generateId() function from better-auth, giving it priority over the idGenerator setting.
  • Query Optimization: Implemented significant performance optimizations by operating directly on records wherever possible (e.g., findOne, update, delete by ID). This also applies to bulk operations, reducing query complexity.
  • Enhanced Security: All queries are now built using PreparedQuery to parameterize user-provided data, offering strong protection against injection attacks.
  • Intelligent Record Links: The adapter automatically converts string IDs to SurrealDB Record Links for relational fields. It intelligently detects cases where a value must remain a string to ensure compatibility across the ecosystem.
  • Streamlined Schema Generation: The adapter's createSchema function now integrates with the better-auth CLI's command for schema generation. This process produces a clean, commented .surql file ready for use.
    • Note on Application: While the CLI handles the file generation, the schema must be applied manually to your SurrealDB instance (e.g., via the Surrealist UI or a similar tool). Direct execution of migrations through the better-auth CLI is not supported.
    • Rich & Indexed Schema: The generated schema is more detailed and robust, automatically creating recommended indexes on critical fields (e.g., user.email, session.userId) for better performance.
  • Debugging Tools: Added a debugLogs option that, when enabled, prints fully resolved queries to the console, simplifying development and troubleshooting.
  • Custom ID Handling: A new allowPassingId option allows you to either provide custom record IDs directly in your data or have them safely removed before insertion.

🔧 Refactoring & Architecture

  • Complete Rewrite: The adapter's codebase has been modernized and refactored for improved reliability, maintainability, and to handle numerous edge cases.
  • Declarative Logic: Internal logic now uses declarative mappings for field references, operators, and special cases, making the adapter more predictable and easier to extend.
  • Modular Structure: The project has been split into logical modules (surreal-adapter.ts, helpers.ts, types.ts), enhancing code clarity and organization.
  • Standardized Testing: By adhering to the new guidelines, the adapter can now run the official better-auth test suite directly, ensuring consistent and reliable behavior.

📦 Build & Packaging

  • Monorepo Structure: The repository is now a monorepo, which will simplify future integration testing and the development of usage examples.
  • Modern Build Process: The package is transpiled to support a wider range of environments, with both ESM and CommonJS builds included.

Oskar Gmerek // SurrealDB // Better-Auth


Beta Release 1.0.0-beta.8

12 Sep 21:24

Choose a tag to compare

Pre-release

Beta Release 1.0.0-beta.7

12 Sep 20:36

Choose a tag to compare

Pre-release

What's Changed

New Contributors

Full Changelog: 1.0.0-beta.6...1.0.0-beta.7

Beta Release 1.0.0-beta.6

02 Sep 09:42

Choose a tag to compare

Pre-release