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
|`dataSource`| DataSource |`null`| dataSource is needed to create tables and execute queries. |
55
+
|`clerkSigningSecret`| string |`null`| Access your signing secret from (https://dashboard.clerk.com/last-active?path=webhooks)|
56
+
|`clerkInstanceId`| string |`null`| (optional) Access your instance ID from (https://dashboard.clerk.com/last-active?path=settings)|
57
+
|`clerkSessionPublicKey`| string |`null`| (optional) Access your public key from (https://dashboard.clerk.com/last-active?path=api-keys) if you want to verify using a public key |
58
+
|`verifySessions`| boolean |`true`| (optional) Verify sessions, this creates a user_session table to store session data |
59
+
|`permittedOrigins`| string[]|`[]`| (optional) A list of allowed origins |
51
60
52
61
## How To Use
53
62
63
+
### Available Methods
64
+
65
+
-`authenticate` - Authenticates a request using the Clerk session public key, returns the payload if authenticated, false in any other case.
66
+
-`sessionExistsInDb` - Checks if a user session exists in the database, returns true if it does, false in any other case.
67
+
54
68
### Webhook Setup
55
69
56
70
For our Starbase instance to receive webhook events when user information changes, we need to add our plugin endpoint to Clerk.
@@ -66,3 +80,8 @@ For our Starbase instance to receive webhook events when user information change
66
80
- Visit the API Keys page for your Clerk instance: https://dashboard.clerk.com/last-active?path=api-keys
67
81
- Click the copy icon next to `JWKS Public Key`
68
82
5. Copy the public key into the Clerk plugin
83
+
6. Alternatively, you can use a JWKS endpoint instead of a public key.
84
+
- Visit the API Keys page for your Clerk instance: https://dashboard.clerk.com/last-active?path=api-keys
85
+
- Click the copy icon next to `JWKS URL`
86
+
- Paste the URL under `AUTH_JWKS_ENDPOINT` in your `wrangler.toml`
87
+
- Tweak the `authenticate` function in `src/index.ts` to check whether the session exists in the database, as shown in the [Usage](#usage) section.
0 commit comments