next-auth
next-auth copied to clipboard
fix(adapter): transistion to surrealdb@^1.0.0
βοΈ Reasoning
Moves package dependency to version 1 of the surrealdb javascript library. Package includes websocket connectivity, type safety, updates to the setup documentation, and package peer dependency change.
π§’ Checklist
- [x] Documentation
- [x] Tests
- [x] Ready to be merged
π« Affected issues
#11732 - solves this by transistioning to [email protected] package. Docs state to use new connection string. #11866 - javascript package supports surrealdb v2 #11471 - uses current surrealdb software
π Resources
The latest updates on your projects. Learn more about Vercel for Git βοΈ
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| auth-docs | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Jun 3, 2025 10:30am |
1 Skipped Deployment
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| next-auth-docs | β¬οΈ Ignored (Inspect) | Visit Preview | Jun 3, 2025 10:30am |
@dvanmali is attempting to deploy a commit to the authjs Team on Vercel.
A member of the Team first needs to authorize it.
Any updates on this PR? Would love to see it merged so we can use SurrealDB with Auth.js!
Any updates on this PR? Would love to see it merged so we can use SurrealDB with Auth.js!
Package is ready to go. Still waiting for PR to merge.
@ubbe-xyz @ndom91
Bump. I'm waiting for this PR to use Auth.js since I'm using Surrealdb.
This is breaking, right? Well have to make sure we bump the surreal adapter appropriately
ndom91 This is breaking, right? Well have to make sure we bump the surreal adapter appropriately
Yes, this is a breaking update because the underlying storage layer and transmission layer are now both typed. Thus this package jumps to version 2.0.0 with surrealdb@^1.0.0
Surreal Cloud just launched! I am planning to use it everywhere I can. Do you know what is blocking this PR?
Is this PR still up-to-date ? Looking forward to use SurrealDB and AuthJS together but with surrealdb v2 it doesnt work anymore.
Is this PR still up-to-date ? Looking forward to use SurrealDB and AuthJS together but with surrealdb v2 it doesnt work anymore.
Yes this PR should still work with v2, if you have issues let me know
@dvanmali sorry for my bad english, i ment whether this PR will ever get merged :D
I just copied your index.ts file and imported from local package, works perfectly fine. Thanksπ«±πΌβπ«²π½
@ndom91 @0ubbe PR updates? It's been 5 months since opening
Hi @ThangHuuVu ! π
Hope you are doing well!
Could you please help give a review and ship this PR?
This has been blocking for SurrealDB and Auth.js users for a while.
Thank you in advance!
@ThangHuuVu Since this is a blocking PR, can we get this reviewed and merged ASAP please?
@dvanmali the lockfile needs to be updated, could u help with that? You are creating the PR from your main which makes it a bit hard for maintainers to push changes to.
Sure @ThangHuuVu, just updated the lockfile and fixed the shell script so it can now pass your test scripts. It appears that Surrealdb v3-alpha is currently tied to latest so it may not currently be compatible as they mention on their javascript library.
Feel free to message this thread again if you wish for another update or add a PR or issue to my main. Unfortunately because I don't have write access to this repo, i can't make a branch here, hence the forked repo from main
Were you able to take a look @ThangHuuVu?
@dvanmali just approved the jobs but the build is failing, could u help check it? π
Gtg @ThangHuuVu π
@ndom91 @balazsorban44 @ThangHuuVu gtg
Codecov Report
Attention: Patch coverage is 95.95376% with 14 lines in your changes missing coverage. Please review.
Project coverage is 39.43%. Comparing base (
22c1b8b) to head (f27fa22). Report is 1 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| packages/adapter-surrealdb/src/index.ts | 95.95% | 14 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #11911 +/- ##
==========================================
+ Coverage 39.19% 39.43% +0.23%
==========================================
Files 200 200
Lines 31615 31756 +141
Branches 1381 1399 +18
==========================================
+ Hits 12391 12522 +131
- Misses 19224 19234 +10
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@ndom91 @balazsorban44 @ThangHuuVu Vercel keeps blocking the build with "authorization required to deploy"
I merged, thanks for your consistent effort @dvanmali
Love it! Thank you @ThangHuuVu
@dvanmali Can you provide SurrealQL code to setup schemafull tables? Here's what I have so far. ~~The user table is working, the account table is not, and the remainder are untested.~~ Nevermind I got it, below is the working schemafull tables (I included some useful statements)
// User table
DEFINE TABLE user SCHEMAFULL;
DEFINE FIELD email ON user TYPE string ASSERT string::is::email($value);
DEFINE FIELD password ON user TYPE option<string>;
DEFINE FIELD name ON user TYPE string;
DEFINE FIELD image ON user TYPE option<string>;
DEFINE FIELD created_at ON user TYPE datetime DEFAULT time::now();
DEFINE FIELD updated_at ON user TYPE datetime DEFAULT time::now();
DEFINE FIELD last_login ON user TYPE datetime DEFAULT time::now();
DEFINE INDEX email_idx ON user COLUMNS email UNIQUE;
// Session table
DEFINE TABLE session SCHEMAFULL;
DEFINE FIELD userId ON session TYPE record<user>;
DEFINE FIELD expires ON session TYPE datetime;
DEFINE FIELD sessionToken ON session TYPE string;
DEFINE INDEX session_token_idx ON session COLUMNS sessionToken UNIQUE;
// Account table
DEFINE TABLE account SCHEMAFULL;
DEFINE FIELD userId ON account TYPE record<user>;
DEFINE FIELD type ON account TYPE string;
DEFINE FIELD provider ON account TYPE string;
DEFINE FIELD providerAccountId ON account TYPE string;
DEFINE FIELD refresh_token ON account TYPE option<string>;
DEFINE FIELD access_token ON account TYPE string;
DEFINE FIELD expires_at ON account TYPE int;
DEFINE FIELD token_type ON account TYPE string;
DEFINE FIELD scope ON account TYPE string;
DEFINE FIELD id_token ON account TYPE string;
DEFINE FIELD session_state ON account TYPE option<string>;
DEFINE INDEX provider_account_idx ON account COLUMNS provider, providerAccountId UNIQUE;
// VerificationToken table
DEFINE TABLE verification_token SCHEMAFULL;
DEFINE FIELD identifier ON verification_token TYPE string;
DEFINE FIELD token ON verification_token TYPE string;
DEFINE FIELD expires ON verification_token TYPE datetime;
DEFINE INDEX verification_token_idx ON verification_token COLUMNS token UNIQUE;
DEFINE INDEX verification_identifier_token_idx ON verification_token COLUMNS identifier, token UNIQUE;