Skip to content

Commit e4a6b8f

Browse files
committed
backend sdk --> js backend sdk
1 parent bb84458 commit e4a6b8f

File tree

125 files changed

+183
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+183
-183
lines changed

docs/_partials/backend/usage.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
> [!NOTE]
2-
> Importing `clerkClient` varies based on your framework. Refer to the [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).
2+
> 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).

docs/_partials/fastify/get-auth.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fastify.get('/protected', async (request, reply) => {
2121
return reply.code(401).send({ error: 'User not authenticated' })
2222
}
2323

24-
// Use `clerkClient` to access Clerk's Backend SDK methods
24+
// Use `clerkClient` to access Clerk's JS Backend SDK methods
2525
// and get the user's User object
2626
const user = await clerkClient.users.getUser(userId)
2727

docs/_partials/nextjs/build-clerk-props.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
1818
}
1919
}
2020

21-
// Initialize the Backend SDK
21+
// Initialize the JS Backend SDK
2222
const client = await clerkClient()
2323

2424
// Get the user's full `Backend User` object

docs/_partials/nextjs/get-auth.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
1111
return res.status(401).json({ error: 'Unauthorized' })
1212
}
1313

14-
// Initialize the Backend SDK
14+
// Initialize the JS Backend SDK
1515
const client = await clerkClient()
1616

1717
// Get the user's full Backend User object

docs/getting-started/quickstart.expressjs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Learn how to integrate Clerk into your Express backend for secure user authentic
131131
// Use `getAuth()` to get the user's `userId`
132132
const { userId } = getAuth(req)
133133

134-
// Use Clerk's JavaScript Backend SDK to get the user's User object
134+
// Use Clerk's JS Backend SDK to get the user's User object
135135
const user = await clerkClient.users.getUser(userId)
136136

137137
return res.json({ user })

docs/getting-started/quickstart.js-backend.mdx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ sdk: js-backend
66

