Skip to content

Commit 6c602fc

Browse files
committed
fix: add docs for clerk adapter
1 parent cd1e824 commit 6c602fc

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

adminforth/documentation/docs/tutorial/06-Adapters/02-oauth2-adapters.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,12 @@ Supports login through Microsoft accounts including Azure AD, Office365, and Out
5454
pnpm i @adminforth/oauth-adapter-twitch
5555
```
5656

57-
Adds support for Twitch authentication, useful for streaming or creator-oriented platforms.
57+
Adds support for Twitch authentication, useful for streaming or creator-oriented platforms.
58+
59+
## Clerk OAuth Adapter
60+
61+
```bash
62+
pnpm i @adminforth/clerk-oauth-adapter
63+
```
64+
65+
Enables sign-in via [Clerk](https://clerk.com/) — a hosted authentication platform with built-in user management, MFA, and social logins.

adminforth/documentation/docs/tutorial/09-Plugins/11-oauth.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,48 @@ plugins: [
476476
]
477477
```
478478

479+
### Clerk Adapter
480+
481+
Install Adapter:
482+
483+
```bash
484+
pnpm install @adminforth/clerk-oauth-adapter --save
485+
```
486+
487+
1. Go to the [Clerk Dashboard](https://dashboard.clerk.com) and open your application.
488+
2. In the left sidebar, go to **Configure****OAuth Applications**.
489+
3. Click **Add OAuth Application**, give it a name.
490+
4. In **Redirect URIs**, add `https://your-domain/oauth/callback` (and `http://localhost:3500/oauth/callback` for local development). Include `baseUrl` when your AdminForth app uses it, for example `https://your-domain/base/oauth/callback`.
491+
5. Copy **Client ID** and **Client Secret**.
492+
6. To find your **Frontend API URL**: go to **Configure****API Keys** — it is listed under **Frontend API** (looks like `https://xxx-yyy-00.clerk.accounts.dev`).
493+
7. Add the credentials to your `.env` file:
494+
495+
```bash
496+
CLERK_CLIENT_ID=your_clerk_client_id
497+
CLERK_CLIENT_SECRET=your_clerk_client_secret
498+
CLERK_DOMAIN=https://your-app.clerk.accounts.dev
499+
```
500+
501+
Add the adapter to your plugin configuration:
502+
503+
```typescript title="./resources/adminuser.ts"
504+
import AdminForthAdapterClerkOauth2 from '@adminforth/clerk-oauth-adapter';
505+
506+
// ... existing resource configuration ...
507+
plugins: [
508+
new OAuthPlugin({
509+
adapters: [
510+
...
511+
new AdminForthAdapterClerkOauth2({
512+
clientID: process.env.CLERK_CLIENT_ID as string,
513+
clientSecret: process.env.CLERK_CLIENT_SECRET as string,
514+
domain: process.env.CLERK_DOMAIN as string,
515+
}),
516+
],
517+
}),
518+
]
519+
```
520+
479521
### Need custom provider?
480522

481523
Just fork any existing adapter e.g. [Google](https://github.com/devforth/adminforth-oauth-adapter-google) and adjust it to your needs.

0 commit comments

Comments
 (0)