Skip to content

[ci] Update docs (2025-06-23) #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions backend/auth-object.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Properties

| Property | Type | Description |
| ---------------------------------- | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <a id="debug"></a> `debug` | <code>() => \{ [key: string]: any; \}</code> | Used to help debug issues when using Clerk in development. |
| <a id="gettoken"></a> `getToken` | <code>ServerGetToken \| () => Promise\<string\> \| () => Promise\<null\></code> | A function that gets the current user's [session token](/docs/backend-requests/resources/session-tokens) or a [custom JWT template](/docs/backend-requests/jwt-templates). |
| <a id="has"></a> `has` | [`CheckAuthorizationFromSessionClaims`](../types/check-authorization-from-session-claims.mdx) | A function that checks if the user has an organization role or custom permission. |
| <a id="tokentype"></a> `tokenType` | <code>"session_token" \| "api_key" \| "machine_token" \| "oauth_token"</code> | The allowed token type. |
| Property | Type | Description |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <a id="debug"></a> `debug` | <code>() => \{ [key: string]: any; \}</code> | Used to help debug issues when using Clerk in development. |
| <a id="gettoken"></a> `getToken` | <code>() => Promise\<null\> \| () => Promise\<string\> \| [ServerGetToken](../types/server-get-token.mdx) \| () => Promise\<null\></code> | A function that gets the current user's [session token](/docs/backend-requests/resources/session-tokens) or a [custom JWT template](/docs/backend-requests/jwt-templates). |
| <a id="has"></a> `has` | <code>[CheckAuthorizationFromSessionClaims](../types/check-authorization-from-session-claims.mdx) \| () => false</code> | A function that checks if the user has an organization role or custom permission. |
| <a id="tokentype"></a> `tokenType` | <code>null \| "api_key" \| "session_token" \| "machine_token" \| "oauth_token"</code> | The allowed token type. |
101 changes: 101 additions & 0 deletions backend/get-auth-fn.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
Shared generic overload type for getAuth() helpers across SDKs.

- Parameterized by the request type (RequestType).
- Handles different accepted token types and their corresponding return types.

## Call Signature

Shared generic overload type for getAuth() helpers across SDKs.

- Parameterized by the request type (RequestType).
- Handles different accepted token types and their corresponding return types.

### Parameters

| Parameter | Type |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `req` | `RequestType` |
| `options` | <code>\{ treatPendingAsSignedOut?: boolean; \}</code> & <code>\{ acceptsToken?: "api_key" \| "session_token" \| "machine_token" \| "oauth_token" \| ("api_key" \| "session_token" \| "machine_token" \| "oauth_token")[] \| "any"; \}</code> & <code>\{ acceptsToken: T; \}</code> |

### Returns

`MaybePromise`\<<code>InvalidTokenAuthObject \| [InferAuthObjectFromTokenArray](infer-auth-object-from-token-array.mdx)\<T, SessionAuthObject, MachineAuthObject\<Exclude\<T\[number\], "session_token"\>\>\></code>, `ReturnsPromise`\>

### Example

```ts
const auth = await getAuth(req, { acceptsToken: ["session_token", "api_key"] });
```

## Call Signature

Shared generic overload type for getAuth() helpers across SDKs.

- Parameterized by the request type (RequestType).
- Handles different accepted token types and their corresponding return types.

### Parameters

| Parameter | Type |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `req` | `RequestType` |
| `options` | <code>\{ treatPendingAsSignedOut?: boolean; \}</code> & <code>\{ acceptsToken?: "api_key" \| "session_token" \| "machine_token" \| "oauth_token" \| ("api_key" \| "session_token" \| "machine_token" \| "oauth_token")[] \| "any"; \}</code> & <code>\{ acceptsToken: T; \}</code> |

### Returns

`MaybePromise`\<[`InferAuthObjectFromToken`](infer-auth-object-from-token.mdx)\<`T`, `SessionAuthObject`, `MachineAuthObject`\<`Exclude`\<`T`, `"session_token"`\>\>\>, `ReturnsPromise`\>

### Example

```ts
const auth = await getAuth(req, { acceptsToken: "session_token" });
```

## Call Signature

Shared generic overload type for getAuth() helpers across SDKs.

- Parameterized by the request type (RequestType).
- Handles different accepted token types and their corresponding return types.

### Parameters

| Parameter | Type |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `req` | `RequestType` |
| `options` | <code>\{ treatPendingAsSignedOut?: boolean; \}</code> & <code>\{ acceptsToken?: "api_key" \| "session_token" \| "machine_token" \| "oauth_token" \| ("api_key" \| "session_token" \| "machine_token" \| "oauth_token")[] \| "any"; \}</code> & <code>\{ acceptsToken: "any"; \}</code> |

### Returns

`MaybePromise`\<[`AuthObject`](auth-object.mdx), `ReturnsPromise`\>

### Example

