You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(adapters): BREAKING CHANGE: transistion to surrealdb@^1.0.0 (#11911)
* feat: transition from surrealdb.js beta to [email protected]
* fix: ensure correct adapter type is returned with verified is nulled if not provided
* fix: remove log print on test
* feat: more AnyAuth login variables, support HTTP rpc connection, add exponential backoff for disconnection events to example
* restore: changes
* restore: changes
* doc: add all env variables available
* fix: throw error not string
* fix: uses surrealdb:^v1.3.0 for native reconnectivity, feat: add webauthn funcs to adapter
* fix: creating user should use id() not randomUUID()
* fix: ignored files from prettier
* chore: upgrade lockfile as requested
* fix: tsc build errors
* fix: tsc build errors
---------
Co-authored-by: Thang Vu <[email protected]>
Co-authored-by: Nico Domino <[email protected]>
@@ -13,17 +13,27 @@ import { Code } from "@/components/Code"
13
13
### Installation
14
14
15
15
```bash npm2yarn
16
-
npm install @auth/surrealdb-adapter surrealdb.js
16
+
npm install @auth/surrealdb-adapter surrealdb
17
17
```
18
18
19
19
### Environment Variables
20
20
21
+
A valid authentication combination must be provided. The following authentication combinations are supported:
22
+
23
+
- RootAuth
24
+
- NamespaceAuth
25
+
- DatabaseAuth
26
+
- ScopeAuth
27
+
21
28
```sh
22
-
AUTH_SURREALDB_CONNECTION
23
-
AUTH_SURREALDB_USERNAME
24
-
AUTH_SURREALDB_PASSWORD
25
-
AUTH_SURREALDB_NS
26
-
AUTH_SURREALDB_DB
29
+
AUTH_SURREAL_URL (required)
30
+
AUTH_SURREAL_NS
31
+
AUTH_SURREAL_DB
32
+
AUTH_SURREAL_USER
33
+
AUTH_SURREAL_PW
34
+
AUTH_SURREAL_SCOPE
35
+
SURREAL_NS (required when using RootAuth or NamespaceAuth)
36
+
SURREAL_DB (required when using RootAuth or NamespaceAuth)
27
37
```
28
38
29
39
### Configuration
@@ -97,84 +107,172 @@ app.use(
97
107
98
108
The SurrealDB adapter does not handle connections automatically, so you will have to make sure that you pass the Adapter a `SurrealDBClient` that is connected already. Below you can see an example how to do this.
thrownewError("unsupported any auth configuration")
226
+
}
227
+
returnauth
228
+
}
229
+
```
230
+
100
231
### Authorization
101
232
102
-
#### Option 1 – Using RPC:
233
+
The clientPromise provides a connection to the database. You could use any connect option you wish. For quick setup, use the DatabaseAuth method. For best security, we recommend creating a Record Access method if you know how to properly setup access table permissions.
0 commit comments