Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
170 commits
Select commit Hold shift + click to select a range
4fd7d1b
bring in kyles scripts
NWylynko Jul 17, 2025
28f40e2
support top level and nested items
NWylynko Jul 17, 2025
b62ccef
add watch script
NWylynko Jul 17, 2025
edeef17
Add mapping generation to build ci
NWylynko Jul 18, 2025
f288985
run migration map checker in gh action
NWylynko Jul 18, 2025
4349075
flip order
NWylynko Jul 18, 2025
c3d5cc2
run on push to test ci
NWylynko Jul 18, 2025
7da6b58
generate the manifest first
NWylynko Jul 18, 2025
d41ab9f
remove watch from tsx cli
NWylynko Jul 18, 2025
be7e558
define flags in this repo instead of clerk/clerk
NWylynko Jul 18, 2025
e8fb05c
Only enable ci on certain file changes
NWylynko Jul 18, 2025
b22f559
disable feature flags
NWylynko Jul 18, 2025
c32a424
fix up tests
NWylynko Jul 18, 2025
7c8f48b
Potential fix for code scanning alert no. 10: Workflow does not conta…
NWylynko Jul 18, 2025
b919b0f
add support for 3rd level dropdown
NWylynko Jul 18, 2025
794d218
Add a readme for new scripts
NWylynko Jul 18, 2025
8797e04
Add dotenv
NWylynko Jul 18, 2025
6d75db8
activate top-level manifest splitting and proposal generation
kylemac Jul 19, 2025
2db149f
add support for icons in proposal.md. add more to proposal
kylemac Jul 19, 2025
15b54b6
revise proposal
kylemac Jul 19, 2025
e832559
proposal checkpoint
kylemac Jul 21, 2025
580f0d0
proposal checkpoint
kylemac Jul 21, 2025
d1c0c09
add sub top-level categories under reference
kylemac Jul 21, 2025
5e5ef6e
update proposal from content tuple
kylemac Jul 23, 2025
a33d50d
progress checkin: mostly mappings
kylemac Jul 23, 2025
fe30e22
triage webhooks section
kylemac Jul 23, 2025
7d67070
update
alexisintech Jul 24, 2025
cc98875
work on the mapping script
NWylynko Jul 25, 2025
7a87a82
Add --fix arg
NWylynko Jul 25, 2025
541bf8a
Add script for much better doc deletion
NWylynko Jul 25, 2025
42d6bcb
wip
NWylynko Jul 25, 2025
b71d39e
don't report handled tasks as unhandled files
NWylynko Jul 28, 2025
96ccc3f
Filter out redundant move tasks where source and destination paths ar…
NWylynko Jul 28, 2025
f8f506a
doc needs consonidation
NWylynko Jul 28, 2025
bf0026e
consolidate
NWylynko Jul 28, 2025
9377180
Merge branch 'main' into ia/docs-team-proposal
NWylynko Jul 28, 2025
c434319
add delete doc script to package.json
alexisintech Jul 28, 2025
5827704
update proposal.md
alexisintech Jul 28, 2025
bd05a97
add hooks to general reference in proposal.md
alexisintech Jul 28, 2025
7ae4daf
Added functionality to identify pages needing creation based on the p…
NWylynko Jul 29, 2025
2f5f2e9
Merge branch 'ia/docs-team-proposal' of github.com:clerk/clerk-docs i…
NWylynko Jul 29, 2025
c3348ad
Remove --fix arg from script
NWylynko Jul 29, 2025
7e05441
Remove temporary fix for files in map-content.ts
NWylynko Jul 29, 2025
d231049
manual fixes
alexisintech Jul 29, 2025
4f48151
update delete-doc script to update links for a deleted path
alexisintech Jul 30, 2025
0ab77c3
Merge branch 'main' into ia/docs-team-proposal
alexisintech Aug 5, 2025
3f0ec0e
add use-migration-blank-page flag
alexisintech Aug 5, 2025
1bda73f
Add support for arbitrary json in proposal.md
NWylynko Aug 8, 2025
500b336
Add {"collapse": false} to overright default collapse true
NWylynko Aug 8, 2025
87c788b
fix up headings
NWylynko Aug 8, 2025
9bbb93f
add tag as an expected type
alexisintech Aug 9, 2025
51c86a7
Merge branch 'main' into ia/docs-team-proposal
alexisintech Aug 9, 2025
3d00b81
Merge branch 'main' into ia/docs-team-proposal
alexisintech Aug 9, 2025
c103b38
IA: Configuring your app (/configure) section (#2453)
alexisintech Aug 9, 2025
a8bd645
fix broken link
alexisintech Aug 9, 2025
9400d54
collapsible headings shouldnt be included in path/href generation
alexisintech Aug 9, 2025
e3eeb89
fix social connections all providers subheading
alexisintech Aug 9, 2025
74e96bf
docs review minor changes
SarahSoutoul Aug 11, 2025
d0549f6
revert 9400d54
alexisintech Aug 11, 2025
e829efa
/configure updates
alexisintech Aug 11, 2025
eac33c7
IA: Customizing Clerk (/customizing-clerk) section (#2454)
alexisintech Aug 11, 2025
18b1898
IA: Users (/users) section (#2455)
alexisintech Aug 11, 2025
4fcfe36
Remove generated manifest validation
NWylynko Aug 11, 2025
3b3a8d5
IA: Securing your app and How Clerk works sections (#2458)
alexisintech Aug 12, 2025
bbbb565
Add watcher for flags.json file changes
NWylynko Aug 12, 2025
b90d128
IA: Hooks and components (#2464)
alexisintech Aug 13, 2025
825a0d7
Merge branch 'main' into ia/docs-team-proposal
alexisintech Aug 13, 2025
698e41b
Fix unhandled files on proposal-mapping
SarahSoutoul Aug 13, 2025
f87faa4
Add option {"skip": true} to skip a segment from href generation
NWylynko Aug 13, 2025
bd7dfe2
IA: Development (/development) section (#2463)
alexisintech Aug 13, 2025
6aec942
IA: B2B Organizations, Billing, Dashboard sections (#2457)
alexisintech Aug 14, 2025
62a34cd
fix redirects
alexisintech Aug 14, 2025
e0823a6
Merge branch 'main' into ia/docs-team-proposal
alexisintech Aug 15, 2025
0e9478d
fix broken link
alexisintech Aug 15, 2025
96161c2
move force-mfa
alexisintech Aug 15, 2025
912e4fa
Fix proposal mapping after bringing back force mfa + fix broken link
SarahSoutoul Aug 18, 2025
f925265
updates that got lost from main
alexisintech Aug 18, 2025
3419146
IA: References (#2494)
alexisintech Aug 18, 2025
d9756c8
Merge branch 'main' into ia/docs-team-proposal
alexisintech Aug 18, 2025
8476eb9
Switch to validating the proposal manifest
NWylynko Aug 18, 2025
8995b38
Fix links in machine auth
SarahSoutoul Aug 18, 2025
c1740ff
Move machine auth under development
SarahSoutoul Aug 18, 2025
dcee2df
Switch manifest.json over to the new generated proposal manifest
NWylynko Aug 18, 2025
9368799
Merge branch 'main' into ia/docs-team-proposal
SarahSoutoul Aug 19, 2025
06b2d79
add remove-sdk-development flag
alexisintech Aug 20, 2025
e971241
Merge branch 'main' into ia/docs-team-proposal
alexisintech Aug 20, 2025
209df91
Update href for "View all guides" to work with https://github.com/cle…
NWylynko Aug 21, 2025
466a643
IA: Getting Started + moving SDK specific guides (#2512)
alexisintech Aug 21, 2025
ad2f086
handle warnings that are failing build
alexisintech Aug 21, 2025
02a2fe2
Merge branch 'main' into ia/docs-team-proposal
alexisintech Aug 21, 2025
82a3cdc
Merge branch 'main' into ia/docs-team-proposal
alexisintech Aug 22, 2025
5e567d8
Merge branch 'main' into ia/docs-team-proposal
SarahSoutoul Aug 22, 2025
9e863e6
Add support to link directly to specific sdk variant of a page
NWylynko Aug 22, 2025
9509ac9
Delete guides overview page
SarahSoutoul Aug 22, 2025
f5b6de8
Remove the check-links linter (deprecated)
NWylynko Aug 22, 2025
6856708
change session tasks name in sidebar
alexisintech Aug 25, 2025
f03e7a2
Change heading to user management
SarahSoutoul Aug 25, 2025
d9ec3f7
references --> reference
alexisintech Aug 25, 2025
4eab2c2
merge 'nick/build-script-scoped-to-scoped-with-typedoc' in to 'ia/doc…
NWylynko Aug 25, 2025
17677ee
Merge branch 'main' into ia/docs-team-proposal
alexisintech Aug 25, 2025
3ec227a
fix lint errors
alexisintech Aug 25, 2025
2e4e94f
Merge branch 'main' into ia/docs-team-proposal
alexisintech Aug 25, 2025
8ab135b
Merge branch 'main' into ia/docs-team-proposal
alexisintech Aug 25, 2025
02551ab
Merge branch 'main' into ia/docs-team-proposal
alexisintech Aug 26, 2025
69fe2e9
add api reference overview
alexisintech Sep 2, 2025
2bd1103
Merge branch 'main' into ia/docs-team-proposal
alexisintech Sep 2, 2025
09e289e
update api reference overview
alexisintech Sep 2, 2025
cd49816
remove check-links from lint workflow
alexisintech Sep 2, 2025
da74a31
fix broken links
alexisintech Sep 2, 2025
2f387af
add demo repos
alexisintech Sep 2, 2025
528675a
IA - Add a section to Core Concepts page (#2547)
SarahSoutoul Sep 4, 2025
f76773a
IA: category rework proposal (#2538)
alexisintech Sep 4, 2025
134b0ce
/docs/references/general/** --> /docs/references/**
alexisintech Sep 4, 2025
c665602
fix misspelling
alexisintech Sep 4, 2025
bba66e5
IA: navbar top level collapsible (#2555)
NWylynko Sep 5, 2025
7bccc35
Fix typos and wrong link
SarahSoutoul Sep 5, 2025
cb5d620
Merge branch 'main' into ia/docs-team-proposal
alexisintech Sep 8, 2025
1f248fc
add sdk specificity to doc variant links
alexisintech Sep 8, 2025
509e427
Docs IA: Add 3 overview pages to bring consistency (#2572)
SarahSoutoul Sep 9, 2025
04cf52c
Merge branch 'main' into ia/docs-team-proposal
SarahSoutoul Sep 9, 2025
d28a08c
IA - Fix link hash checking in build script (#2584)
NWylynko Sep 10, 2025
e72ee65
audit: fix redirects
alexisintech Sep 10, 2025
dfb3e9d
Merge branch 'main' into ia/docs-team-proposal
alexisintech Sep 10, 2025
d5e5c5b
fix links
alexisintech Sep 10, 2025
2ed4340
IA: Roy feedback (#2585)
alexisintech Sep 11, 2025
4c071e8
wip
alexisintech Sep 12, 2025
1e2d953
update
alexisintech Sep 12, 2025
bb84458
Merge branch 'main' into ia/docs-team-proposal
alexisintech Sep 12, 2025
775a75a
Merge branch 'ia/docs-team-proposal' into aa/sdk-specificity-project
alexisintech Sep 12, 2025
3808510
update
alexisintech Sep 12, 2025
e4a6b8f
backend sdk --> js backend sdk
alexisintech Sep 12, 2025
164631a
Merge branch 'ia/docs-team-proposal' into aa/sdk-specificity-project
alexisintech Sep 12, 2025
5981b6e
backend sdk --> js backend sdk
alexisintech Sep 12, 2025
2df6042
Merge branch 'ia/docs-team-proposal' into aa/sdk-specificity-project
alexisintech Sep 12, 2025
65fe762
react router: replace src/ with app/
alexisintech Sep 12, 2025
f680ed3
Merge branch 'ia/docs-team-proposal' into aa/sdk-specificity-project
alexisintech Sep 12, 2025
91bb42a
leftover backend sdk --> js backend sdk
alexisintech Sep 12, 2025
27ee75d
Merge branch 'ia/docs-team-proposal' into aa/sdk-specificity-project
alexisintech Sep 12, 2025
e19f105
fix links
alexisintech Sep 12, 2025
c588a8a
Merge branch 'ia/docs-team-proposal' into aa/sdk-specificity-project
alexisintech Sep 12, 2025
743c184
Only show the hooks overview for sdks that support react hooks
NWylynko Sep 15, 2025
91cc63b
Docs build script - dist folder improvements (#2601)
NWylynko Sep 15, 2025
dcdc79f
Merge branch 'main' into ia/docs-team-proposal
alexisintech Sep 16, 2025
e199eb0
fix broken links
alexisintech Sep 16, 2025
b0273b4
misc updates based on feedback (#2600)
kylemac Sep 17, 2025
d7520b0
IA: Pull overview content into dedicated pages (#2606)
alexisintech Sep 17, 2025
83e78ee
IA - move /docs/references to /docs/reference (#2607)
NWylynko Sep 17, 2025
d244404
Switch to dynamic redirects
NWylynko Sep 17, 2025
92cb51a
Add dynamic redirect to handle sdk scoped guides
NWylynko Sep 17, 2025
0cfe90f
Overwrite the existing dist if it exists
NWylynko Sep 18, 2025
f143337
Merge branch 'main' into ia/docs-team-proposal
alexisintech Sep 18, 2025
2e95154
Check and remove the ignored dist folder if it exists
NWylynko Sep 18, 2025
8f2178f
Fix link
NWylynko Sep 18, 2025
aaa05f8
Add support for dynamic redirects, Convert script to typescript, add …
NWylynko Sep 18, 2025
9736376
Fix link to quickstart from backend overview
NWylynko Sep 18, 2025
7c76899
consider distinct sdk variants when determining if to inject sdk in href
NWylynko Sep 18, 2025
8078a42
Merge branch 'main' into ia/docs-team-proposal
alexisintech Sep 23, 2025
325b157
ignore typedoc warnings
alexisintech Sep 23, 2025
6e8accf
Guides overview revamp to be more visually aesthetic (#2609)
SarahSoutoul Sep 23, 2025
aecff1a
Remove outdated proposal manifest
NWylynko Sep 24, 2025
2b94dec
Add wrap for long component name
NWylynko Sep 24, 2025
536b458
Fix linting
SarahSoutoul Sep 24, 2025
bbde109
Merge branch 'main' into ia/docs-team-proposal
alexisintech Sep 24, 2025
81eb2cb
move backend reference docs to be named references
alexisintech Sep 24, 2025
c67f575
ignore warnings
alexisintech Sep 24, 2025
2a4798d
Merge branch 'ia/docs-team-proposal' into aa/sdk-specificity-project
alexisintech Sep 24, 2025
54fef82
updates
alexisintech Sep 24, 2025
560a350
Merge branch 'main' into aa/sdk-specificity-project
alexisintech Sep 29, 2025
248e98c
fix supabase link
alexisintech Sep 29, 2025
fe0aa87
remove migration assistant
alexisintech Sep 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions docs/_partials/authenticate-req.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@
import { createClerkClient } from '@clerk/backend'

export async function GET(req: Request) {
// Initialize the JS Backend SDK
// This varies depending on the SDK you're using
// https://clerk.com/docs/js-backend/getting-started/quickstart
const clerkClient = createClerkClient({
secretKey: process.env.CLERK_SECRET_KEY,
publishableKey: process.env.CLERK_PUBLISHABLE_KEY,
})

const { isSignedIn } = await clerkClient.authenticateRequest(req, {
jwtKey: process.env.CLERK_JWT_KEY,
// Use the `authenticateRequest()` method to verify the token
const { isAuthenticated } = await clerkClient.authenticateRequest(req, {
authorizedParties: ['https://example.com'],
jwtKey: process.env.CLERK_JWT_KEY,
})

if (!isSignedIn) {
// Protect the route from unauthenticated users
if (!isAuthenticated) {
return Response.json({ status: 401 })
}

Expand Down
2 changes: 1 addition & 1 deletion docs/_partials/backend/usage.mdx
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
> [!NOTE]
> Importing `clerkClient` varies based on your framework. Refer to the [JS Backend SDK overview](/docs/js-backend/getting-started/quickstart) for usage details, including guidance on [how to access the `userId` and other properties](/docs/js-backend/getting-started/quickstart#get-the-user-id-and-other-properties).
> Using `clerkClient` varies based on your framework. Refer to the [JS Backend SDK overview](/docs/js-backend/getting-started/quickstart) for usage details, including guidance on [how to access the `userId` and other properties](/docs/js-backend/getting-started/quickstart#get-the-user-id-and-other-properties).
248 changes: 156 additions & 92 deletions docs/getting-started/quickstart.js-backend.mdx

Large diffs are not rendered by default.

200 changes: 155 additions & 45 deletions docs/guides/configure/auth-strategies/social-connections/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Use the following tabs to see how to add additional OAuth scopes to the `<UserPr

You can use a social provider's OAuth access token to access user data from that provider in addition to their data from Clerk.

To retrieve the OAuth access token for a user, use the [`getUserOauthAccessToken()`](/docs/reference/backend/user/get-user-oauth-access-token) method from the JS Backend SDK. This method must be used in a server environment, and cannot be run on the client.
To retrieve the OAuth access token for a user, use the [`getUserOauthAccessToken()`](/docs/reference/backend/user/get-user-oauth-access-token) method from the JS Backend SDK. **This method must be used in a server environment, and cannot be run on the client.**

Clerk ensures that the OAuth access token will be always fresh so that you don't have to worry about refresh tokens.

Expand All @@ -84,50 +84,160 @@ The following example demonstrates how to retrieve the OAuth access token for a
- The user has already connected their Notion account to your application.
- The user has the correct permissions to access the Notion API.

The example is written for Next.js App Router, but is supported by any React-based framework.

```tsx {{ filename: 'app/api/notion/route.tsx' }}
import { auth, clerkClient } from '@clerk/nextjs/server'
import { NextResponse } from 'next/server'

export async function GET() {
const { isAuthenticated, userId } = await auth()

if (!isAuthenticated) {
return NextResponse.json({ message: 'User not found' })
}

// Get the OAuth access token for the user
const provider = 'notion'

const client = await clerkClient()

const clerkResponse = await client.users.getUserOauthAccessToken(userId, provider)

const accessToken = clerkResponse[0].token || ''

if (!accessToken) {
return NextResponse.json({ message: 'Access token not found' }, { status: 401 })
}

// Fetch the user data from the Notion API
// This endpoint fetches a list of users
// https://developers.notion.com/reference/get-users
const notionUrl = 'https://api.notion.com/v1/users'

const notionResponse = await fetch(notionUrl, {
headers: {
Authorization: `Bearer ${accessToken}`,
'Notion-Version': '2022-06-28',
},
})

// Handle the response from the Notion API
const notionData = await notionResponse.json()

return NextResponse.json({ message: notionData })
}
```
**If your SDK isn't listed, you can use the comments in the example to help you adapt it to your SDK.**

<Tabs items={["Next.js", "Express", "JS Backend SDK"]}>
<Tab>
```tsx {{ filename: 'app/api/notion/route.tsx' }}
import { auth, clerkClient } from '@clerk/nextjs/server'
import { NextResponse } from 'next/server'

export async function GET() {
// The `Auth` object gives you access to properties like `isAuthenticated` and `userId`
// Accessing the `Auth` object differs depending on the SDK you're using
// https://clerk.com/docs/reference/backend/types/auth-object#how-to-access-the-auth-object
const { isAuthenticated, userId } = await auth()

// Protect the route from unauthenticated users
if (!isAuthenticated) {
return NextResponse.json({ message: 'User not found' })
}

// Use the JS Backend SDK to get the OAuth access token for the user
const provider = 'notion'

// Initialize the JS Backend SDK
// This varies depending on the SDK you're using
// https://clerk.com/docs/js-backend/getting-started/quickstart
const client = await clerkClient()

// Use the JS Backend SDK to get the user's OAuth access token
const clerkResponse = await client.users.getUserOauthAccessToken(userId, provider)
const accessToken = clerkResponse.data[0].token || ''
if (!accessToken) {
return NextResponse.json({ message: 'Access token not found' }, { status: 401 })
}

// Fetch the user data from the Notion API
// This endpoint fetches a list of users
// https://developers.notion.com/reference/get-users
const notionUrl = 'https://api.notion.com/v1/users'

const notionResponse = await fetch(notionUrl, {
headers: {
Authorization: `Bearer ${accessToken}`,
'Notion-Version': '2022-06-28',
},
})

// Handle the response from the Notion API
const notionData = await notionResponse.json()

return NextResponse.json({ message: notionData })
}
```
</Tab>

<Tab>
```js {{ filename: 'notion.js' }}
import { createClerkClient, getAuth } from '@clerk/express'
import express from 'express'

const app = express()
// Initialize the JS Backend SDK
// This varies depending on the SDK you're using
// https://clerk.com/docs/js-backend/getting-started/quickstart
const clerkClient = createClerkClient({ secretKey: process.env.CLERK_SECRET_KEY })

app.get('/user', async (req, res) => {
// The `Auth` object gives you access to properties like `isAuthenticated` and `userId`
// Accessing the `Auth` object differs depending on the SDK you're using
// https://clerk.com/docs/reference/backend/types/auth-object#how-to-access-the-auth-object
const { isAuthenticated, userId } = getAuth(req)

// Protect the route from unauthenticated users
if (!isAuthenticated) {
res.status(401).json({ error: 'User not authenticated' })
}

// Use the JS Backend SDK to get the user's OAuth access token
const provider = 'notion'
const clerkResponse = await clerkClient.users.getUserOauthAccessToken(userId, provider)
const accessToken = clerkResponse.data[0].token || ''

if (!accessToken) {
res.status(401).json({ error: 'Access token not found' })
}

// Fetch the user data from the Notion API
// This endpoint fetches a list of users
// https://developers.notion.com/reference/get-users
const notionUrl = 'https://api.notion.com/v1/users'

const notionResponse = await fetch(notionUrl, {
headers: {
Authorization: `Bearer ${accessToken}`,
'Notion-Version': '2022-06-28',
},
})

// Handle the response from the Notion API
const notionData = await notionResponse.json()

res.json(notionData)
})
```
</Tab>

<Tab>
```js
import { createClerkClient } from '@clerk/backend'

// Initialize the JS Backend SDK
// This varies depending on the SDK you're using
// https://clerk.com/docs/js-backend/getting-started/quickstart
const clerkClient = createClerkClient({ secretKey: process.env.CLERK_SECRET_KEY })

async function getNotionData(request) {
// The `Auth` object gives you access to properties like `isAuthenticated` and `userId`
// Accessing the `Auth` object differs depending on the SDK you're using
// https://clerk.com/docs/reference/backend/types/auth-object#how-to-access-the-auth-object
const { isAuthenticated, userId } = request.auth

// Protect the route from unauthenticated users
if (!isAuthenticated) {
return null
}

// Use the JS Backend SDK to get the user's OAuth access token
const provider = 'notion'
const clerkResponse = await clerkClient.users.getUserOauthAccessToken(userId, provider)
const accessToken = clerkResponse.data[0].token || ''
if (!accessToken) {
return null
}

// Fetch the user data from the Notion API
// This endpoint fetches a list of users
// https://developers.notion.com/reference/get-users
const notionUrl = 'https://api.notion.com/v1/users'

const notionResponse = await fetch(notionUrl, {
headers: {
Authorization: `Bearer ${accessToken}`,
'Notion-Version': '2022-06-28',
},
})

// Handle the response from the Notion API
const notionData = await notionResponse.json()

// Return the Notion data
return notionData
}
```
</Tab>
</Tabs>

## Add a social connection after sign-up

Expand Down
Loading