```ts
const auth = await getAuth(req, { acceptsToken: "any" });
```

## Call Signature

Shared generic overload type for getAuth() helpers across SDKs.

- Parameterized by the request type (RequestType).
- Handles different accepted token types and their corresponding return types.

### Parameters

| Parameter | Type | Description |
| ---------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `req` | `RequestType` | - |
| `options?` | <code>\{ treatPendingAsSignedOut?: boolean; \}</code> | - |
| `options.treatPendingAsSignedOut?` | `boolean` | A boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`. |

### Returns

`MaybePromise`\<`SessionAuthObject`, `ReturnsPromise`\>

### Example

```ts
const auth = await getAuth(req);
```
5 changes: 5 additions & 0 deletions backend/infer-auth-object-from-token-array.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Infers auth object type from an array of token types.

- Session token only -> SessionType
- Mixed tokens -> SessionType | MachineType
- Machine tokens only -> MachineType
2 changes: 2 additions & 0 deletions backend/infer-auth-object-from-token.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Infers auth object type from a single token type.
Returns SessionType for session tokens, or MachineType for machine tokens.
64 changes: 64 additions & 0 deletions backend/user.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,67 @@ The Backend `User` object is similar to the `User` object as it holds informatio
| <a id="updatedat"></a> `updatedAt` | `number` | The date when the user was last updated. |
| <a id="username"></a> `username` | <code>null \| string</code> | The user's username. |
| <a id="web3wallets"></a> `web3Wallets` | <code>[Web3Wallet](/docs/references/backend/types/backend-web3-wallet)[]</code> | An array of all the `Web3Wallet` objects associated with the user. Includes the primary. |

## Accessors

### fullName

#### Get Signature

```ts
get fullName(): <code>null | string</code>
```

The full name of the user.

##### Returns

<code>null \| string</code>

---

### primaryEmailAddress

#### Get Signature

```ts
get primaryEmailAddress(): <code>null | EmailAddress</code>
```

The primary email address of the user.

##### Returns

<code>null \| [EmailAddress](/docs/references/backend/types/backend-email-address)</code>

---

### primaryPhoneNumber

#### Get Signature

```ts
get primaryPhoneNumber(): <code>null | PhoneNumber</code>
```

The primary phone number of the user.

##### Returns

<code>null \| [PhoneNumber](/docs/references/backend/types/backend-phone-number)</code>

---

### primaryWeb3Wallet

#### Get Signature

```ts
get primaryWeb3Wallet(): <code>null | Web3Wallet</code>
```

The primary web3 wallet of the user.

##### Returns

<code>null \| [Web3Wallet](/docs/references/backend/types/backend-web3-wallet)</code>
2 changes: 1 addition & 1 deletion backend/verification.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ The Backend `Verification` object describes the state of the verification proces
| <a id="externalverificationredirecturl"></a> `externalVerificationRedirectURL` | <code>null \| URL</code> | The redirect URL for an external verification. |
| <a id="message"></a> `message` | <code>null \| string</code> | The message that will be presented to the user's Web3 wallet for signing during authentication. This follows the [Sign-In with Ethereum (SIWE) protocol format](https://docs.login.xyz/general-information/siwe-overview/eip-4361#example-message-to-be-signed), which typically includes details like the requesting service, wallet address, terms acceptance, nonce, timestamp, and any additional resources. |
| <a id="nonce"></a> `nonce` | <code>null \| string</code> | The [nonce](https://en.wikipedia.org/wiki/Cryptographic_nonce) pertaining to the verification. |
| <a id="status"></a> `status` | `string` | The state of the verification. <ul> <li>`unverified`: The verification has not been verified yet.</li> <li>`verified`: The verification has been verified.</li> <li>`transferable`: The verification is transferable to between sign-in and sign-up flows.</li> <li>`failed`: The verification has failed.</li> <li>`expired`: The verification has expired.</li> </ul> |
| <a id="status"></a> `status` | `VerificationStatus` | The state of the verification. <ul> <li>`unverified`: The verification has not been verified yet.</li> <li>`verified`: The verification has been verified.</li> <li>`transferable`: The verification is transferable to between sign-in and sign-up flows.</li> <li>`failed`: The verification has failed.</li> <li>`expired`: The verification has expired.</li> </ul> |
| <a id="strategy"></a> `strategy` | `string` | The strategy pertaining to the parent sign-up or sign-in attempt. |
19 changes: 19 additions & 0 deletions clerk-react/api-keys.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
**`Experimental`**

This component is in early access and may change in future releases.

## Type declaration

## Parameters

| Parameter | Type |
| --------- | --------------------------------------------------- |
| `props` | [`Without`](../types/without.mdx)\<`P`, `"clerk"`\> |

## Returns

<code>null \| Element</code>

| Name | Type |
| -------------------------------------- | -------- |
| <a id="displayname"></a> `displayName` | `string` |
Loading