WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
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. |
54
+
|`clerkSigningSecret`| string |`null`| Access your signing secret from (https://dashboard.clerk.com/last-active?path=webhooks)|
55
+
|`clerkInstanceId`| string |`null`| (optional) Access your instance ID from (https://dashboard.clerk.com/last-active?path=settings)|
56
+
|`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 |
57
+
|`verifySessions`| boolean |`true`| (optional) Verify sessions, this creates a user_session table to store session data |
58
+
|`permittedOrigins`| string[]|`[]`| (optional) A list of allowed origins |
51
59
52
60
## How To Use
53
61
62
+
### Available Methods
63
+
64
+
-`authenticate` - Authenticates a request using the Clerk session public key, returns true if authenticated, false in any other case.
65
+
-`sessionExistsInDb` - Checks if a user session exists in the database, returns true if it does, false in any other case.
66
+
54
67
### Webhook Setup
55
68
56
69
For our Starbase instance to receive webhook events when user information changes, we need to add our plugin endpoint to Clerk.
@@ -66,3 +79,8 @@ For our Starbase instance to receive webhook events when user information change
66
79
- Visit the API Keys page for your Clerk instance: https://dashboard.clerk.com/last-active?path=api-keys
67
80
- Click the copy icon next to `JWKS Public Key`
68
81
5. Copy the public key into the Clerk plugin
82
+
6. Alternatively, you can use a JWKS endpoint instead of a public key.
83
+
- Visit the API Keys page for your Clerk instance: https://dashboard.clerk.com/last-active?path=api-keys
84
+
- Click the copy icon next to `JWKS URL`
85
+
- Paste the URL under `AUTH_JWKS_ENDPOINT` in your `wrangler.toml`
86
+
- 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