77
[Clerk's JavaScript Backend SDK](/docs/references/backend/overview) exposes the [Backend API](/docs/reference/backend-api){{ target: '_blank' }} resources and low-level authentication utilities **for JavaScript environments**.
88

9-
For example, if you wanted to get a list of all users in your application, instead of creating a fetch to [`https://api.clerk.com/v1/users`](/docs/reference/backend-api/tag/users/get/users){{ target: '_blank' }} endpoint, you can use the [`users.getUserList()`](/docs/references/backend/user/get-user-list) method provided by the JavaScript Backend SDK.
9+
For example, if you wanted to get a list of all users in your application, instead of creating a fetch to [`https://api.clerk.com/v1/users`](/docs/reference/backend-api/tag/users/get/users){{ target: '_blank' }} endpoint, you can use the [`users.getUserList()`](/docs/references/backend/user/get-user-list) method provided by the JS Backend SDK.
1010

1111
## Installation
1212

13-
<Tabs items={["Backend SDK", "With other SDKs"]}>
13+
<Tabs items={["JS Backend SDK", "With other SDKs"]}>
1414
<Tab>
15-
If you are using the JavaScript Backend SDK on its own, you can install it using the following command:
15+
If you are using the JS Backend SDK on its own, you can install it using the following command:
1616

1717
<CodeBlockTabs options={["npm", "yarn", "pnpm", "bun"]}>
1818
```bash {{ filename: 'terminal' }}
@@ -34,7 +34,7 @@ For example, if you wanted to get a list of all users in your application, inste
3434
</Tab>
3535

3636
<Tab>
37-
Clerk SDKs expose an instance of the JavaScript Backend SDK for use in server environments, so there is no need to install it separately.
37+
Clerk SDKs expose an instance of the JS Backend SDK for use in server environments, so there is no need to install it separately.
3838
</Tab>
3939
</Tabs>
4040

@@ -44,7 +44,7 @@ All resource operations are mounted as sub-APIs on the `clerkClient` object. For
4444

4545
To access a resource, you must first instantiate a `clerkClient` instance.
4646

47-
<Tabs items={["Backend SDK", "With other SDKs"]}>
47+
<Tabs items={["JS Backend SDK", "With other SDKs"]}>
4848
<Tab>
4949
To instantiate a `clerkClient` instance, you must call `createClerkClient()` and pass in [`options`](#create-clerk-client-options).
5050

@@ -103,7 +103,7 @@ To access a resource, you must first instantiate a `clerkClient` instance.
103103

104104
### Instantiate a custom `clerkClient` instance
105105

106-
If you would like to customize the behavior of the JavaScript Backend SDK, you can instantiate a `clerkClient` instance yourself by calling `createClerkClient()` and passing in [`options`](#create-clerk-client-options).
106+
If you would like to customize the behavior of the JS Backend SDK, you can instantiate a `clerkClient` instance yourself by calling `createClerkClient()` and passing in [`options`](#create-clerk-client-options).
107107

108108
<Tabs items={["Next.js", "Remix", "Fastify", "Astro", "Tanstack React Start", "Express", "Nuxt"]}>
109109
<Tab>
@@ -125,7 +125,7 @@ To access a resource, you must first instantiate a `clerkClient` instance.
125125
import { createClerkClient } from '@clerk/remix/api.server'
126126
```
127127

128-
Use the following tabs to see examples of how to use the Backend SDK in Remix Loader and Action functions.
128+
Use the following tabs to see examples of how to use the JS Backend SDK in Remix Loader and Action functions.
129129

130130
<Tabs items={["Loader Function", "Action Function"]}>
131131
<Tab>
@@ -297,9 +297,9 @@ The [`Auth`](/docs/references/backend/types/auth-object) object contains importa
297297

298298
<Include src="_partials/auth-object-table" />
299299

300-
<Tabs items={["Backend SDK", "With other SDKs"]}>
300+
<Tabs items={["JS Backend SDK", "With other SDKs"]}>
301301
<Tab>
302-
The following example demonstrates how to retrieve the authenticated user's ID using `request.auth` when you're not using a specific framework helper. It also shows how to use the Backend SDK's [`getUser()`](/docs/references/backend/user/get-user) method to get the [Backend `User` object](/docs/references/backend/types/backend-user).
302+
The following example demonstrates how to retrieve the authenticated user's ID using `request.auth` when you're not using a specific framework helper. It also shows how to use the JS Backend SDK's [`getUser()`](/docs/references/backend/user/get-user) method to get the [Backend `User` object](/docs/references/backend/types/backend-user).
303303

304304
```js
305305
import { createClerkClient } from '@clerk/backend'
@@ -315,7 +315,7 @@ The [`Auth`](/docs/references/backend/types/auth-object) object contains importa
315315
return null
316316
}
317317

318-
// Use the Backend SDK's `getUser()` method to get the Backend User object
318+
// Use the JS Backend SDK's `getUser()` method to get the Backend User object
319319
const user = await clerkClient.users.getUser(userId)
320320

321321
// Return the Backend User object
@@ -325,7 +325,7 @@ The [`Auth`](/docs/references/backend/types/auth-object) object contains importa
325325
</Tab>
326326

327327
<Tab>
328-
The following examples demonstrate how to retrieve the authenticated user's ID using framework-specific auth helpers and how to use the Backend SDK's [`getUser()`](/docs/references/backend/user/get-user) method to get the [Backend `User` object](/docs/references/backend/types/backend-user).
328+
The following examples demonstrate how to retrieve the authenticated user's ID using framework-specific auth helpers and how to use the JS Backend SDK's [`getUser()`](/docs/references/backend/user/get-user) method to get the [Backend `User` object](/docs/references/backend/types/backend-user).
329329

330330
{/* TODO: The following Tabs example is duplicated in the guides/how-clerk-works/session-tokens.mdx file. It cannot be a partial to be reused across both files because this example includes a partial and partials cannot include partials. Also, the text in each of these tabs is removed in the other file as its not relevant to that file's example. So keep these two Tabs examples in sync please. */}
331331

@@ -350,7 +350,7 @@ The [`Auth`](/docs/references/backend/types/auth-object) object contains importa
350350

351351
const client = await clerkClient()
352352

353-
// Use the Backend SDK's `getUser()` method to get the Backend User object
353+
// Use the JS Backend SDK's `getUser()` method to get the Backend User object
354354
const user = await client.users.getUser(userId)
355355

356356
// Return the Backend User object
@@ -377,7 +377,7 @@ The [`Auth`](/docs/references/backend/types/auth-object) object contains importa
377377
return new Response('Unauthorized', { status: 401 })
378378
}
379379

380-
// Use the Backend SDK's `getUser()` method to get the Backend User object
380+
// Use the JS Backend SDK's `getUser()` method to get the Backend User object
381381
const user = await clerkClient(context).users.getUser(userId)
382382

383383
// Return the Backend User object
@@ -405,7 +405,7 @@ The [`Auth`](/docs/references/backend/types/auth-object) object contains importa
405405
res.status(401).json({ error: 'User not authenticated' })
406406
}
407407

408-
// Use the Backend SDK's `getUser()` method to get the Backend User object
408+
// Use the JS Backend SDK's `getUser()` method to get the Backend User object
409409
const user = await clerkClient.users.getUser(userId)
410410

411411
// Return the Backend User object
@@ -432,7 +432,7 @@ The [`Auth`](/docs/references/backend/types/auth-object) object contains importa
432432
return redirect('/sign-in?redirect_url=' + args.request.url)
433433
}
434434

435-
// Use the Backend SDK's `getUser()` method to get the Backend User object
435+
// Use the JS Backend SDK's `getUser()` method to get the Backend User object
436436
const user = await createClerkClient({ secretKey: process.env.CLERK_SECRET_KEY }).users.getUser(
437437
userId,
438438
)
@@ -463,7 +463,7 @@ The [`Auth`](/docs/references/backend/types/auth-object) object contains importa
463463
return redirect('/sign-in?redirect_url=' + args.request.url)
464464
}
465465

466-
// Use the Backend SDK's `getUser()` method to get the Backend User object
466+
// Use the JS Backend SDK's `getUser()` method to get the Backend User object
467467
const user = await createClerkClient({ secretKey: process.env.CLERK_SECRET_KEY }).users.getUser(
468468
userId,
469469
)
@@ -517,10 +517,10 @@ The [`Auth`](/docs/references/backend/types/auth-object) object contains importa
517517
return json({ error: 'Unauthorized' }, { status: 401 })
518518
}
519519

520-
// Instantiate the Backend SDK
520+
// Instantiate the JS Backend SDK
521521
const clerkClient = createClerkClient({ secretKey: import.meta.env.CLERK_SECRET_KEY })
522522

523-
// Use the Backend SDK's `getUser()` method to get the Backend User object
523+
// Use the JS Backend SDK's `getUser()` method to get the Backend User object
524524
const user = await clerkClient.users.getUser(userId)
525525

526526
// Return the Backend User object

docs/guides/configure/auth-strategies/social-connections/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Use the following tabs to see how to add additional OAuth scopes to the `<UserPr
7474

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

77-
To retrieve the OAuth access token for a user, use the [`getUserOauthAccessToken()`](/docs/references/backend/user/get-user-oauth-access-token) method from the JavaScript Backend SDK. This method must be used in a server environment, and cannot be run on the client.
77+
To retrieve the OAuth access token for a user, use the [`getUserOauthAccessToken()`](/docs/references/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.
7878

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

docs/guides/development/custom-flows/account-updates/user-impersonation.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This guide will walk you through how to build a custom flow that handles user im
1919

2020
Use the following tabs to view the code for:
2121

22-
- The main page that gets the list of the application's users using the [JavaScript Backend SDK](/docs/references/backend/user/get-user-list)
22+
- The main page that gets the list of the application's users using the [JS Backend SDK](/docs/references/backend/user/get-user-list)
2323
- The Client Component that has the UI for displaying the users and the ability to impersonate them
2424
- The Server Action that generates the actor token using the [Backend API](/docs/reference/backend-api/tag/actor-tokens/post/actor_tokens){{ target: '_blank' }}
2525

@@ -38,7 +38,7 @@ This guide will walk you through how to build a custom flow that handles user im
3838

3939
const client = await clerkClient()
4040

41-
// Fetch list of application's users using Clerk's Backend SDK
41+
// Fetch list of application's users using Clerk's JS Backend SDK
4242
const users = await client.users.getUserList()
4343

4444
// This page needs to be a server component to use clerkClient.users.getUserList()

docs/guides/development/endpoints.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ export async function GET({ locals }) {
6565

6666
## Interact with Clerk's Backend API
6767

68-
The [JavaScript Backend SDK](/docs/js-backend/getting-started/quickstart) exposes the [Backend API](/docs/reference/backend-api){{ target: '_blank' }} resources and low-level authentication utilities for JavaScript environments.
68+
The [JS Backend SDK](/docs/js-backend/getting-started/quickstart) exposes the [Backend API](/docs/reference/backend-api){{ target: '_blank' }} resources and low-level authentication utilities for JavaScript environments.
6969

70-
`clerkClient` exposes an instance of the JavaScript Backend SDK for use in server environments. Use this instance to interact with the Clerk Backend API, as shown in the following example:
70+
`clerkClient` exposes an instance of the JS Backend SDK for use in server environments. Use this instance to interact with the Clerk Backend API, as shown in the following example:
7171

7272
```ts {{ filename: 'src/pages/api/route.ts' }}
7373
import { clerkClient } from '@clerk/astro/server'

docs/guides/development/migrating/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ To export your users' data:
8787

8888
### Access user data in the backend
8989

90-
You can programmatically retrieve a list of your user's and their information by using the [`GetUserList`](/docs/reference/backend-api/tag/Users#operation/GetUserList){{ target: '_blank' }} Backend API endpoint, or the JavaScript Backend SDK's [`getUserList()`](/docs/references/backend/user/get-user-list) method which is a wrapper around the Backend API endpoint.
90+
You can programmatically retrieve a list of your user's and their information by using the [`GetUserList`](/docs/reference/backend-api/tag/Users#operation/GetUserList){{ target: '_blank' }} Backend API endpoint, or the JS Backend SDK's [`getUserList()`](/docs/references/backend/user/get-user-list) method which is a wrapper around the Backend API endpoint.

0 commit comments

Comments
 (0)