Skip to content

Commit

Permalink
Move a large portion of /docs/references to /docs/sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
NWylynko committed Jan 9, 2025
1 parent 9da9aaf commit 3b017e6
Show file tree
Hide file tree
Showing 219 changed files with 520 additions and 511 deletions.
18 changes: 9 additions & 9 deletions docs/_partials/react-hooks.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
- [`useUser()`](/docs/references/react/use-user){{ target: '_blank' }}
- [`useClerk()`](/docs/references/react/use-clerk){{ target: '_blank' }}
- [`useAuth()`](/docs/references/react/use-auth){{ target: '_blank' }}
- [`useSignIn()`](/docs/references/react/use-sign-in){{ target: '_blank' }}
- [`useSignUp()`](/docs/references/react/use-sign-up){{ target: '_blank' }}
- [`useSession()`](/docs/references/react/use-session){{ target: '_blank' }}
- [`useSessionList()`](/docs/references/react/use-session-list){{ target: '_blank' }}
- [`useOrganization()`](/docs/references/react/use-organization){{ target: '_blank' }}
- [`useOrganizationList()`](/docs/references/react/use-organization-list){{ target: '_blank' }}
- [`useUser()`](/docs/sdk/react/use-user){{ target: '_blank' }}
- [`useClerk()`](/docs/sdk/react/use-clerk){{ target: '_blank' }}
- [`useAuth()`](/docs/sdk/react/use-auth){{ target: '_blank' }}
- [`useSignIn()`](/docs/sdk/react/use-sign-in){{ target: '_blank' }}
- [`useSignUp()`](/docs/sdk/react/use-sign-up){{ target: '_blank' }}
- [`useSession()`](/docs/sdk/react/use-session){{ target: '_blank' }}
- [`useSessionList()`](/docs/sdk/react/use-session-list){{ target: '_blank' }}
- [`useOrganization()`](/docs/sdk/react/use-organization){{ target: '_blank' }}
- [`useOrganizationList()`](/docs/sdk/react/use-organization-list){{ target: '_blank' }}
16 changes: 8 additions & 8 deletions docs/_partials/vue-nuxt/composables.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
- [`useUser()`](/docs/references/vue/use-user)
- [`useClerk()`](/docs/references/vue/use-clerk)
- [`useAuth()`](/docs/references/vue/use-auth)
- [`useSignIn()`](/docs/references/vue/use-sign-in)
- [`useSignUp()`](/docs/references/vue/use-sign-up)
- [`useSession()`](/docs/references/vue/use-session)
- [`useSessionList()`](/docs/references/vue/use-session-list)
- [`useOrganization()`](/docs/references/vue/use-organization)
- [`useUser()`](/docs/sdk/vue/use-user)
- [`useClerk()`](/docs/sdk/vue/use-clerk)
- [`useAuth()`](/docs/sdk/vue/use-auth)
- [`useSignIn()`](/docs/sdk/vue/use-sign-in)
- [`useSignUp()`](/docs/sdk/vue/use-sign-up)
- [`useSession()`](/docs/sdk/vue/use-session)
- [`useSessionList()`](/docs/sdk/vue/use-session-list)
- [`useOrganization()`](/docs/sdk/vue/use-organization)
2 changes: 1 addition & 1 deletion docs/_partials/vue-nuxt/use-auth.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The `useAuth()` composable provides access to the current user's authentication state and methods to manage the active session. You can use this composable to protect [pages](/docs/references/nuxt/protect-pages).
The `useAuth()` composable provides access to the current user's authentication state and methods to manage the active session. You can use this composable to protect [pages](/docs/sdk/nuxt/protect-pages).

In the following example, the `isLoaded` property checks if Clerk has finished initializing and the `userId` property checks if the user is signed in.

Expand Down
6 changes: 3 additions & 3 deletions docs/advanced-usage/satellite-domains.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Clerk supports sharing sessions across different domains by adding one or many s

Your "primary" domain is where the authentication state lives, and satellite domains are able to securely read that state from the primary domain, enabling a seamless authentication flow across domains.

Users must complete both the sign-in and sign-up flows on the primary domain by using the [`<SignIn />`](/docs/components/authentication/sign-in) component or [`useSignIn()`](/docs/references/react/use-sign-in) hook for sign-in and [`<SignUp />`](/docs/components/authentication/sign-up) component or [`useSignUp()`](/docs/references/react/use-sign-up) hook for sign-up.
Users must complete both the sign-in and sign-up flows on the primary domain by using the [`<SignIn />`](/docs/components/authentication/sign-in) component or [`useSignIn()`](/docs/sdk/react/use-sign-in) hook for sign-in and [`<SignUp />`](/docs/components/authentication/sign-up) component or [`useSignUp()`](/docs/sdk/react/use-sign-up) hook for sign-up.

To access authentication state from a satellite domain, users will be transparently redirected to the primary domain. If users need to sign in, they must be redirected to a sign in flow hosted on the primary domain, then redirected back to the originating satellite domain. The same redirection process applies to sign-up flows.

Expand All @@ -35,7 +35,7 @@ To access authentication state from a satellite domain, users will be transparen
When building your sign-in flow, you must configure it to run within your primary application, e.g. on `/sign-in`.

> [!NOTE]
> For more information about creating your application, see the [setup guide](/docs/quickstarts/setup-clerk).
> For more information about creating your application, see the [setup guide](/docs/getting-started).
### Add your first satellite domain

Expand Down Expand Up @@ -322,7 +322,7 @@ To access authentication state from a satellite domain, users will be transparen
</Tab>

<Tab>
In a Remix application, you must set the properties in the [`ClerkApp`](/docs/references/remix/clerk-app) wrapper.
In a Remix application, you must set the properties in the [`ClerkApp`](/docs/sdk/remix/clerk-app) wrapper.

- In the root file associated with your primary domain, you only need to configure the `signInUrl` prop:

Expand Down
4 changes: 2 additions & 2 deletions docs/advanced-usage/using-proxies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ When using a proxy, all requests to the Frontend API will be made through your d
To get started, you need to create an application from the [Clerk Dashboard](https://dashboard.clerk.com/). Once you create an instance via the Clerk Dashboard, you will be prompted to choose a domain. For the purposes of this guide, the domain will be `app.dev`.

> [!NOTE]
> For more information on creating a Clerk application, see the [setup guide](/docs/quickstarts/setup-clerk).
> For more information on creating a Clerk application, see the [setup guide](/docs/getting-started).
### Configure your proxy server

Expand Down Expand Up @@ -239,7 +239,7 @@ When using a proxy, all requests to the Frontend API will be made through your d
</Tab>

<Tab>
To configure your proxy setup using properties in your Remix application, set the `proxyUrl` property on the [`ClerkApp`](/docs/references/remix/clerk-app) wrapper.
To configure your proxy setup using properties in your Remix application, set the `proxyUrl` property on the [`ClerkApp`](/docs/sdk/remix/clerk-app) wrapper.

```tsx {{ filename: 'root.tsx' }}
export const loader = (args) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/authentication/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Clerk supports multiple authentication strategies so that you can implement the

Clerk's configuration settings affect how the users of your application can [sign up and sign in](/docs/authentication/configuration/sign-up-sign-in-options) and which properties are editable via their user profile. You can also manage [user sessions](/docs/authentication/configuration/session-options), [control who gets access](/docs/authentication/configuration/restrictions) to your application, and [customize the email & SMS messages](/docs/authentication/configuration/email-sms-templates) that are sent by Clerk during authentication flows. All of these settings can be found under the **User & Authentication** section in the [Clerk Dashboard](https://dashboard.clerk.com/).

For more information on how to set up your application, see the [setup guide](/docs/quickstarts/setup-clerk).
For more information on how to set up your application, see the [setup guide](/docs/getting-started).
2 changes: 1 addition & 1 deletion docs/authentication/social-connections/atlassian.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ For production instances, you will need to generate your own Client ID and Clien
## Before you start

- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/quickstarts/setup-clerk).
- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/getting-started).
- You need to have a Atlassian developer account. To create one, [click here](https://developer.atlassian.com/).

## Configuring an Atlassian OAuth 2.0 Integration
Expand Down
2 changes: 1 addition & 1 deletion docs/authentication/social-connections/bitbucket.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ For production instances, you will need to generate your own Consumer Key and Co
## Before you start

- You need to create a Clerk application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/quickstarts/setup-clerk).
- You need to create a Clerk application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/getting-started).
- You need to have a Bitbucket account. To create one, [click here](https://bitbucket.org/account/signup).

## Configuring Bitbucket social connection
Expand Down
2 changes: 1 addition & 1 deletion docs/authentication/social-connections/dropbox.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ For production instances, you will need to generate your own Client ID and Clien
## Before you start

- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/quickstarts/setup-clerk).
- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/getting-started).
- You need to have a Dropbox account. To create one, [click here](https://www.dropbox.com/lp/developers).

## Configuring Dropbox social connection
Expand Down
2 changes: 1 addition & 1 deletion docs/authentication/social-connections/facebook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ For production instances, you will need to create your own developer account wit
## Before you start

- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/quickstarts/setup-clerk).
- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/getting-started).
- You need to have a Facebook Developer account. To create one, consult the [Register as a Facebook developer](https://developers.facebook.com/docs/development/register) page.

## Configuring Facebook social connection
Expand Down
2 changes: 1 addition & 1 deletion docs/authentication/social-connections/hubspot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ For production instances, you will need to create your own developer account wit
## Before you start

- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/quickstarts/setup-clerk).
- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/getting-started).
- You need to have a HubSpot Developer account. To create one, [click here](https://app.hubspot.com/signup/developers/step/existing-user?_ga=2.145169076.1430980384.1628431607-741498900.1628431607).

## Configuring HubSpot social connection
Expand Down
2 changes: 1 addition & 1 deletion docs/authentication/social-connections/line.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For production instances, you will need to generate your own Client ID and Clien
## Before you start

- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/quickstarts/setup-clerk).
- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/getting-started).
- You need to have a LINE developer account. To create one, [click here](https://developers.line.biz/en/).

## Configuring LINE social connection
Expand Down
2 changes: 1 addition & 1 deletion docs/authentication/social-connections/linkedin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ For production instances, you will need to generate your own Client ID and Clien
## Before you start

- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/quickstarts/setup-clerk).
- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/getting-started).
- You need to have a LinkedIn account. To create one, [click here](https://developer.linkedin.com/).

## Configuring LinkedIn social connection
Expand Down
2 changes: 1 addition & 1 deletion docs/authentication/social-connections/notion.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ For production instances, you will need to generate your own Client ID and Clien
## Before you start

- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/quickstarts/setup-clerk).
- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/getting-started).
- You need to have a Notion developer account. To create one, [click here](https://developers.notion.com/).

## Configuring Notion social connection
Expand Down
4 changes: 2 additions & 2 deletions docs/authentication/social-connections/oauth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ The easiest way to add social connections to your Clerk app is by using [prebuil

## Before you start

- You need to create a Clerk application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, check out the [setup guide](/docs/quickstarts/setup-clerk).
- You need to install the correct SDK for your application. For more information, see the [quickstart guides](/docs/quickstarts/overview).
- You need to create a Clerk application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, check out the [setup guide](/docs/getting-started).
- You need to install the correct SDK for your application. For more information, see the [quickstart guides](/docs/quickstarts).

## Enable a social connection

Expand Down
2 changes: 1 addition & 1 deletion docs/authentication/social-connections/twitch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ For production instances, you will need to generate your own Client ID and Clien
## Before you start

- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/quickstarts/setup-clerk).
- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/getting-started).
- You need to have a Twitch account. To create one, [click here](https://www.twitch.tv/).

## Configuring Twitch social connection
Expand Down
2 changes: 1 addition & 1 deletion docs/authentication/social-connections/twitter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Clerk does not currently support preconfigured shared OAuth credentials for Twit
## Before you start

- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/quickstarts/setup-clerk).
- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/getting-started).
- You need to have a Twitter Application set up so it can be used as a social connection. If you don't have a Twitter Application, click [here](https://developer.twitter.com/en/docs/apps/overview) for instructions on how to create one. If you already have one, go to your [Twitter app settings](https://developer.twitter.com/en/portal/projects-and-apps) and ensure that the _"Allow this app to be used to Sign in with Twitter?_” option is enabled.

## Configuring Twitter social connection
Expand Down
2 changes: 1 addition & 1 deletion docs/authentication/social-connections/xero.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ For production instances, you will need to generate your own Client ID and Clien
## Before you start

- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/quickstarts/setup-clerk).
- You need to create a Clerk Application in the [Clerk Dashboard](https://dashboard.clerk.com/). For more information, see the [setup guide](/docs/getting-started).
- You need to have a Xero developer account. To create one, [click here](https://developer.xero.com/).

## Configuring Xero social connection
Expand Down
4 changes: 2 additions & 2 deletions docs/backend-requests/handling/js-backend-sdks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ app.use(clerkMiddleware())
app.use(clerkMiddleware(options))
```

For more information on the Middleware functions and SDK features, see the [Express SDK](/docs/references/express/overview) page.
For more information on the Middleware functions and SDK features, see the [Express SDK](/docs/sdk/express/methods) page.

## Clerk Fastify SDK

Expand Down Expand Up @@ -64,7 +64,7 @@ const start = async () => {
start()
```

For more information on the Clerk plugin and SDK features, see the [Fastify SDK](/docs/quickstarts/fastify) page.
For more information on the Clerk plugin and SDK features, see the [Fastify SDK](/docs/sdk/fastify/quickstart) page.

## Clerk Backend SDK

Expand Down
4 changes: 2 additions & 2 deletions docs/backend-requests/making/cross-origin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ If your client and server are on different origins (e.g. making an API call to a

## Using Fetch with React

In order to pass the session token using the browser Fetch API, it should be put inside a Bearer token in the Authorization header. To retrieve the session token, use the `getToken` method from the [`useAuth()`](/docs/references/react/use-auth) hook. Be mindful that `getToken` is an async function that returns a Promise which needs to be resolved.
In order to pass the session token using the browser Fetch API, it should be put inside a Bearer token in the Authorization header. To retrieve the session token, use the `getToken` method from the [`useAuth()`](/docs/sdk/react/use-auth) hook. Be mindful that `getToken` is an async function that returns a Promise which needs to be resolved.

```js
import { useAuth } from '@clerk/nextjs'
Expand All @@ -27,7 +27,7 @@ export default function useFetch() {

## `useSWR()` hook

If you are using React or Next.js and want to use SWR's [`useSWR()`](https://swr.vercel.app/) hook, you can create a custom hook by using the [`useAuth()`](/docs/references/react/use-auth) hook. `useAuth()` returns the asynchronous `getToken()` method that can be called to add the session token as a Bearer token in the Authorization header of requests.
If you are using React or Next.js and want to use SWR's [`useSWR()`](https://swr.vercel.app/) hook, you can create a custom hook by using the [`useAuth()`](/docs/sdk/react/use-auth) hook. `useAuth()` returns the asynchronous `getToken()` method that can be called to add the session token as a Bearer token in the Authorization header of requests.

```js
import useSWR from 'swr'
Expand Down
2 changes: 1 addition & 1 deletion docs/backend-requests/making/custom-session-token.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This guide will show you how to customize a session token to include additional

## Use the custom claims in your application

The [`Auth`](/docs/references/backend/types/auth-object) object includes a `sessionClaims` property that contains the custom claims you added to your session token. It's returned by the [`auth()`](/docs/references/nextjs/auth) and `getAuth()` helpers, and the `request` object in server contexts.
The [`Auth`](/docs/references/backend/types/auth-object) object includes a `sessionClaims` property that contains the custom claims you added to your session token. It's returned by the [`auth()`](/docs/sdk/nextjs/auth) and `getAuth()` helpers, and the `request` object in server contexts.

The following example demonstrates how to access the `fullName` and `primaryEmail` claims that were added to the session token in the last step. This examples are written for Next.js, but they can be adapted to other frameworks by using the appropriate method for accessing the `Auth` object.

Expand Down
2 changes: 1 addition & 1 deletion docs/backend-requests/making/same-origin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fetch('/api/foo').then((res) => res.json())

## useSWR hook

If you are using React or Next.js and would like to use the [useSWR](https://swr.vercel.app/) hook, it’s as simple as supplying the API route with whichever fetcher function you are using. Because of the [automatic revalidation feature](https://swr.vercel.app/docs/revalidation) of SWR, you need to retrieve and set the session token in the Authorization header. Call the asynchronous `getToken` method from the [`useAuth()`](/docs/references/react/use-auth) hook and add it as a Bearer token.
If you are using React or Next.js and would like to use the [useSWR](https://swr.vercel.app/) hook, it’s as simple as supplying the API route with whichever fetcher function you are using. Because of the [automatic revalidation feature](https://swr.vercel.app/docs/revalidation) of SWR, you need to retrieve and set the session token in the Authorization header. Call the asynchronous `getToken` method from the [`useAuth()`](/docs/sdk/react/use-auth) hook and add it as a Bearer token.

<CodeBlockTabs options={["JavaScript", "TypeScript"]}>
```jsx
Expand Down
Loading

0 comments on commit 3b017e6

Please sign in to comment.