diff --git a/clerk-typedoc/backend/auth-object.mdx b/clerk-typedoc/backend/auth-object.mdx index eb50849e84..06d1716405 100644 --- a/clerk-typedoc/backend/auth-object.mdx +++ b/clerk-typedoc/backend/auth-object.mdx @@ -1,8 +1,8 @@ ## Properties -| Property | Type | Description | -| ---------------------------------- | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `debug` | () => \{ [key: string]: any; \} | Used to help debug issues when using Clerk in development. | -| `getToken` | ServerGetToken \| () => Promise\ \| () => Promise\ | 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). | -| `has` | [`CheckAuthorizationFromSessionClaims`](../types/check-authorization-from-session-claims.mdx) | A function that checks if the user has an organization role or custom permission. | -| `tokenType` | "session_token" \| "api_key" \| "machine_token" \| "oauth_token" | The allowed token type. | +| Property | Type | Description | +| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `debug` | () => \{ [key: string]: any; \} | Used to help debug issues when using Clerk in development. | +| `getToken` | () => Promise\ \| () => Promise\ \| [ServerGetToken](../types/server-get-token.mdx) \| () => Promise\ | 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). | +| `has` | [CheckAuthorizationFromSessionClaims](../types/check-authorization-from-session-claims.mdx) \| () => false | A function that checks if the user has an organization role or custom permission. | +| `tokenType` | null \| "api_key" \| "session_token" \| "m2m_token" \| "oauth_token" | The allowed token type. | diff --git a/clerk-typedoc/backend/authenticate-request-options.mdx b/clerk-typedoc/backend/authenticate-request-options.mdx index 25863ab0ba..b28fe98430 100644 --- a/clerk-typedoc/backend/authenticate-request-options.mdx +++ b/clerk-typedoc/backend/authenticate-request-options.mdx @@ -1,23 +1,24 @@ -| Property | Type | Description | -| --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `acceptsToken?` | "api_key" \| "session_token" \| "machine_token" \| "oauth_token" \| ("api_key" \| "session_token" \| "machine_token" \| "oauth_token")[] \| "any" | The type of token to accept. Defaults to `'session_token'`. | -| `afterSignInUrl?` | `string` | Full URL or path to navigate to after successful sign in. Defaults to `'/'`. | -| `afterSignUpUrl?` | `string` | Full URL or path to navigate to after successful sign up. Defaults to `'/'`. | -| `apiUrl?` | `string` | The [Clerk Backend API](/docs/reference/backend-api){{ target: '_blank' }} endpoint. Defaults to `'https://api.clerk.com'`. | -| `apiVersion?` | `string` | The version passed to the Clerk API. Defaults to `'v1'`. | -| `audience?` | string \| string[] | A string or list of [audiences](https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3). If passed, it is checked against the `aud` claim in the token. | -| `authorizedParties?` | string[] | An allowlist of origins to verify against, to protect your application from the subdomain cookie leaking attack. Example: `['http://localhost:3000', 'https://example.com']`. | -| `clockSkewInMs?` | `number` | Specifies the allowed time difference (in milliseconds) between the Clerk server (which generates the token) and the clock of the user's application server when validating a token. Defaults to `5000`. | -| `domain?` | `string` | The domain of a [satellite application](/docs/advanced-usage/satellite-domains) in a multi-domain setup. | -| `isSatellite?` | `boolean` | Whether the instance is a satellite domain in a multi-domain setup. Defaults to `false`. | -| ~~`jwksCacheTtlInMs?`~~ | `number` | **Deprecated.** This cache TTL will be removed in the next major version. Specifying a cache TTL is a no-op. | -| `jwtKey?` | `string` | Used to verify the session token in a networkless manner. Supply the PEM public key from the **[**API keys**](https://dashboard.clerk.com/last-active?path=api-keys) page -> Show JWT public key -> PEM Public Key** section in the Clerk Dashboard. **It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables) instead.** For more information, refer to [Manual JWT verification](/docs/backend-requests/manual-jwt). | -| `organizationSyncOptions?` | \{ organizationPatterns?: string[]; personalAccountPatterns?: string[]; \} | Used to activate a specific [organization](/docs/organizations/overview) or [personal account](/docs/organizations/organization-workspaces) based on URL path parameters. If there's a mismatch between the active organization in the session (e.g., as reported by `auth()`) and the organization indicated by the URL, an attempt to activate the organization specified in the URL will be made. If the activation can't be performed, either because an organization doesn't exist or the user lacks access, the active organization in the session won't be changed. Ultimately, it's the responsibility of the page to verify that the resources are appropriate to render given the URL and handle mismatches appropriately (e.g., by returning a 404). | -| `organizationSyncOptions.organizationPatterns?` | string[] | Specifies URL patterns that are organization-specific, containing an organization ID or slug as a path parameter. If a request matches this path, the organization identifier will be used to set that org as active. If the route also matches the `personalAccountPatterns` prop, this prop takes precedence. Patterns must have a path parameter named either `:id` (to match a Clerk organization ID) or `:slug` (to match a Clerk organization slug). If the organization can't be activated—either because it doesn't exist or the user lacks access—the previously active organization will remain unchanged. Components must detect this case and provide an appropriate error and/or resolution pathway, such as calling `notFound()` or displaying an [``](/docs/components/organization/organization-switcher). Examples: `["/orgs/:slug",, "/orgs/:slug/(.*)"]`, `["/orgs/:id",, "/orgs/:id/(.*)"]`, `["/app/:any/orgs/:slug",, "/app/:any/orgs/:slug/(.*)"]`. | -| `organizationSyncOptions.personalAccountPatterns?` | string[] | URL patterns for resources that exist within the context of a [Clerk Personal Account](/docs/organizations/organization-workspaces) (user-specific, outside any organization). If the route also matches the `organizationPattern` prop, the `organizationPattern` prop takes precedence. Examples: `["/user",, "/user/(.*)"]`, `["/user/:any",, "/user/:any/(.*)"]`. | -| `proxyUrl?` | `string` | The proxy URL from a multi-domain setup. | -| `publishableKey?` | `string` | The Clerk Publishable Key from the [**API keys**](https://dashboard.clerk.com/last-active?path=api-keys) page in the Clerk Dashboard. | -| `secretKey?` | `string` | The Clerk Secret Key from the [**API keys**](https://dashboard.clerk.com/last-active?path=api-keys) page in the Clerk Dashboard. | -| `signInUrl?` | `string` | The sign-in URL from a multi-domain setup. | -| `signUpUrl?` | `string` | The sign-up URL from a multi-domain setup. | -| `skipJwksCache?` | `boolean` | A flag to ignore the JWKS cache and always fetch JWKS before each JWT verification. | +| Property | Type | Description | +| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `acceptsToken?` | "api_key" \| "session_token" \| "m2m_token" \| "oauth_token" \| ("api_key" \| "session_token" \| "m2m_token" \| "oauth_token")[] \| "any" | The type of token to accept. Defaults to `'session_token'`. | +| `afterSignInUrl?` | `string` | Full URL or path to navigate to after successful sign in. Defaults to `'/'`. | +| `afterSignUpUrl?` | `string` | Full URL or path to navigate to after successful sign up. Defaults to `'/'`. | +| `apiUrl?` | `string` | The [Clerk Backend API](/docs/reference/backend-api){{ target: '_blank' }} endpoint. Defaults to `'https://api.clerk.com'`. | +| `apiVersion?` | `string` | The version passed to the Clerk API. Defaults to `'v1'`. | +| `audience?` | string \| string[] | A string or list of [audiences](https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3). If passed, it is checked against the `aud` claim in the token. | +| `authorizedParties?` | string[] | An allowlist of origins to verify against, to protect your application from the subdomain cookie leaking attack. Example: `['http://localhost:3000', 'https://example.com']`. | +| `clockSkewInMs?` | `number` | Specifies the allowed time difference (in milliseconds) between the Clerk server (which generates the token) and the clock of the user's application server when validating a token. Defaults to `5000`. | +| `domain?` | `string` | The domain of a [satellite application](/docs/advanced-usage/satellite-domains) in a multi-domain setup. | +| `isSatellite?` | `boolean` | Whether the instance is a satellite domain in a multi-domain setup. Defaults to `false`. | +| ~~`jwksCacheTtlInMs?`~~ | `number` | **Deprecated.** This cache TTL will be removed in the next major version. Specifying a cache TTL is a no-op. | +| `jwtKey?` | `string` | Used to verify the session token in a networkless manner. Supply the PEM public key from the **[**API keys**](https://dashboard.clerk.com/last-active?path=api-keys) page -> Show JWT public key -> PEM Public Key** section in the Clerk Dashboard. **It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables) instead.** For more information, refer to [Manual JWT verification](/docs/backend-requests/manual-jwt). | +| `machineSecretKey?` | `string` | The machine secret key to use when verifying machine-to-machine tokens. This will override the Clerk secret key. | +| `organizationSyncOptions?` | \{ organizationPatterns?: string[]; personalAccountPatterns?: string[]; \} | Used to activate a specific [organization](/docs/organizations/overview) or [personal account](/docs/organizations/organization-workspaces) based on URL path parameters. If there's a mismatch between the active organization in the session (e.g., as reported by `auth()`) and the organization indicated by the URL, an attempt to activate the organization specified in the URL will be made. If the activation can't be performed, either because an organization doesn't exist or the user lacks access, the active organization in the session won't be changed. Ultimately, it's the responsibility of the page to verify that the resources are appropriate to render given the URL and handle mismatches appropriately (e.g., by returning a 404). | +| `organizationSyncOptions.organizationPatterns?` | string[] | Specifies URL patterns that are organization-specific, containing an organization ID or slug as a path parameter. If a request matches this path, the organization identifier will be used to set that org as active. If the route also matches the `personalAccountPatterns` prop, this prop takes precedence. Patterns must have a path parameter named either `:id` (to match a Clerk organization ID) or `:slug` (to match a Clerk organization slug). If the organization can't be activated—either because it doesn't exist or the user lacks access—the previously active organization will remain unchanged. Components must detect this case and provide an appropriate error and/or resolution pathway, such as calling `notFound()` or displaying an [``](/docs/components/organization/organization-switcher). Examples: `["/orgs/:slug",, "/orgs/:slug/(.*)"]`, `["/orgs/:id",, "/orgs/:id/(.*)"]`, `["/app/:any/orgs/:slug",, "/app/:any/orgs/:slug/(.*)"]`. | +| `organizationSyncOptions.personalAccountPatterns?` | string[] | URL patterns for resources that exist within the context of a [Clerk Personal Account](/docs/organizations/organization-workspaces) (user-specific, outside any organization). If the route also matches the `organizationPattern` prop, the `organizationPattern` prop takes precedence. Examples: `["/user",, "/user/(.*)"]`, `["/user/:any",, "/user/:any/(.*)"]`. | +| `proxyUrl?` | `string` | The proxy URL from a multi-domain setup. | +| `publishableKey?` | `string` | The Clerk Publishable Key from the [**API keys**](https://dashboard.clerk.com/last-active?path=api-keys) page in the Clerk Dashboard. | +| `secretKey?` | `string` | The Clerk Secret Key from the [**API keys**](https://dashboard.clerk.com/last-active?path=api-keys) page in the Clerk Dashboard. | +| `signInUrl?` | `string` | The sign-in URL from a multi-domain setup. | +| `signUpUrl?` | `string` | The sign-up URL from a multi-domain setup. | +| `skipJwksCache?` | `boolean` | A flag to ignore the JWKS cache and always fetch JWKS before each JWT verification. | diff --git a/clerk-typedoc/backend/commerce-plan-json.mdx b/clerk-typedoc/backend/commerce-plan-json.mdx new file mode 100644 index 0000000000..286e6c2242 --- /dev/null +++ b/clerk-typedoc/backend/commerce-plan-json.mdx @@ -0,0 +1,24 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version to avoid breaking changes. + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------------------------- | ---------------------------- | ---------------------------------------------------------- | -------------------------- | +| `annual_fee` | `CommerceFeeJSON` | **`Experimental`** | - | +| `annual_monthly_fee` | `CommerceFeeJSON` | **`Experimental`** | - | +| `description?` | `string` | **`Experimental`** | - | +| `features` | FeatureJSON[] | **`Experimental`** | - | +| `fee` | `CommerceFeeJSON` | **`Experimental`** | - | +| `for_payer_type` | "user" \| "org" | **`Experimental`** | - | +| `has_base_fee` | `boolean` | **`Experimental`** | - | +| `id` | `string` | **`Experimental`** The unique identifier for the resource. | `ClerkResourceJSON.id` | +| `is_default` | `boolean` | **`Experimental`** | - | +| `is_recurring` | `boolean` | **`Experimental`** | - | +| `name` | `string` | **`Experimental`** | - | +| `object` | `"commerce_plan"` | **`Experimental`** The type of the resource. | `ClerkResourceJSON.object` | +| `product_id` | `string` | **`Experimental`** | - | +| `publicly_visible` | `boolean` | **`Experimental`** | - | +| `slug` | `string` | **`Experimental`** | - | diff --git a/clerk-typedoc/backend/commerce-plan.mdx b/clerk-typedoc/backend/commerce-plan.mdx new file mode 100644 index 0000000000..4a1faa772c --- /dev/null +++ b/clerk-typedoc/backend/commerce-plan.mdx @@ -0,0 +1,68 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version to avoid breaking changes. + +## Constructors + +### Constructor + +**`Experimental`** + +#### Parameters + +| Parameter | Type | Description | +| ------------------ | -------------------------------- | --------------------------------------------------------------- | +| `id` | `string` | The unique identifier for the plan. | +| `productId` | `string` | The id of the product the plan belongs to. | +| `name` | `string` | The name of the plan. | +| `slug` | `string` | The URL-friendly identifier of the plan. | +| `description` | undefined \| string | The description of the plan. | +| `isDefault` | `boolean` | Whether the plan is the default plan. | +| `isRecurring` | `boolean` | Whether the plan is recurring. | +| `hasBaseFee` | `boolean` | Whether the plan has a base fee. | +| `publiclyVisible` | `boolean` | Whether the plan is displayed in the `` component. | +| `fee` | `CommerceFee` | The monthly fee of the plan. | +| `annualFee` | `CommerceFee` | The annual fee of the plan. | +| `annualMonthlyFee` | `CommerceFee` | The annual fee of the plan on a monthly basis. | +| `forPayerType` | "user" \| "org" | The type of payer for the plan. | +| `features` | Feature[] | The features the plan offers. | + +#### Returns + +`CommercePlan` + +## Properties + +| Property | Type | Description | +| ------------------------------------------------ | -------------------------------- | ---------------------------------------------------------------------------------- | +| `annualFee` | `CommerceFee` | **`Experimental`** The annual fee of the plan. | +| `annualMonthlyFee` | `CommerceFee` | **`Experimental`** The annual fee of the plan on a monthly basis. | +| `description` | undefined \| string | **`Experimental`** The description of the plan. | +| `features` | Feature[] | **`Experimental`** The features the plan offers. | +| `fee` | `CommerceFee` | **`Experimental`** The monthly fee of the plan. | +| `forPayerType` | "user" \| "org" | **`Experimental`** The type of payer for the plan. | +| `hasBaseFee` | `boolean` | **`Experimental`** Whether the plan has a base fee. | +| `id` | `string` | **`Experimental`** The unique identifier for the plan. | +| `isDefault` | `boolean` | **`Experimental`** Whether the plan is the default plan. | +| `isRecurring` | `boolean` | **`Experimental`** Whether the plan is recurring. | +| `name` | `string` | **`Experimental`** The name of the plan. | +| `productId` | `string` | **`Experimental`** The id of the product the plan belongs to. | +| `publiclyVisible` | `boolean` | **`Experimental`** Whether the plan is displayed in the `` component. | +| `slug` | `string` | **`Experimental`** The URL-friendly identifier of the plan. | + +## Methods + +### fromJSON() + +**`Experimental`** + +#### Parameters + +| Parameter | Type | +| --------- | -------------------------------------------- | +| `data` | [`CommercePlanJSON`](commerce-plan-json.mdx) | + +#### Returns + +`CommercePlan` diff --git a/clerk-typedoc/backend/get-auth-fn.mdx b/clerk-typedoc/backend/get-auth-fn.mdx new file mode 100644 index 0000000000..d2d8f208d6 --- /dev/null +++ b/clerk-typedoc/backend/get-auth-fn.mdx @@ -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` | \{ treatPendingAsSignedOut?: boolean; \} & \{ acceptsToken?: "api_key" \| "session_token" \| "m2m_token" \| "oauth_token" \| ("api_key" \| "session_token" \| "m2m_token" \| "oauth_token")[] \| "any"; \} & \{ acceptsToken: T; \} | + +### Returns + +`MaybePromise`\<InvalidTokenAuthObject \| [InferAuthObjectFromTokenArray](infer-auth-object-from-token-array.mdx)\\>\>, `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` | \{ treatPendingAsSignedOut?: boolean; \} & \{ acceptsToken?: "api_key" \| "session_token" \| "m2m_token" \| "oauth_token" \| ("api_key" \| "session_token" \| "m2m_token" \| "oauth_token")[] \| "any"; \} & \{ acceptsToken: T; \} | + +### 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` | \{ treatPendingAsSignedOut?: boolean; \} & \{ acceptsToken?: "api_key" \| "session_token" \| "m2m_token" \| "oauth_token" \| ("api_key" \| "session_token" \| "m2m_token" \| "oauth_token")[] \| "any"; \} & \{ acceptsToken: "any"; \} | + +### 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?` | \{ treatPendingAsSignedOut?: boolean; \} | - | +| `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); +``` diff --git a/clerk-typedoc/backend/infer-auth-object-from-token-array.mdx b/clerk-typedoc/backend/infer-auth-object-from-token-array.mdx new file mode 100644 index 0000000000..a7421ad97d --- /dev/null +++ b/clerk-typedoc/backend/infer-auth-object-from-token-array.mdx @@ -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 diff --git a/clerk-typedoc/backend/infer-auth-object-from-token.mdx b/clerk-typedoc/backend/infer-auth-object-from-token.mdx new file mode 100644 index 0000000000..09a78f383a --- /dev/null +++ b/clerk-typedoc/backend/infer-auth-object-from-token.mdx @@ -0,0 +1,2 @@ +Infers auth object type from a single token type. +Returns SessionType for session tokens, or MachineType for machine tokens. diff --git a/clerk-typedoc/backend/user.mdx b/clerk-typedoc/backend/user.mdx index 17bd7ba41f..85d4eafefd 100644 --- a/clerk-typedoc/backend/user.mdx +++ b/clerk-typedoc/backend/user.mdx @@ -36,3 +36,67 @@ The Backend `User` object is similar to the `User` object as it holds informatio | `updatedAt` | `number` | The date when the user was last updated. | | `username` | null \| string | The user's username. | | `web3Wallets` | [Web3Wallet](/docs/references/backend/types/backend-web3-wallet)[] | An array of all the `Web3Wallet` objects associated with the user. Includes the primary. | + +## Accessors + +### fullName + +#### Get Signature + +```ts +get fullName(): null | string +``` + +The full name of the user. + +##### Returns + +null \| string + +--- + +### primaryEmailAddress + +#### Get Signature + +```ts +get primaryEmailAddress(): null | EmailAddress +``` + +The primary email address of the user. + +##### Returns + +null \| [EmailAddress](/docs/references/backend/types/backend-email-address) + +--- + +### primaryPhoneNumber + +#### Get Signature + +```ts +get primaryPhoneNumber(): null | PhoneNumber +``` + +The primary phone number of the user. + +##### Returns + +null \| [PhoneNumber](/docs/references/backend/types/backend-phone-number) + +--- + +### primaryWeb3Wallet + +#### Get Signature + +```ts +get primaryWeb3Wallet(): null | Web3Wallet +``` + +The primary web3 wallet of the user. + +##### Returns + +null \| [Web3Wallet](/docs/references/backend/types/backend-web3-wallet) diff --git a/clerk-typedoc/backend/verification.mdx b/clerk-typedoc/backend/verification.mdx index a28f719f8f..0abc5338e0 100644 --- a/clerk-typedoc/backend/verification.mdx +++ b/clerk-typedoc/backend/verification.mdx @@ -9,5 +9,5 @@ The Backend `Verification` object describes the state of the verification proces | `externalVerificationRedirectURL` | null \| URL | The redirect URL for an external verification. | | `message` | null \| string | 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. | | `nonce` | null \| string | The [nonce](https://en.wikipedia.org/wiki/Cryptographic_nonce) pertaining to the verification. | -| `status` | `string` | The state of the verification.
  • `unverified`: The verification has not been verified yet.
  • `verified`: The verification has been verified.
  • `transferable`: The verification is transferable to between sign-in and sign-up flows.
  • `failed`: The verification has failed.
  • `expired`: The verification has expired.
| +| `status` | `VerificationStatus` | The state of the verification.
  • `unverified`: The verification has not been verified yet.
  • `verified`: The verification has been verified.
  • `transferable`: The verification is transferable to between sign-in and sign-up flows.
  • `failed`: The verification has failed.
  • `expired`: The verification has expired.
| | `strategy` | `string` | The strategy pertaining to the parent sign-up or sign-in attempt. | diff --git a/clerk-typedoc/backend/verify-machine-auth-token.mdx b/clerk-typedoc/backend/verify-machine-auth-token.mdx index 26677f1f83..f9f70401ed 100644 --- a/clerk-typedoc/backend/verify-machine-auth-token.mdx +++ b/clerk-typedoc/backend/verify-machine-auth-token.mdx @@ -9,4 +9,4 @@ Verifies any type of machine token by detecting its type from the prefix. ## Returns -`Promise`\<\{ data?: undefined; errors: \[MachineTokenVerificationError\]; tokenType: "api_key" \| "machine_token" \| "oauth_token"; \} \| \{ data: MachineToken; errors?: undefined; tokenType: "api_key" \| "machine_token" \| "oauth_token"; \} \| \{ data: IdPOAuthAccessToken; errors?: undefined; tokenType: "api_key" \| "machine_token" \| "oauth_token"; \} \| \{ data: APIKey; errors?: undefined; tokenType: "api_key" \| "machine_token" \| "oauth_token"; \}\> +`Promise`\<\{ data?: undefined; errors: \[MachineTokenVerificationError\]; tokenType: "api_key" \| "m2m_token" \| "oauth_token"; \} \| \{ data: M2MToken; errors?: undefined; tokenType: "api_key" \| "m2m_token" \| "oauth_token"; \} \| \{ data: IdPOAuthAccessToken; errors?: undefined; tokenType: "api_key" \| "m2m_token" \| "oauth_token"; \}\> diff --git a/clerk-typedoc/backend/verify-webhook.mdx b/clerk-typedoc/backend/verify-webhook.mdx index d508493314..dc336b5135 100644 --- a/clerk-typedoc/backend/verify-webhook.mdx +++ b/clerk-typedoc/backend/verify-webhook.mdx @@ -1,4 +1,4 @@ -Verifies the authenticity of a webhook request using Svix. Returns a promise that resolves to the verified webhook event data. +Verifies the authenticity of a webhook request using Standard Webhooks. Returns a promise that resolves to the verified webhook event data. ```ts function verifyWebhook(request, options): Promise; diff --git a/clerk-typedoc/clerk-react/api-keys.mdx b/clerk-typedoc/clerk-react/api-keys.mdx new file mode 100644 index 0000000000..4147bc55f1 --- /dev/null +++ b/clerk-typedoc/clerk-react/api-keys.mdx @@ -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 + +null \| Element + +| Name | Type | +| -------------------------------------- | -------- | +| `displayName` | `string` | diff --git a/clerk-typedoc/clerk-react/clerk-provider-props.mdx b/clerk-typedoc/clerk-react/clerk-provider-props.mdx index 9c9f3301b1..4b76b558d1 100644 --- a/clerk-typedoc/clerk-react/clerk-provider-props.mdx +++ b/clerk-typedoc/clerk-react/clerk-provider-props.mdx @@ -16,7 +16,7 @@ | `experimental?` | `Autocomplete`\<\{ commerce: boolean; persistClient: boolean; rethrowOfflineNetworkErrors: boolean; \}, `Record`\<`string`, `any`\>\> | Enable experimental flags to gain access to new features. These flags are not guaranteed to be stable and may change drastically in between patch or minor versions. | | `initialState?` | `Serializable`\<\{ actor: undefined \| \{ [x: string]: unknown; sub: string; \}; factorVerificationAge: \[number, number\]; organization: undefined \| [OrganizationResource](/docs/references/javascript/organization); orgId: undefined \| string; orgPermissions: undefined \| string[]; orgRole: undefined \| string; orgSlug: undefined \| string; session: undefined \| [SessionResource](/docs/references/javascript/session); sessionClaims: JwtPayload; sessionId: undefined \| string; sessionStatus: [SessionStatusClaim](/docs/references/javascript/types/session-status); user: undefined \| [UserResource](/docs/references/javascript/user); userId: undefined \| string; \}\> | Provide an initial state of the Clerk client during server-side rendering. You don't need to set this value yourself unless you're [developing an SDK](/docs/references/sdk/overview). | | `isSatellite?` | boolean \| (url) => boolean | A boolean that indicates whether the application is a satellite application. | -| `localization?` | `DeepPartial`\<[Localization](/docs/customization/localization)\> | Optional object to localize your components. Will only affect [Clerk Components](/docs/components/overview) and not [Account Portal](/docs/account-portal/overview) pages. | +| `localization?` | `DeepPartial`\<`DeepLocalizationWithoutObjects`\<`__internal_LocalizationResource`\>\> | Optional object to localize your components. Will only affect [Clerk Components](/docs/components/overview) and not [Account Portal](/docs/account-portal/overview) pages. | | `newSubscriptionRedirectUrl?` | null \| string | The URL to navigate to after the user completes the checkout and clicks the "Continue" button. | | `nonce?` | `string` | This nonce value will be passed through to the `@clerk/clerk-js` script tag. Use it to implement a [strict-dynamic CSP](/docs/security/clerk-csp#implementing-a-strict-dynamic-csp). Requires the `dynamic` prop to also be set. | | `proxyUrl?` | string \| (url) => string \| (url) => string | **Required for applications that run behind a reverse proxy**. The URL that Clerk will proxy requests to. Can be either a relative path (`/__clerk`) or a full URL (`https:///__clerk`). | @@ -37,7 +37,7 @@ | `signUpUrl?` | `string` | This URL will be used for any redirects that might happen and needs to point to your primary application on the client-side. This option is optional for production instances but **must be set for a satellite application in a development instance**. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. | | `standardBrowser?` | `boolean` | By default, ClerkJS is loaded with the assumption that cookies can be set (browser setup). On native platforms this value must be set to `false`. | | `supportEmail?` | `string` | Optional support email for display in authentication screens. Will only affect [Clerk Components](/docs/components/overview) and not [Account Portal](/docs/account-portal/overview) pages. | +| `taskUrls?` | `Record`\<`"choose-organization"`, `string`\> | Customize the URL paths users are redirected to after sign-in or sign-up when specific session tasks need to be completed. Defaults to `undefined - Uses Clerk's default task flow URLs`. | | `telemetry?` | false \| \{ debug?: boolean; disabled?: boolean; \} | Controls whether or not Clerk will collect [telemetry data](/docs/telemetry). If set to `debug`, telemetry events are only logged to the console and not sent to Clerk. | | `touchSession?` | `boolean` | By default, the [Clerk Frontend API `touch` endpoint](/docs/reference/frontend-api/tag/Sessions#operation/touchSession) is called during page focus to keep the last active session alive. This option allows you to disable this behavior. | -| `treatPendingAsSignedOut?` | `boolean` | A boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`. | | `waitlistUrl?` | `string` | The full URL or path to the waitlist page. If `undefined`, will redirect to the [Account Portal waitlist page](/docs/account-portal/overview#waitlist). | diff --git a/clerk-typedoc/clerk-react/use-auth.mdx b/clerk-typedoc/clerk-react/use-auth.mdx index 795da415f2..01f1051a69 100644 --- a/clerk-typedoc/clerk-react/use-auth.mdx +++ b/clerk-typedoc/clerk-react/use-auth.mdx @@ -11,7 +11,7 @@ By default, Next.js opts all routes into static rendering. If you need to opt a | Parameter | Type | Description | | ---------------------------- | -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `initialAuthStateOrOptions?` | null \| \{ treatPendingAsSignedOut?: boolean; \} \| Record\ | An object containing the initial authentication state or options for the `useAuth()` hook. If not provided, the hook will attempt to derive the state from the context. `treatPendingAsSignedOut` is a boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`. | +| `initialAuthStateOrOptions?` | null \| Record\ \| \{ treatPendingAsSignedOut?: boolean; \} | An object containing the initial authentication state or options for the `useAuth()` hook. If not provided, the hook will attempt to derive the state from the context. `treatPendingAsSignedOut` is a boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`. | ## Returns diff --git a/clerk-typedoc/clerk-react/use-session.mdx b/clerk-typedoc/clerk-react/use-session.mdx index 0cbd556d83..1abbc16b9b 100644 --- a/clerk-typedoc/clerk-react/use-session.mdx +++ b/clerk-typedoc/clerk-react/use-session.mdx @@ -1,12 +1,5 @@ The `useSession()` hook provides access to the current user's [`Session`](/docs/references/javascript/session) object, as well as helpers for setting the active session. -## Parameters - -| Parameter | Type | Description | -| ---------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `options?` | \{ treatPendingAsSignedOut?: boolean; \} | An object containing options for the `useSession()` hook. | -| `options.treatPendingAsSignedOut?` | `boolean` | A boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`. | - ## Returns This function returns a discriminated union type. There are multiple variants of this type available which you can select by clicking on one of the tabs. @@ -17,21 +10,21 @@ This function returns a discriminated union type. There are multiple variants of | ------ | ------ | ------ | | `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | | `isSignedIn` | `undefined` | A boolean that indicates whether a user is currently signed in. | -| `session` | `undefined` | The current active session for the user. | +| `session` | `undefined` | The current session for the user. | | Name | Type | Description | | ------ | ------ | ------ | | `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | | `isSignedIn` | `false` | A boolean that indicates whether a user is currently signed in. | -| `session` | `null` | The current active session for the user. | +| `session` | `null` | The current session for the user. | | Name | Type | Description | | ------ | ------ | ------ | | `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `isSignedIn` | `true` | A boolean that indicates whether a user is currently signed in. | -| `session` | [`SignedInSessionResource`](/docs/references/javascript/session) | The current active session for the user. | +| `isSignedIn` | `boolean` | A boolean that indicates whether a user is currently signed in. | +| `session` | [`SignedInSessionResource`](/docs/references/javascript/session) | The current session for the user. | diff --git a/clerk-typedoc/clerk-react/use-user.mdx b/clerk-typedoc/clerk-react/use-user.mdx index d4aa5afc90..a89b31c4fa 100644 --- a/clerk-typedoc/clerk-react/use-user.mdx +++ b/clerk-typedoc/clerk-react/use-user.mdx @@ -61,17 +61,14 @@ The following example uses the `useUser()` hook to access the [`User`](/docs/ref import { useUser } from "@clerk/clerk-react"; export default function Home() { - const { isLoaded, isSignedIn, user } = useUser(); + const { isLoaded, user } = useUser(); if (!isLoaded) { // Handle loading state return null; } - if (!isSignedIn) { - // Handle signed out state - return null; - } + if (!user) return null; const updateUser = async () => { await user.update({ @@ -99,17 +96,14 @@ export default function Home() { import { useUser } from "@clerk/nextjs"; export default function HomePage() { - const { isLoaded, isSignedIn, user } = useUser(); + const { isLoaded, user } = useUser(); if (!isLoaded) { // Handle loading state return null; } - if (!isSignedIn) { - // Handle signed out state - return null; - } + if (!user) return null; const updateUser = async () => { await user.update({ @@ -142,17 +136,14 @@ The following example uses the `useUser()` hook to access the [`User`](/docs/ref import { useUser } from "@clerk/clerk-react"; export default function Home() { - const { isLoaded, isSignedIn, user } = useUser(); + const { isLoaded, user } = useUser(); if (!isLoaded) { // Handle loading state return null; } - if (!isSignedIn) { - // Handle signed out state - return null; - } + if (!user) return null; const updateUser = async () => { // Update data via an API endpoint @@ -185,17 +176,14 @@ export default function Home() { import { useUser } from "@clerk/nextjs"; export default function HomePage() { - const { isLoaded, isSignedIn, user } = useUser(); + const { isLoaded, user } = useUser(); if (!isLoaded) { // Handle loading state return null; } - if (!isSignedIn) { - // Handle signed out state - return null; - } + if (!user) return null; const updateUser = async () => { // Update data via an API endpoint diff --git a/clerk-typedoc/nextjs/clerk-middleware-options.mdx b/clerk-typedoc/nextjs/clerk-middleware-options.mdx index 2e1a80b34b..9514009e75 100644 --- a/clerk-typedoc/nextjs/clerk-middleware-options.mdx +++ b/clerk-typedoc/nextjs/clerk-middleware-options.mdx @@ -17,6 +17,7 @@ The `clerkMiddleware()` function accepts an optional object. The following optio | `isSatellite?` | `boolean` | Whether the instance is a satellite domain in a multi-domain setup. Defaults to `false`. | | ~~`jwksCacheTtlInMs?`~~ | `number` | **Deprecated.** This cache TTL will be removed in the next major version. Specifying a cache TTL is a no-op. | | `jwtKey?` | `string` | Used to verify the session token in a networkless manner. Supply the PEM public key from the **[**API keys**](https://dashboard.clerk.com/last-active?path=api-keys) page -> Show JWT public key -> PEM Public Key** section in the Clerk Dashboard. **It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables) instead.** For more information, refer to [Manual JWT verification](/docs/backend-requests/manual-jwt). | +| `machineSecretKey?` | `string` | The machine secret key to use when verifying machine-to-machine tokens. This will override the Clerk secret key. | | `organizationSyncOptions?` | \{ organizationPatterns?: string[]; personalAccountPatterns?: string[]; \} | Used to activate a specific [organization](/docs/organizations/overview) or [personal account](/docs/organizations/organization-workspaces) based on URL path parameters. If there's a mismatch between the active organization in the session (e.g., as reported by `auth()`) and the organization indicated by the URL, an attempt to activate the organization specified in the URL will be made. If the activation can't be performed, either because an organization doesn't exist or the user lacks access, the active organization in the session won't be changed. Ultimately, it's the responsibility of the page to verify that the resources are appropriate to render given the URL and handle mismatches appropriately (e.g., by returning a 404). | | `organizationSyncOptions.organizationPatterns?` | string[] | Specifies URL patterns that are organization-specific, containing an organization ID or slug as a path parameter. If a request matches this path, the organization identifier will be used to set that org as active. If the route also matches the `personalAccountPatterns` prop, this prop takes precedence. Patterns must have a path parameter named either `:id` (to match a Clerk organization ID) or `:slug` (to match a Clerk organization slug). If the organization can't be activated—either because it doesn't exist or the user lacks access—the previously active organization will remain unchanged. Components must detect this case and provide an appropriate error and/or resolution pathway, such as calling `notFound()` or displaying an [``](/docs/components/organization/organization-switcher). Examples: `["/orgs/:slug",, "/orgs/:slug/(.*)"]`, `["/orgs/:id",, "/orgs/:id/(.*)"]`, `["/app/:any/orgs/:slug",, "/app/:any/orgs/:slug/(.*)"]`. | | `organizationSyncOptions.personalAccountPatterns?` | string[] | URL patterns for resources that exist within the context of a [Clerk Personal Account](/docs/organizations/organization-workspaces) (user-specific, outside any organization). If the route also matches the `organizationPattern` prop, the `organizationPattern` prop takes precedence. Examples: `["/user",, "/user/(.*)"]`, `["/user/:any",, "/user/:any/(.*)"]`. | diff --git a/clerk-typedoc/nextjs/create-async-get-auth.mdx b/clerk-typedoc/nextjs/create-async-get-auth.mdx index 7681d8f3b5..e598027e2b 100644 --- a/clerk-typedoc/nextjs/create-async-get-auth.mdx +++ b/clerk-typedoc/nextjs/create-async-get-auth.mdx @@ -13,10 +13,10 @@ Should be used with function like `auth()` that are already asynchronous. ### Parameters -| Parameter | Type | -| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `req` | `RequestLike` | -| `opts?` | \{ secretKey?: string; \} & \{ acceptsToken?: "session_token" \| "api_key" \| "machine_token" \| "oauth_token" \| ("session_token" \| "api_key" \| "machine_token" \| "oauth_token")[] \| "any"; \} & \{ treatPendingAsSignedOut?: boolean; \} | +| Parameter | Type | +| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `req` | `RequestLike` | +| `opts?` | \{ secretKey?: string; \} & \{ acceptsToken?: "session_token" \| "api_key" \| "m2m_token" \| "oauth_token" \| ("session_token" \| "api_key" \| "m2m_token" \| "oauth_token")[] \| "any"; \} & \{ treatPendingAsSignedOut?: boolean; \} | ### Returns diff --git a/clerk-typedoc/nextjs/create-sync-get-auth.mdx b/clerk-typedoc/nextjs/create-sync-get-auth.mdx index 07a047506c..36f2647a57 100644 --- a/clerk-typedoc/nextjs/create-sync-get-auth.mdx +++ b/clerk-typedoc/nextjs/create-sync-get-auth.mdx @@ -14,10 +14,10 @@ It powers the synchronous top-level api `getAuth()`. ### Parameters -| Parameter | Type | -| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `req` | `RequestLike` | -| `opts?` | \{ secretKey?: string; \} & \{ acceptsToken?: "session_token" \| "api_key" \| "machine_token" \| "oauth_token" \| ("session_token" \| "api_key" \| "machine_token" \| "oauth_token")[] \| "any"; \} & \{ treatPendingAsSignedOut?: boolean; \} | +| Parameter | Type | +| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `req` | `RequestLike` | +| `opts?` | \{ secretKey?: string; \} & \{ acceptsToken?: "session_token" \| "api_key" \| "m2m_token" \| "oauth_token" \| ("session_token" \| "api_key" \| "m2m_token" \| "oauth_token")[] \| "any"; \} & \{ treatPendingAsSignedOut?: boolean; \} | ### Returns diff --git a/clerk-typedoc/nextjs/get-auth.mdx b/clerk-typedoc/nextjs/get-auth.mdx index 7387482683..1312a0929e 100644 --- a/clerk-typedoc/nextjs/get-auth.mdx +++ b/clerk-typedoc/nextjs/get-auth.mdx @@ -5,10 +5,10 @@ The `getAuth()` helper retrieves authentication state from the request object. ## Parameters -| Parameter | Type | Description | -| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- | -| `req` | `RequestLike` | The Next.js request object. | -| `opts?` | \{ secretKey?: string; \} & \{ acceptsToken?: "session_token" \| "api_key" \| "machine_token" \| "oauth_token" \| ("session_token" \| "api_key" \| "machine_token" \| "oauth_token")[] \| "any"; \} & \{ treatPendingAsSignedOut?: boolean; \} | - | +| Parameter | Type | Description | +| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- | +| `req` | `RequestLike` | The Next.js request object. | +| `opts?` | \{ secretKey?: string; \} & \{ acceptsToken?: "session_token" \| "api_key" \| "m2m_token" \| "oauth_token" \| ("session_token" \| "api_key" \| "m2m_token" \| "oauth_token")[] \| "any"; \} & \{ treatPendingAsSignedOut?: boolean; \} | - | ## Returns diff --git a/clerk-typedoc/shared/build-clerk-js-script-attributes.mdx b/clerk-typedoc/shared/build-clerk-js-script-attributes.mdx index ae5419fdf9..eb0fbc9ae7 100644 --- a/clerk-typedoc/shared/build-clerk-js-script-attributes.mdx +++ b/clerk-typedoc/shared/build-clerk-js-script-attributes.mdx @@ -1,11 +1,11 @@ -Builds an object of Clerk JS script attributes. +Builds an object of Clerk JS script attributes based on the provided options. ## Parameters -| Parameter | Type | -| --------- | -------------------------- | -| `options` | `LoadClerkJsScriptOptions` | +| Parameter | Type | Description | +| --------- | -------------------------- | -------------------------------------------------------- | +| `options` | `LoadClerkJsScriptOptions` | The options containing the values for script attributes. | ## Returns -`Record`\<`string`, `string`\> +`Record`\<`string`, `string`\> — An object containing data attributes to be applied to the script element. diff --git a/clerk-typedoc/shared/build-publishable-key.mdx b/clerk-typedoc/shared/build-publishable-key.mdx new file mode 100644 index 0000000000..2cd1ea56cb --- /dev/null +++ b/clerk-typedoc/shared/build-publishable-key.mdx @@ -0,0 +1,11 @@ +Converts a frontend API URL into a base64-encoded publishable key. + +## Parameters + +| Parameter | Type | Description | +| ------------- | -------- | ------------------------------------------------- | +| `frontendApi` | `string` | The frontend API URL (e.g., 'clerk.example.com'). | + +## Returns + +`string` — A base64-encoded publishable key with appropriate prefix (pk*live* or pk*test*). diff --git a/clerk-typedoc/shared/clerk-js-script-url.mdx b/clerk-typedoc/shared/clerk-js-script-url.mdx index ccc302d17e..abbd4d3b37 100644 --- a/clerk-typedoc/shared/clerk-js-script-url.mdx +++ b/clerk-typedoc/shared/clerk-js-script-url.mdx @@ -1,4 +1,4 @@ -Generates a Clerk JS script URL. +Generates a Clerk JS script URL based on the provided options. ## Parameters @@ -8,10 +8,11 @@ Generates a Clerk JS script URL. ## Returns -`string` +`string` — The complete URL to the Clerk JS script. ## Example -```ts -clerkJsScriptUrl({ publishableKey: "pk_" }); +```typescript +const url = clerkJsScriptUrl({ publishableKey: "pk_test_..." }); +// Returns: "https://example.clerk.accounts.dev/npm/@clerk/clerk-js@5/dist/clerk.browser.js" ``` diff --git a/clerk-typedoc/shared/create-dev-or-staging-url-cache.mdx b/clerk-typedoc/shared/create-dev-or-staging-url-cache.mdx new file mode 100644 index 0000000000..d0f1aeaeda --- /dev/null +++ b/clerk-typedoc/shared/create-dev-or-staging-url-cache.mdx @@ -0,0 +1,10 @@ +Creates a memoized cache for checking if URLs are development or staging environments. +Uses a Map to cache results for better performance on repeated checks. + +## Returns + +An object with an isDevOrStagingUrl method that checks if a URL is dev/staging. + +| Name | Type | Description | +| --------------------- | ----------------------------- | -------------------------------------------------------- | +| `isDevOrStagingUrl()` | (url) => boolean | Checks if a URL is a development or staging environment. | diff --git a/clerk-typedoc/shared/get-cookie-suffix.mdx b/clerk-typedoc/shared/get-cookie-suffix.mdx new file mode 100644 index 0000000000..ac115fcc8b --- /dev/null +++ b/clerk-typedoc/shared/get-cookie-suffix.mdx @@ -0,0 +1,13 @@ +Generates a unique cookie suffix based on the publishable key using SHA-1 hashing. +The suffix is base64-encoded and URL-safe (+ and / characters are replaced). + +## Parameters + +| Parameter | Type | Description | +| ---------------- | -------------- | ------------------------------------------------------------------------------------- | +| `publishableKey` | `string` | The publishable key to generate suffix from. | +| `subtle` | `SubtleCrypto` | The SubtleCrypto interface to use for hashing (defaults to globalThis.crypto.subtle). | + +## Returns + +`Promise`\<`string`\> — A promise that resolves to an 8-character URL-safe base64 string. diff --git a/clerk-typedoc/shared/get-env-variable.mdx b/clerk-typedoc/shared/get-env-variable.mdx index ed419fa94c..a60f14161b 100644 --- a/clerk-typedoc/shared/get-env-variable.mdx +++ b/clerk-typedoc/shared/get-env-variable.mdx @@ -2,11 +2,11 @@ Retrieves an environment variable across runtime environments. ## Parameters -| Parameter | Type | Description | -| ---------- | --------------------------- | ----------------------------------------------------------- | -| `name` | `string` | The environment variable name to retrieve | -| `context?` | `Record`\<`string`, `any`\> | Optional context object that may contain environment values | +| Parameter | Type | Description | +| ---------- | --------------------------- | ------------------------------------------------------------ | +| `name` | `string` | The environment variable name to retrieve. | +| `context?` | `Record`\<`string`, `any`\> | Optional context object that may contain environment values. | ## Returns -`string` — The environment variable value or empty string if not found +`string` — The environment variable value or empty string if not found. diff --git a/clerk-typedoc/shared/get-suffixed-cookie-name.mdx b/clerk-typedoc/shared/get-suffixed-cookie-name.mdx new file mode 100644 index 0000000000..f4f707d155 --- /dev/null +++ b/clerk-typedoc/shared/get-suffixed-cookie-name.mdx @@ -0,0 +1,13 @@ +Creates a suffixed cookie name by appending the cookie suffix to the base name. +Used to create unique cookie names based on the publishable key. + +## Parameters + +| Parameter | Type | Description | +| -------------- | -------- | -------------------------------------------------------------- | +| `cookieName` | `string` | The base cookie name. | +| `cookieSuffix` | `string` | The suffix to append (typically generated by getCookieSuffix). | + +## Returns + +`string` — The suffixed cookie name in format: `${cookieName}_${cookieSuffix}`. diff --git a/clerk-typedoc/shared/is-development-from-publishable-key.mdx b/clerk-typedoc/shared/is-development-from-publishable-key.mdx new file mode 100644 index 0000000000..6d17f30a7d --- /dev/null +++ b/clerk-typedoc/shared/is-development-from-publishable-key.mdx @@ -0,0 +1,12 @@ +Checks if a publishable key is for a development environment. +Supports both legacy format (test*) and new format (pk_test*). + +## Parameters + +| Parameter | Type | Description | +| --------- | -------- | --------------------- | +| `apiKey` | `string` | The API key to check. | + +## Returns + +`boolean` — `true` if the key is for development, `false` otherwise. diff --git a/clerk-typedoc/shared/is-development-from-secret-key.mdx b/clerk-typedoc/shared/is-development-from-secret-key.mdx new file mode 100644 index 0000000000..6d2785217a --- /dev/null +++ b/clerk-typedoc/shared/is-development-from-secret-key.mdx @@ -0,0 +1,12 @@ +Checks if a secret key is for a development environment. +Supports both legacy format (test*) and new format (sk_test*). + +## Parameters + +| Parameter | Type | Description | +| --------- | -------- | ------------------------ | +| `apiKey` | `string` | The secret key to check. | + +## Returns + +`boolean` — `true` if the key is for development, `false` otherwise. diff --git a/clerk-typedoc/shared/is-production-from-publishable-key.mdx b/clerk-typedoc/shared/is-production-from-publishable-key.mdx new file mode 100644 index 0000000000..8aa8847074 --- /dev/null +++ b/clerk-typedoc/shared/is-production-from-publishable-key.mdx @@ -0,0 +1,12 @@ +Checks if a publishable key is for a production environment. +Supports both legacy format (live*) and new format (pk_live*). + +## Parameters + +| Parameter | Type | Description | +| --------- | -------- | --------------------- | +| `apiKey` | `string` | The API key to check. | + +## Returns + +`boolean` — `true` if the key is for production, `false` otherwise. diff --git a/clerk-typedoc/shared/is-production-from-secret-key.mdx b/clerk-typedoc/shared/is-production-from-secret-key.mdx new file mode 100644 index 0000000000..289067ce0d --- /dev/null +++ b/clerk-typedoc/shared/is-production-from-secret-key.mdx @@ -0,0 +1,12 @@ +Checks if a secret key is for a production environment. +Supports both legacy format (live*) and new format (sk_live*). + +## Parameters + +| Parameter | Type | Description | +| --------- | -------- | ------------------------ | +| `apiKey` | `string` | The secret key to check. | + +## Returns + +`boolean` — `true` if the key is for production, `false` otherwise. diff --git a/clerk-typedoc/shared/load-clerk-js-script.mdx b/clerk-typedoc/shared/load-clerk-js-script.mdx index 80aa9f86b9..8efc3db1bc 100644 --- a/clerk-typedoc/shared/load-clerk-js-script.mdx +++ b/clerk-typedoc/shared/load-clerk-js-script.mdx @@ -1,8 +1,8 @@ -Hotloads the Clerk JS script. +Hotloads the Clerk JS script with robust failure detection. -Checks for an existing Clerk JS script. If found, it returns a promise -that resolves when the script loads. If not found, it uses the provided options to -build the Clerk JS script URL and load the script. +Uses a timeout-based approach to ensure absolute certainty about load success/failure. +If the script fails to load within the timeout period, or loads but doesn't create +a proper Clerk instance, the promise rejects with an error. ## Parameters @@ -12,10 +12,15 @@ build the Clerk JS script URL and load the script. ## Returns -`Promise`\<`unknown`\> +`Promise`\<null \| HTMLScriptElement\> — Promise that resolves with null if Clerk loads successfully, or rejects with an error. ## Example -```ts -loadClerkJsScript({ publishableKey: "pk_" }); +```typescript +try { + await loadClerkJsScript({ publishableKey: "pk_test_..." }); + console.log("Clerk loaded successfully"); +} catch (error) { + console.error("Failed to load Clerk:", error.message); +} ``` diff --git a/clerk-typedoc/shared/pages-or-infinite-options.mdx b/clerk-typedoc/shared/pages-or-infinite-options.mdx index c2a7ab7b9c..69ee82d965 100644 --- a/clerk-typedoc/shared/pages-or-infinite-options.mdx +++ b/clerk-typedoc/shared/pages-or-infinite-options.mdx @@ -1,4 +1,5 @@ -| Property | Type | Description | -| --------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `initialPage?` | `number` | A number that specifies which page to fetch. For example, if `initialPage` is set to 10, it will skip the first 9 pages and fetch the 10th page. Defaults to `1`. | -| `pageSize?` | `number` | A number that specifies the maximum number of results to return per page. Defaults to `10`. | +| Property | Type | Description | +| ------------------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `__experimental_mode?` | `"cache"` | **`Experimental`** On `cache` mode, no request will be triggered when the hook is mounted and the data will be fetched from the cache. Defaults to `undefined`. | +| `initialPage?` | `number` | A number that specifies which page to fetch. For example, if `initialPage` is set to 10, it will skip the first 9 pages and fetch the 10th page. Defaults to `1`. | +| `pageSize?` | `number` | A number that specifies the maximum number of results to return per page. Defaults to `10`. | diff --git a/clerk-typedoc/shared/parse-publishable-key.mdx b/clerk-typedoc/shared/parse-publishable-key.mdx new file mode 100644 index 0000000000..2c9e088ff7 --- /dev/null +++ b/clerk-typedoc/shared/parse-publishable-key.mdx @@ -0,0 +1,47 @@ +Parses and validates a publishable key, extracting the frontend API and instance type. + +## Param + +The publishable key to parse. + +## Param + +Configuration options for parsing. + +## Param + +## Param + +## Param + +## Param + +## Throws + +When options.fatal is true and key is missing or invalid. + +## Call Signature + +### Parameters + +| Parameter | Type | +| --------- | -------------------------------------------------------------- | +| `key` | undefined \| string | +| `options` | `ParsePublishableKeyOptions` & \{ fatal: true; \} | + +### Returns + +`PublishableKey` + +## Call Signature + +### Parameters + +| Parameter | Type | +| ---------- | -------------------------------- | +| `key` | undefined \| string | +| `options?` | `ParsePublishableKeyOptions` | + +### Returns + +null \| PublishableKey diff --git a/clerk-typedoc/shared/set-clerk-js-loading-error-package-name.mdx b/clerk-typedoc/shared/set-clerk-js-loading-error-package-name.mdx index 2a23031f4f..c0d014ec37 100644 --- a/clerk-typedoc/shared/set-clerk-js-loading-error-package-name.mdx +++ b/clerk-typedoc/shared/set-clerk-js-loading-error-package-name.mdx @@ -2,9 +2,9 @@ Sets the package name for error messages during ClerkJS script loading. ## Parameters -| Parameter | Type | -| ------------- | -------- | -| `packageName` | `string` | +| Parameter | Type | Description | +| ------------- | -------- | ------------------------------------------------------------------------------ | +| `packageName` | `string` | The name of the package to use in error messages (e.g., '@clerk/clerk-react'). | ## Returns @@ -12,6 +12,6 @@ Sets the package name for error messages during ClerkJS script loading. ## Example -```ts +```typescript setClerkJsLoadingErrorPackageName("@clerk/clerk-react"); ``` diff --git a/clerk-typedoc/shared/use-organization-return.mdx b/clerk-typedoc/shared/use-organization-return.mdx index 4f8d2f64fc..4d7091e64c 100644 --- a/clerk-typedoc/shared/use-organization-return.mdx +++ b/clerk-typedoc/shared/use-organization-return.mdx @@ -7,4 +7,4 @@ | `membershipRequests` | null \| PaginatedResourcesWithDefault\<[OrganizationMembershipRequestResource](/docs/references/javascript/types/organization-membership-request)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationMembershipRequestResource](/docs/references/javascript/types/organization-membership-request), T\["membershipRequests"\] _extends_ \{ infinite: true; \} ? true : false\> | Includes a paginated list of the organization's membership requests. | | `memberships` | null \| PaginatedResourcesWithDefault\<[OrganizationMembershipResource](/docs/references/javascript/types/organization-membership)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationMembershipResource](/docs/references/javascript/types/organization-membership), T\["memberships"\] _extends_ \{ infinite: true; \} ? true : false\> | Includes a paginated list of the organization's memberships. | | `organization` | undefined \| null \| [OrganizationResource](/docs/references/javascript/organization) | The currently active organization. | -| `subscriptions` | null \| PaginatedResourcesWithDefault\<[CommerceSubscriptionResource](../types/commerce-subscription-resource.mdx)\> \| [PaginatedResources](#paginated-resources)\<[CommerceSubscriptionResource](../types/commerce-subscription-resource.mdx), T\["subscriptions"\] _extends_ \{ infinite: true; \} ? true : false\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. Includes a paginated list of the organization's subscriptions. | +| `subscriptions` | null \| PaginatedResourcesWithDefault\<[CommerceSubscriptionItemResource](../types/commerce-subscription-item-resource.mdx)\> \| [PaginatedResources](#paginated-resources)\<[CommerceSubscriptionItemResource](../types/commerce-subscription-item-resource.mdx), T\["subscriptions"\] _extends_ \{ infinite: true; \} ? true : false\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. Includes a paginated list of the organization's subscriptions. | diff --git a/clerk-typedoc/shared/use-session.mdx b/clerk-typedoc/shared/use-session.mdx index 0cbd556d83..1abbc16b9b 100644 --- a/clerk-typedoc/shared/use-session.mdx +++ b/clerk-typedoc/shared/use-session.mdx @@ -1,12 +1,5 @@ The `useSession()` hook provides access to the current user's [`Session`](/docs/references/javascript/session) object, as well as helpers for setting the active session. -## Parameters - -| Parameter | Type | Description | -| ---------------------------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `options?` | \{ treatPendingAsSignedOut?: boolean; \} | An object containing options for the `useSession()` hook. | -| `options.treatPendingAsSignedOut?` | `boolean` | A boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`. | - ## Returns This function returns a discriminated union type. There are multiple variants of this type available which you can select by clicking on one of the tabs. @@ -17,21 +10,21 @@ This function returns a discriminated union type. There are multiple variants of | ------ | ------ | ------ | | `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | | `isSignedIn` | `undefined` | A boolean that indicates whether a user is currently signed in. | -| `session` | `undefined` | The current active session for the user. | +| `session` | `undefined` | The current session for the user. | | Name | Type | Description | | ------ | ------ | ------ | | `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | | `isSignedIn` | `false` | A boolean that indicates whether a user is currently signed in. | -| `session` | `null` | The current active session for the user. | +| `session` | `null` | The current session for the user. | | Name | Type | Description | | ------ | ------ | ------ | | `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `isSignedIn` | `true` | A boolean that indicates whether a user is currently signed in. | -| `session` | [`SignedInSessionResource`](/docs/references/javascript/session) | The current active session for the user. | +| `isSignedIn` | `boolean` | A boolean that indicates whether a user is currently signed in. | +| `session` | [`SignedInSessionResource`](/docs/references/javascript/session) | The current session for the user. | diff --git a/clerk-typedoc/shared/use-user.mdx b/clerk-typedoc/shared/use-user.mdx index d4aa5afc90..a89b31c4fa 100644 --- a/clerk-typedoc/shared/use-user.mdx +++ b/clerk-typedoc/shared/use-user.mdx @@ -61,17 +61,14 @@ The following example uses the `useUser()` hook to access the [`User`](/docs/ref import { useUser } from "@clerk/clerk-react"; export default function Home() { - const { isLoaded, isSignedIn, user } = useUser(); + const { isLoaded, user } = useUser(); if (!isLoaded) { // Handle loading state return null; } - if (!isSignedIn) { - // Handle signed out state - return null; - } + if (!user) return null; const updateUser = async () => { await user.update({ @@ -99,17 +96,14 @@ export default function Home() { import { useUser } from "@clerk/nextjs"; export default function HomePage() { - const { isLoaded, isSignedIn, user } = useUser(); + const { isLoaded, user } = useUser(); if (!isLoaded) { // Handle loading state return null; } - if (!isSignedIn) { - // Handle signed out state - return null; - } + if (!user) return null; const updateUser = async () => { await user.update({ @@ -142,17 +136,14 @@ The following example uses the `useUser()` hook to access the [`User`](/docs/ref import { useUser } from "@clerk/clerk-react"; export default function Home() { - const { isLoaded, isSignedIn, user } = useUser(); + const { isLoaded, user } = useUser(); if (!isLoaded) { // Handle loading state return null; } - if (!isSignedIn) { - // Handle signed out state - return null; - } + if (!user) return null; const updateUser = async () => { // Update data via an API endpoint @@ -185,17 +176,14 @@ export default function Home() { import { useUser } from "@clerk/nextjs"; export default function HomePage() { - const { isLoaded, isSignedIn, user } = useUser(); + const { isLoaded, user } = useUser(); if (!isLoaded) { // Handle loading state return null; } - if (!isSignedIn) { - // Handle signed out state - return null; - } + if (!user) return null; const updateUser = async () => { // Update data via an API endpoint diff --git a/clerk-typedoc/types/add-payment-source-params.mdx b/clerk-typedoc/types/add-payment-source-params.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/add-payment-source-params.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/cancel-subscription-params.mdx b/clerk-typedoc/types/cancel-subscription-params.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/cancel-subscription-params.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/clerk-api-error.mdx b/clerk-typedoc/types/clerk-api-error.mdx index 89c3d2088d..63a5b74ea7 100644 --- a/clerk-typedoc/types/clerk-api-error.mdx +++ b/clerk-typedoc/types/clerk-api-error.mdx @@ -2,16 +2,23 @@ An interface that represents an error returned by the Clerk API. ## Properties -| Property | Type | Description | -| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | -| `code` | `string` | A string code that represents the error, such as `username_exists_code`. | -| `longMessage?` | `string` | A more detailed message that describes the error. | -| `message` | `string` | A message that describes the error. | -| `meta?` | \{ emailAddresses?: string[]; identifiers?: string[]; paramName?: string; permissions?: string[]; sessionId?: string; zxcvbn?: \{ suggestions: \{ code: string; message: string; \}[]; \}; \} | Additional information about the error. | -| `meta.emailAddresses?` | string[] | - | -| `meta.identifiers?` | string[] | - | -| `meta.paramName?` | `string` | - | -| `meta.permissions?` | string[] | - | -| `meta.sessionId?` | `string` | - | -| `meta.zxcvbn?` | \{ suggestions: \{ code: string; message: string; \}[]; \} | - | -| `meta.zxcvbn.suggestions` | \{ code: string; message: string; \}[] | - | +| Property | Type | Description | +| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | +| `code` | `string` | A string code that represents the error, such as `username_exists_code`. | +| `longMessage?` | `string` | A more detailed message that describes the error. | +| `message` | `string` | A message that describes the error. | +| `meta?` | \{ emailAddresses?: string[]; identifiers?: string[]; isPlanUpgradePossible?: boolean; paramName?: string; permissions?: string[]; plan?: \{ amount_formatted: string; annual_monthly_amount_formatted: string; currency_symbol: string; id: string; name: string; \}; sessionId?: string; zxcvbn?: \{ suggestions: \{ code: string; message: string; \}[]; \}; \} | Additional information about the error. | +| `meta.emailAddresses?` | string[] | - | +| `meta.identifiers?` | string[] | - | +| `meta.isPlanUpgradePossible?` | `boolean` | - | +| `meta.paramName?` | `string` | - | +| `meta.permissions?` | string[] | - | +| `meta.plan?` | \{ amount_formatted: string; annual_monthly_amount_formatted: string; currency_symbol: string; id: string; name: string; \} | - | +| `meta.plan.amount_formatted` | `string` | - | +| `meta.plan.annual_monthly_amount_formatted` | `string` | - | +| `meta.plan.currency_symbol` | `string` | - | +| `meta.plan.id` | `string` | - | +| `meta.plan.name` | `string` | - | +| `meta.sessionId?` | `string` | - | +| `meta.zxcvbn?` | \{ suggestions: \{ code: string; message: string; \}[]; \} | - | +| `meta.zxcvbn.suggestions` | \{ code: string; message: string; \}[] | - | diff --git a/clerk-typedoc/types/clerk-api-response-error.mdx b/clerk-typedoc/types/clerk-api-response-error.mdx new file mode 100644 index 0000000000..b2f65c266d --- /dev/null +++ b/clerk-typedoc/types/clerk-api-response-error.mdx @@ -0,0 +1 @@ +Interface representing a Clerk API Response Error. diff --git a/clerk-typedoc/types/clerk.mdx b/clerk-typedoc/types/clerk.mdx index d33c714f24..a3ec3dbe27 100644 --- a/clerk-typedoc/types/clerk.mdx +++ b/clerk-typedoc/types/clerk.mdx @@ -4,24 +4,28 @@ Main Clerk SDK object. | Property | Type | Description | | ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `__experimental_navigateToTask` | (params?) => Promise\ | **`Experimental`** Navigates to the next task or redirects to completion URL. If the current session has pending tasks, it navigates to the next task. If all tasks are complete, it navigates to the provided completion URL or defaults to the origin redirect URL (either from sign-in or sign-up). | +| `__experimental_checkout` | `__experimental_CheckoutFunction` | **`Experimental`** Checkout API This API is in early access and may change in future releases. | | `__experimental_prefetchOrganizationSwitcher` | () => void | **`Experimental`** Prefetches the data displayed by an organization switcher. It can be used when `mountOrganizationSwitcher({ asStandalone: true})`, to avoid unwanted loading states. This API is still under active development and may change at any moment. | | `__internal_closeCheckout` | () => void | Closes the Clerk Checkout drawer. | | `__internal_closePlanDetails` | () => void | Closes the Clerk PlanDetails drawer. | | `__internal_closeReverification` | () => void | Closes the Clerk user verification modal. | +| `__internal_closeSubscriptionDetails` | () => void | Closes the Clerk SubscriptionDetails drawer. | | `__internal_mountOAuthConsent` | (targetNode, oauthConsentProps?) => void | Mounts a OAuth consent component at the target element. | | `__internal_openCheckout` | (props?) => void | Opens the Clerk Checkout component in a drawer. | -| `__internal_openPlanDetails` | (props?) => void | Opens the Clerk PlanDetails drawer component in a drawer. | +| `__internal_openPlanDetails` | (props) => void | Opens the Clerk PlanDetails drawer component in a drawer. | | `__internal_openReverification` | (props?) => void | Opens the Clerk UserVerification component in a modal. | +| `__internal_openSubscriptionDetails` | (props?) => void | Opens the Clerk SubscriptionDetails drawer component in a drawer. | | `__internal_setActiveInProgress` | `boolean` | Internal flag indicating whether a `setActive` call is in progress. Used to prevent navigations from being initiated outside of the Clerk class. | +| `__internal_state` | undefined \| State | **`Experimental`** This experimental API is subject to change. Entrypoint for Clerk's Signal API containing resource signals along with accessible versions of `computed()` and `effect()` that can be used to subscribe to changes from Signals. | | `__internal_unmountOAuthConsent` | (targetNode) => void | Unmounts a OAuth consent component from the target element. | | `addListener` | (callback) => UnsubscribeCallback | Register a listener that triggers a callback each time important Clerk resources are changed. Allows to hook up at different steps in the sign up, sign in processes. Some important checkpoints: When there is an active session, user === session.user. When there is no active session, user and session will both be null. When a session is loading, user and session will be undefined. | +| `apiKeys` | `APIKeysNamespace` | **`Experimental`** API Keys Object This API is in early access and may change in future releases. | | `authenticateWithCoinbaseWallet` | (params?) => Promise\ | Authenticates user using their Coinbase Smart Wallet and browser extension | | `authenticateWithGoogleOneTap` | (params) => Promise\<[SignInResource](sign-in-resource.mdx) \| [SignUpResource](/docs/references/javascript/sign-up)\> | Authenticates user using a Google token generated from Google identity services. | | `authenticateWithMetamask` | (params?) => Promise\ | Authenticates user using their Metamask browser extension | | `authenticateWithOKXWallet` | (params?) => Promise\ | Authenticates user using their OKX Wallet browser extension | | `authenticateWithWeb3` | (params) => Promise\ | Authenticates user using their Web3 Wallet browser extension | -| `billing` | `CommerceBillingNamespace` | Billing Object | +| `billing` | [`CommerceBillingNamespace`](commerce-billing-namespace.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. **See** /docs/billing/overview It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | | `client` | undefined \| ClientResource | Client handling most Clerk operations. | | `closeCreateOrganization` | () => void | Closes the Clerk CreateOrganization modal. | | `closeGoogleOneTap` | () => void | Opens the Google One Tap component. If the component is not already open, results in a noop. | @@ -42,6 +46,7 @@ Main Clerk SDK object. | `isSignedIn` | `boolean` | Indicates whether the current user has a valid signed-in client session | | `isStandardBrowser` | undefined \| boolean | Clerk flag for loading Clerk in a standard browser setup | | `loaded` | `boolean` | If true the bootstrapping of Clerk.load() has completed successfully. | +| `mountApiKeys` | (targetNode, props?) => void | **`Experimental`** This API is in early access and may change in future releases. Mount a api keys component at the target element. | | `mountCreateOrganization` | (targetNode, props?) => void | Mount a CreateOrganization component at the target element. | | `mountOrganizationList` | (targetNode, props?) => void | Mount an organization list component at the target element. | | `mountOrganizationProfile` | (targetNode, props?) => void | Mount an organization profile component at the target element. | @@ -49,6 +54,7 @@ Main Clerk SDK object. | `mountPricingTable` | (targetNode, props?) => void | Mounts a pricing table component at the target element. | | `mountSignIn` | (targetNode, signInProps?) => void | Mounts a sign in flow component at the target element. | | `mountSignUp` | (targetNode, signUpProps?) => void | Mounts a sign up flow component at the target element. | +| `mountTaskChooseOrganization` | (targetNode, props?) => void | Mounts a TaskChooseOrganization component at the target element. | | `mountUserButton` | (targetNode, userButtonProps?) => void | Mount a user button component at the target element. | | `mountUserProfile` | (targetNode, userProfileProps?) => void | Mount a user profile component at the target element. | | `mountWaitlist` | (targetNode, props?) => void | Mount a waitlist at the target element. | @@ -77,6 +83,7 @@ Main Clerk SDK object. | `setActive` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | Set the active session and organization explicitly. If the session param is `null`, the active session is deleted. In a similar fashion, if the organization param is `null`, the current organization is removed as active. | | `signOut` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | Signs out the current user on single-session instances, or all users on multi-session instances **Param** Optional A callback that runs after sign out completes. **Param** Optional Configuration options, see SignOutOptions | | `status` | "error" \| "loading" \| "ready" \| "degraded" | Describes the state the clerk singleton operates in: - `"error"`: Clerk failed to initialize. - `"loading"`: Clerk is still attempting to load. - `"ready"`: Clerk singleton is fully operational. - `"degraded"`: Clerk singleton is partially operational. | +| `unmountApiKeys` | (targetNode) => void | **`Experimental`** This API is in early access and may change in future releases. Unmount a api keys component from the target element. If there is no component mounted at the target node, results in a noop. | | `unmountCreateOrganization` | (targetNode) => void | Unmount the CreateOrganization component from the target node. | | `unmountOrganizationList` | (targetNode) => void | Unmount the organization list component from the target node.\* | | `unmountOrganizationProfile` | (targetNode) => void | Unmount the organization profile component from the target node. | @@ -84,6 +91,7 @@ Main Clerk SDK object. | `unmountPricingTable` | (targetNode) => void | Unmount a pricing table component from the target element. If there is no component mounted at the target node, results in a noop. | | `unmountSignIn` | (targetNode) => void | Unmount a sign in flow component from the target element. If there is no component mounted at the target node, results in a noop. | | `unmountSignUp` | (targetNode) => void | Unmount a sign up flow component from the target element. If there is no component mounted at the target node, results in a noop. | +| `unmountTaskChooseOrganization` | (targetNode) => void | Unmount a TaskChooseOrganization component from the target element. If there is no component mounted at the target node, results in a noop. | | `unmountUserButton` | (targetNode) => void | Unmount a user button component at the target element. If there is no component mounted at the target node, results in a noop. | | `unmountUserProfile` | (targetNode) => void | Unmount a user profile component at the target element. If there is no component mounted at the target node, results in a noop. | | `unmountWaitlist` | (targetNode) => void | Unmount the Waitlist component from the target node. | diff --git a/clerk-typedoc/types/commerce-billing-namespace.mdx b/clerk-typedoc/types/commerce-billing-namespace.mdx new file mode 100644 index 0000000000..42e67dd105 --- /dev/null +++ b/clerk-typedoc/types/commerce-billing-namespace.mdx @@ -0,0 +1,24 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | +| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `getPaymentAttempt` | (params) => Promise\<[CommercePaymentResource](commerce-payment-resource.mdx)\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `getPaymentAttempts` | (params) => Promise\<[ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\<[CommercePaymentResource](commerce-payment-resource.mdx)\>\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `getPlan` | (params) => Promise\<[CommercePlanResource](commerce-plan-resource.mdx)\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `getPlans` | (params?) => Promise\<[ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\<[CommercePlanResource](commerce-plan-resource.mdx)\>\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `getStatement` | (params) => Promise\<[CommerceStatementResource](commerce-statement-resource.mdx)\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `getStatements` | (params) => Promise\<[ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\<[CommerceStatementResource](commerce-statement-resource.mdx)\>\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `getSubscription` | (params) => Promise\<[CommerceSubscriptionResource](commerce-subscription-resource.mdx)\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| ~~`getSubscriptions`~~ | (params) => Promise\<[ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\<[CommerceSubscriptionItemResource](commerce-subscription-item-resource.mdx)\>\> | **`Experimental`** **Deprecated.** Use `getSubscription` to fetch a single subscription with its items This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `startCheckout` | (params) => Promise\<[CommerceCheckoutResource](commerce-checkout-resource.mdx)\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | diff --git a/clerk-typedoc/types/commerce-checkout-json.mdx b/clerk-typedoc/types/commerce-checkout-json.mdx new file mode 100644 index 0000000000..c865e5ff9e --- /dev/null +++ b/clerk-typedoc/types/commerce-checkout-json.mdx @@ -0,0 +1,26 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------ | -------------------------- | +| `external_client_secret` | `string` | **`Experimental`** | - | +| `external_gateway_id` | `string` | **`Experimental`** | - | +| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | +| `is_immediate_plan_change` | `boolean` | **`Experimental`** | - | +| `object` | `"commerce_checkout"` | **`Experimental`** | `ClerkResourceJSON.object` | +| `payment_source?` | [`CommercePaymentSourceJSON`](commerce-payment-source-json.mdx) | **`Experimental`** | - | +| `plan` | [`CommercePlanJSON`](commerce-plan-json.mdx) | **`Experimental`** | - | +| `plan_period` | [`CommerceSubscriptionPlanPeriod`](commerce-subscription-plan-period.mdx) | **`Experimental`** | - | +| `plan_period_start?` | `number` | **`Experimental`** | - | +| `status` | "completed" \| "needs_confirmation" | **`Experimental`** | - | +| `totals` | [`CommerceCheckoutTotalsJSON`](commerce-checkout-totals-json.mdx) | **`Experimental`** | - | diff --git a/clerk-typedoc/types/commerce-checkout-resource.mdx b/clerk-typedoc/types/commerce-checkout-resource.mdx new file mode 100644 index 0000000000..4b734148bd --- /dev/null +++ b/clerk-typedoc/types/commerce-checkout-resource.mdx @@ -0,0 +1,47 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `confirm` | (params) => Promise\ | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `externalClientSecret` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `externalGatewayId` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `id` | `string` | The unique identifier of the resource. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | +| `isImmediatePlanChange` | `boolean` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `pathRoot` | `string` | The root path of the resource. | - | +| `paymentSource?` | [`CommercePaymentSourceResource`](commerce-payment-source-resource.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `plan` | [`CommercePlanResource`](commerce-plan-resource.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `planPeriod` | [`CommerceSubscriptionPlanPeriod`](commerce-subscription-plan-period.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `planPeriodStart?` | `number` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `status` | "completed" \| "needs_confirmation" | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `totals` | [`CommerceCheckoutTotals`](commerce-checkout-totals.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`CommerceCheckoutResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/clerk-typedoc/types/commerce-checkout-totals-json.mdx b/clerk-typedoc/types/commerce-checkout-totals-json.mdx new file mode 100644 index 0000000000..d915a701e1 --- /dev/null +++ b/clerk-typedoc/types/commerce-checkout-totals-json.mdx @@ -0,0 +1,20 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | +| ------------------------------------------ | ---------------------------------------------- | ------------------ | +| `credit` | [`CommerceMoneyJSON`](commerce-money-json.mdx) | **`Experimental`** | +| `grand_total` | [`CommerceMoneyJSON`](commerce-money-json.mdx) | **`Experimental`** | +| `subtotal` | [`CommerceMoneyJSON`](commerce-money-json.mdx) | **`Experimental`** | +| `tax_total` | [`CommerceMoneyJSON`](commerce-money-json.mdx) | **`Experimental`** | +| `total_due_now` | [`CommerceMoneyJSON`](commerce-money-json.mdx) | **`Experimental`** | diff --git a/clerk-typedoc/types/commerce-checkout-totals.mdx b/clerk-typedoc/types/commerce-checkout-totals.mdx new file mode 100644 index 0000000000..e58b06a516 --- /dev/null +++ b/clerk-typedoc/types/commerce-checkout-totals.mdx @@ -0,0 +1,21 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | +| -------------------------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `credit` | [`CommerceMoney`](commerce-money.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `grandTotal` | [`CommerceMoney`](commerce-money.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `pastDue` | [`CommerceMoney`](commerce-money.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `subtotal` | [`CommerceMoney`](commerce-money.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `taxTotal` | [`CommerceMoney`](commerce-money.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `totalDueNow` | [`CommerceMoney`](commerce-money.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | diff --git a/clerk-typedoc/types/commerce-feature-json.mdx b/clerk-typedoc/types/commerce-feature-json.mdx new file mode 100644 index 0000000000..88ec46c2ae --- /dev/null +++ b/clerk-typedoc/types/commerce-feature-json.mdx @@ -0,0 +1,21 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| -------------------------------------- | -------------------- | ------------------ | -------------------------- | +| `avatar_url` | `string` | **`Experimental`** | - | +| `description` | `string` | **`Experimental`** | - | +| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | +| `name` | `string` | **`Experimental`** | - | +| `object` | `"commerce_feature"` | **`Experimental`** | `ClerkResourceJSON.object` | +| `slug` | `string` | **`Experimental`** | - | diff --git a/clerk-typedoc/types/commerce-feature-resource.mdx b/clerk-typedoc/types/commerce-feature-resource.mdx new file mode 100644 index 0000000000..35eb1e9bdc --- /dev/null +++ b/clerk-typedoc/types/commerce-feature-resource.mdx @@ -0,0 +1,42 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `__internal_toSnapshot` | () => [CommerceFeatureJSON](commerce-feature-json.mdx) | **`Experimental`** | - | +| `avatarUrl` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `description` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `id` | `string` | The unique identifier of the resource. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | +| `name` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `pathRoot` | `string` | The root path of the resource. | - | +| `slug` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`CommerceFeatureResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/clerk-typedoc/types/commerce-initialized-payment-source-json.mdx b/clerk-typedoc/types/commerce-initialized-payment-source-json.mdx new file mode 100644 index 0000000000..ce7ed22307 --- /dev/null +++ b/clerk-typedoc/types/commerce-initialized-payment-source-json.mdx @@ -0,0 +1,20 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| ------------------------------------------------------------ | -------------------------------------- | ------------------ | -------------------------- | +| `external_client_secret` | `string` | **`Experimental`** | - | +| `external_gateway_id` | `string` | **`Experimental`** | - | +| `id` | `string` | **`Experimental`** | - | +| `object` | `"commerce_payment_source_initialize"` | **`Experimental`** | `ClerkResourceJSON.object` | +| `payment_method_order` | string[] | **`Experimental`** | - | diff --git a/clerk-typedoc/types/commerce-initialized-payment-source-resource.mdx b/clerk-typedoc/types/commerce-initialized-payment-source-resource.mdx new file mode 100644 index 0000000000..660d0b7213 --- /dev/null +++ b/clerk-typedoc/types/commerce-initialized-payment-source-resource.mdx @@ -0,0 +1,40 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | +| -------------------------------------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `externalClientSecret` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `externalGatewayId` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `id?` | `string` | The unique identifier of the resource. | +| `pathRoot` | `string` | The root path of the resource. | +| `paymentMethodOrder` | string[] | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`CommerceInitializedPaymentSourceResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/clerk-typedoc/types/commerce-money-json.mdx b/clerk-typedoc/types/commerce-money-json.mdx new file mode 100644 index 0000000000..3799c73988 --- /dev/null +++ b/clerk-typedoc/types/commerce-money-json.mdx @@ -0,0 +1,19 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | +| ------------------------------------------------ | -------- | ------------------ | +| `amount` | `number` | **`Experimental`** | +| `amount_formatted` | `string` | **`Experimental`** | +| `currency` | `string` | **`Experimental`** | +| `currency_symbol` | `string` | **`Experimental`** | diff --git a/clerk-typedoc/types/commerce-money.mdx b/clerk-typedoc/types/commerce-money.mdx new file mode 100644 index 0000000000..b9a4236517 --- /dev/null +++ b/clerk-typedoc/types/commerce-money.mdx @@ -0,0 +1,19 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | +| ---------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | `number` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `amountFormatted` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `currency` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `currencySymbol` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | diff --git a/clerk-typedoc/types/commerce-payer-resource-type.mdx b/clerk-typedoc/types/commerce-payer-resource-type.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/commerce-payer-resource-type.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/commerce-payment-charge-type.mdx b/clerk-typedoc/types/commerce-payment-charge-type.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/commerce-payment-charge-type.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/commerce-payment-json.mdx b/clerk-typedoc/types/commerce-payment-json.mdx new file mode 100644 index 0000000000..3128accb51 --- /dev/null +++ b/clerk-typedoc/types/commerce-payment-json.mdx @@ -0,0 +1,26 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| -------------------------------------------------- | --------------------------------------------------------------------- | ------------------ | -------------------------- | +| `amount` | [`CommerceMoneyJSON`](commerce-money-json.mdx) | **`Experimental`** | - | +| `charge_type` | [`CommercePaymentChargeType`](commerce-payment-charge-type.mdx) | **`Experimental`** | - | +| `failed_at?` | `number` | **`Experimental`** | - | +| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | +| `object` | `"commerce_payment"` | **`Experimental`** | `ClerkResourceJSON.object` | +| `paid_at?` | `number` | **`Experimental`** | - | +| `payment_source` | [`CommercePaymentSourceJSON`](commerce-payment-source-json.mdx) | **`Experimental`** | - | +| `status` | [`CommercePaymentStatus`](commerce-payment-status.mdx) | **`Experimental`** | - | +| `subscription` | [`CommerceSubscriptionItemJSON`](commerce-subscription-item-json.mdx) | **`Experimental`** | - | +| `subscription_item` | [`CommerceSubscriptionItemJSON`](commerce-subscription-item-json.mdx) | **`Experimental`** | - | +| `updated_at` | `number` | **`Experimental`** | - | diff --git a/clerk-typedoc/types/commerce-payment-resource.mdx b/clerk-typedoc/types/commerce-payment-resource.mdx new file mode 100644 index 0000000000..cecc9d37c1 --- /dev/null +++ b/clerk-typedoc/types/commerce-payment-resource.mdx @@ -0,0 +1,46 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| ------------------------------------------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `amount` | [`CommerceMoney`](commerce-money.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `chargeType` | [`CommercePaymentChargeType`](commerce-payment-charge-type.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `failedAt?` | `Date` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `id` | `string` | The unique identifier of the resource. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | +| `paidAt?` | `Date` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `pathRoot` | `string` | The root path of the resource. | - | +| `paymentSource` | [`CommercePaymentSourceResource`](commerce-payment-source-resource.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `status` | [`CommercePaymentStatus`](commerce-payment-status.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| ~~`subscription`~~ | [`CommerceSubscriptionItemResource`](commerce-subscription-item-resource.mdx) | **`Experimental`** **Deprecated.** Use `subscriptionItem` instead. This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `subscriptionItem` | [`CommerceSubscriptionItemResource`](commerce-subscription-item-resource.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `updatedAt` | `Date` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`CommercePaymentResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/clerk-typedoc/types/commerce-payment-source-json.mdx b/clerk-typedoc/types/commerce-payment-source-json.mdx new file mode 100644 index 0000000000..3dac463fd9 --- /dev/null +++ b/clerk-typedoc/types/commerce-payment-source-json.mdx @@ -0,0 +1,24 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| -------------------------------------------- | ------------------------------------------------------------------- | ------------------ | -------------------------- | +| `card_type` | `string` | **`Experimental`** | - | +| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | +| `is_default` | `boolean` | **`Experimental`** | - | +| `is_removable` | `boolean` | **`Experimental`** | - | +| `last4` | `string` | **`Experimental`** | - | +| `object` | `"commerce_payment_source"` | **`Experimental`** | `ClerkResourceJSON.object` | +| `payment_method` | `string` | **`Experimental`** | - | +| `status` | [`CommercePaymentSourceStatus`](commerce-payment-source-status.mdx) | **`Experimental`** | - | +| `wallet_type` | null \| string | **`Experimental`** | - | diff --git a/clerk-typedoc/types/commerce-payment-source-methods.mdx b/clerk-typedoc/types/commerce-payment-source-methods.mdx new file mode 100644 index 0000000000..d3c69c4bfb --- /dev/null +++ b/clerk-typedoc/types/commerce-payment-source-methods.mdx @@ -0,0 +1,18 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | +| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `addPaymentSource` | (params) => Promise\<[CommercePaymentSourceResource](commerce-payment-source-resource.mdx)\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `getPaymentSources` | (params) => Promise\<[ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\<[CommercePaymentSourceResource](commerce-payment-source-resource.mdx)\>\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `initializePaymentSource` | (params) => Promise\<[CommerceInitializedPaymentSourceResource](commerce-initialized-payment-source-resource.mdx)\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | diff --git a/clerk-typedoc/types/commerce-payment-source-resource.mdx b/clerk-typedoc/types/commerce-payment-source-resource.mdx new file mode 100644 index 0000000000..38db54f5f7 --- /dev/null +++ b/clerk-typedoc/types/commerce-payment-source-resource.mdx @@ -0,0 +1,46 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| ------------------------------------------ | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `cardType` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `id` | `string` | The unique identifier of the resource. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | +| `isDefault` | `boolean` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `isRemovable` | `boolean` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `last4` | `string` | **`Experimental`** | - | +| `makeDefault` | (params?) => Promise\ | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `pathRoot` | `string` | The root path of the resource. | - | +| `paymentMethod` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `remove` | (params?) => Promise\ | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `status` | [`CommercePaymentSourceStatus`](commerce-payment-source-status.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `walletType` | undefined \| string | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`CommercePaymentSourceResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/clerk-typedoc/types/commerce-payment-source-status.mdx b/clerk-typedoc/types/commerce-payment-source-status.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/commerce-payment-source-status.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/commerce-payment-status.mdx b/clerk-typedoc/types/commerce-payment-status.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/commerce-payment-status.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/commerce-plan-json.mdx b/clerk-typedoc/types/commerce-plan-json.mdx new file mode 100644 index 0000000000..a4d9eea285 --- /dev/null +++ b/clerk-typedoc/types/commerce-plan-json.mdx @@ -0,0 +1,35 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| ------------------------------------------------------------------------------ | --------------------------------------------------------------- | ------------------ | -------------------------- | +| `amount` | `number` | **`Experimental`** | - | +| `amount_formatted` | `string` | **`Experimental`** | - | +| `annual_amount` | `number` | **`Experimental`** | - | +| `annual_amount_formatted` | `string` | **`Experimental`** | - | +| `annual_monthly_amount` | `number` | **`Experimental`** | - | +| `annual_monthly_amount_formatted` | `string` | **`Experimental`** | - | +| `avatar_url` | `string` | **`Experimental`** | - | +| `currency` | `string` | **`Experimental`** | - | +| `currency_symbol` | `string` | **`Experimental`** | - | +| `description` | `string` | **`Experimental`** | - | +| `features` | [CommerceFeatureJSON](commerce-feature-json.mdx)[] | **`Experimental`** | - | +| `for_payer_type` | [`CommercePayerResourceType`](commerce-payer-resource-type.mdx) | **`Experimental`** | - | +| `has_base_fee` | `boolean` | **`Experimental`** | - | +| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | +| `is_default` | `boolean` | **`Experimental`** | - | +| `is_recurring` | `boolean` | **`Experimental`** | - | +| `name` | `string` | **`Experimental`** | - | +| `object` | `"commerce_plan"` | **`Experimental`** | `ClerkResourceJSON.object` | +| `publicly_visible` | `boolean` | **`Experimental`** | - | +| `slug` | `string` | **`Experimental`** | - | diff --git a/clerk-typedoc/types/commerce-plan-resource.mdx b/clerk-typedoc/types/commerce-plan-resource.mdx new file mode 100644 index 0000000000..1d2fd82e7b --- /dev/null +++ b/clerk-typedoc/types/commerce-plan-resource.mdx @@ -0,0 +1,56 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| ------------------------------------------------------------------------ | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `__internal_toSnapshot` | () => [CommercePlanJSON](commerce-plan-json.mdx) | **`Experimental`** | - | +| `amount` | `number` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `amountFormatted` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `annualAmount` | `number` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `annualAmountFormatted` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `annualMonthlyAmount` | `number` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `annualMonthlyAmountFormatted` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `avatarUrl` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `currency` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `currencySymbol` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `description` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `features` | [CommerceFeatureResource](commerce-feature-resource.mdx)[] | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `forPayerType` | [`CommercePayerResourceType`](commerce-payer-resource-type.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. Specifies the subscriber type this plan is designed for. Each plan is exclusively created for either individual users or organizations, and cannot be used interchangeably. | - | +| `hasBaseFee` | `boolean` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `id` | `string` | The unique identifier of the resource. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | +| `isDefault` | `boolean` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `isRecurring` | `boolean` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `name` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `pathRoot` | `string` | The root path of the resource. | - | +| `publiclyVisible` | `boolean` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `slug` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`CommercePlanResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/clerk-typedoc/types/commerce-product-json.mdx b/clerk-typedoc/types/commerce-product-json.mdx new file mode 100644 index 0000000000..012681c4ea --- /dev/null +++ b/clerk-typedoc/types/commerce-product-json.mdx @@ -0,0 +1,21 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| ------------------------------------ | --------------------------------------------------------- | ------------------ | -------------------------- | +| `currency` | `string` | **`Experimental`** | - | +| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | +| `is_default` | `boolean` | **`Experimental`** | - | +| `object` | `"commerce_product"` | **`Experimental`** | `ClerkResourceJSON.object` | +| `plans` | [CommercePlanJSON](commerce-plan-json.mdx)[] | **`Experimental`** | - | +| `slug` | `string` | **`Experimental`** | - | diff --git a/clerk-typedoc/types/commerce-product-resource.mdx b/clerk-typedoc/types/commerce-product-resource.mdx new file mode 100644 index 0000000000..045ad69697 --- /dev/null +++ b/clerk-typedoc/types/commerce-product-resource.mdx @@ -0,0 +1,41 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `currency` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `id` | `string` | The unique identifier of the resource. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | +| `isDefault` | `boolean` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `pathRoot` | `string` | The root path of the resource. | - | +| `plans` | [CommercePlanResource](commerce-plan-resource.mdx)[] | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `slug` | null \| string | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`CommerceProductResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/clerk-typedoc/types/commerce-statement-group-json.mdx b/clerk-typedoc/types/commerce-statement-group-json.mdx new file mode 100644 index 0000000000..debb37ed03 --- /dev/null +++ b/clerk-typedoc/types/commerce-statement-group-json.mdx @@ -0,0 +1,19 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------- | --------------------------------------------------------------- | ------------------ | -------------------------- | +| `id` | `string` | **`Experimental`** | - | +| `items` | [CommercePaymentJSON](commerce-payment-json.mdx)[] | **`Experimental`** | - | +| `object` | `"commerce_statement_group"` | **`Experimental`** | `ClerkResourceJSON.object` | +| `timestamp` | `number` | **`Experimental`** | - | diff --git a/clerk-typedoc/types/commerce-statement-group.mdx b/clerk-typedoc/types/commerce-statement-group.mdx new file mode 100644 index 0000000000..590ebd9aa9 --- /dev/null +++ b/clerk-typedoc/types/commerce-statement-group.mdx @@ -0,0 +1,17 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | +| ---------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `items` | [CommercePaymentResource](commerce-payment-resource.mdx)[] | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `timestamp` | `Date` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | diff --git a/clerk-typedoc/types/commerce-statement-json.mdx b/clerk-typedoc/types/commerce-statement-json.mdx new file mode 100644 index 0000000000..929a1bd120 --- /dev/null +++ b/clerk-typedoc/types/commerce-statement-json.mdx @@ -0,0 +1,21 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------- | ------------------------------------------------------------------------------ | ------------------ | -------------------------- | +| `groups` | [CommerceStatementGroupJSON](commerce-statement-group-json.mdx)[] | **`Experimental`** | - | +| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | +| `object` | `"commerce_statement"` | **`Experimental`** | `ClerkResourceJSON.object` | +| `status` | [`CommerceStatementStatus`](commerce-statement-status.mdx) | **`Experimental`** | - | +| `timestamp` | `number` | **`Experimental`** | - | +| `totals` | [`CommerceStatementTotalsJSON`](commerce-statement-totals-json.mdx) | **`Experimental`** | - | diff --git a/clerk-typedoc/types/commerce-statement-resource.mdx b/clerk-typedoc/types/commerce-statement-resource.mdx new file mode 100644 index 0000000000..b400e62aa6 --- /dev/null +++ b/clerk-typedoc/types/commerce-statement-resource.mdx @@ -0,0 +1,41 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `groups` | [CommerceStatementGroup](commerce-statement-group.mdx)[] | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `id` | `string` | The unique identifier of the resource. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | +| `pathRoot` | `string` | The root path of the resource. | - | +| `status` | [`CommerceStatementStatus`](commerce-statement-status.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `timestamp` | `Date` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `totals` | [`CommerceStatementTotals`](commerce-statement-totals.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`CommerceStatementResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/clerk-typedoc/types/commerce-statement-status.mdx b/clerk-typedoc/types/commerce-statement-status.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/commerce-statement-status.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/commerce-statement-totals-json.mdx b/clerk-typedoc/types/commerce-statement-totals-json.mdx new file mode 100644 index 0000000000..b83c8a41bc --- /dev/null +++ b/clerk-typedoc/types/commerce-statement-totals-json.mdx @@ -0,0 +1,19 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | +| -------------------------------------- | ---------------------------------------------- | ------------------ | +| `credit` | [`CommerceMoneyJSON`](commerce-money-json.mdx) | **`Experimental`** | +| `grand_total` | [`CommerceMoneyJSON`](commerce-money-json.mdx) | **`Experimental`** | +| `subtotal` | [`CommerceMoneyJSON`](commerce-money-json.mdx) | **`Experimental`** | +| `tax_total` | [`CommerceMoneyJSON`](commerce-money-json.mdx) | **`Experimental`** | diff --git a/clerk-typedoc/types/commerce-statement-totals.mdx b/clerk-typedoc/types/commerce-statement-totals.mdx new file mode 100644 index 0000000000..2f0d367185 --- /dev/null +++ b/clerk-typedoc/types/commerce-statement-totals.mdx @@ -0,0 +1,20 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | +| ------------------------------------ | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `credit` | [`CommerceMoney`](commerce-money.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `grandTotal` | [`CommerceMoney`](commerce-money.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `pastDue` | [`CommerceMoney`](commerce-money.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `subtotal` | [`CommerceMoney`](commerce-money.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | +| `taxTotal` | [`CommerceMoney`](commerce-money.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | diff --git a/clerk-typedoc/types/commerce-subscription-item-json.mdx b/clerk-typedoc/types/commerce-subscription-item-json.mdx new file mode 100644 index 0000000000..9cd7dd848e --- /dev/null +++ b/clerk-typedoc/types/commerce-subscription-item-json.mdx @@ -0,0 +1,29 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| -------------------------------------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -------------------------- | +| `amount?` | [`CommerceMoneyJSON`](commerce-money-json.mdx) | **`Experimental`** | - | +| `canceled_at` | null \| number | **`Experimental`** | - | +| `created_at` | `number` | **`Experimental`** | - | +| `credit?` | \{ amount: [CommerceMoneyJSON](commerce-money-json.mdx); \} | **`Experimental`** | - | +| `credit.amount` | [`CommerceMoneyJSON`](commerce-money-json.mdx) | - | - | +| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | +| `object` | `"commerce_subscription_item"` | **`Experimental`** | `ClerkResourceJSON.object` | +| `past_due_at` | null \| number | **`Experimental`** | - | +| `payment_source_id` | `string` | **`Experimental`** | - | +| `period_end` | null \| number | **`Experimental`** Period end is `null` for subscription items that are on the free plan. | - | +| `period_start` | `number` | **`Experimental`** | - | +| `plan` | [`CommercePlanJSON`](commerce-plan-json.mdx) | **`Experimental`** | - | +| `plan_period` | [`CommerceSubscriptionPlanPeriod`](commerce-subscription-plan-period.mdx) | **`Experimental`** | - | +| `status` | [`CommerceSubscriptionStatus`](commerce-subscription-status.mdx) | **`Experimental`** | - | diff --git a/clerk-typedoc/types/commerce-subscription-item-resource.mdx b/clerk-typedoc/types/commerce-subscription-item-resource.mdx new file mode 100644 index 0000000000..357525ee9f --- /dev/null +++ b/clerk-typedoc/types/commerce-subscription-item-resource.mdx @@ -0,0 +1,50 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `amount?` | [`CommerceMoney`](commerce-money.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `cancel` | (params) => Promise\ | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `canceledAt` | null \| Date | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `createdAt` | `Date` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `credit?` | \{ amount: [CommerceMoney](commerce-money.mdx); \} | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `credit.amount` | [`CommerceMoney`](commerce-money.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `id` | `string` | The unique identifier of the resource. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | +| `pastDueAt` | null \| Date | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `pathRoot` | `string` | The root path of the resource. | - | +| `paymentSourceId` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `periodEnd` | null \| Date | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `periodStart` | `Date` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `plan` | [`CommercePlanResource`](commerce-plan-resource.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `planPeriod` | [`CommerceSubscriptionPlanPeriod`](commerce-subscription-plan-period.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `status` | [`CommerceSubscriptionStatus`](commerce-subscription-status.mdx) | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`CommerceSubscriptionItemResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/clerk-typedoc/types/commerce-subscription-json.mdx b/clerk-typedoc/types/commerce-subscription-json.mdx new file mode 100644 index 0000000000..c657339858 --- /dev/null +++ b/clerk-typedoc/types/commerce-subscription-json.mdx @@ -0,0 +1,26 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------------------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | +| `active_at` | `number` | **`Experimental`** | - | +| `created_at` | `number` | **`Experimental`** | - | +| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | +| `next_payment?` | \{ amount: [CommerceMoneyJSON](commerce-money-json.mdx); date: number; \} | **`Experimental`** Describes the details for the next payment cycle. It is `undefined` for subscription items that are cancelled or on the free plan. | - | +| `next_payment.amount` | [`CommerceMoneyJSON`](commerce-money-json.mdx) | - | - | +| `next_payment.date` | `number` | - | - | +| `object` | `"commerce_subscription"` | **`Experimental`** | `ClerkResourceJSON.object` | +| `past_due_at` | null \| number | **`Experimental`** | - | +| `status` | "active" \| "past_due" | **`Experimental`** Due to the free plan subscription item, the top level subscription can either be `active` or `past_due`. | - | +| `subscription_items` | null \| [CommerceSubscriptionItemJSON](commerce-subscription-item-json.mdx)[] | **`Experimental`** | - | +| `updated_at` | null \| number | **`Experimental`** | - | diff --git a/clerk-typedoc/types/commerce-subscription-plan-period.mdx b/clerk-typedoc/types/commerce-subscription-plan-period.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/commerce-subscription-plan-period.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/commerce-subscription-resource.mdx b/clerk-typedoc/types/commerce-subscription-resource.mdx new file mode 100644 index 0000000000..09a997df19 --- /dev/null +++ b/clerk-typedoc/types/commerce-subscription-resource.mdx @@ -0,0 +1,44 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | Overrides | +| -------------------------------------------------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `activeAt` | `Date` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `createdAt` | `Date` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `id` | `string` | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | +| `nextPayment` | null \| \{ amount: [CommerceMoney](commerce-money.mdx); date: Date; \} | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `pastDueAt` | null \| Date | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. When at least one subscription item is past due, this property will get populated. | - | +| `pathRoot` | `string` | The root path of the resource. | - | +| `status` | "active" \| "past_due" | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. Due to the free plan subscription item, the top level subscription can either be `active` or `past_due`. | - | +| `subscriptionItems` | [CommerceSubscriptionItemResource](commerce-subscription-item-resource.mdx)[] | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `updatedAt` | null \| Date | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`CommerceSubscriptionResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/clerk-typedoc/types/commerce-subscription-status.mdx b/clerk-typedoc/types/commerce-subscription-status.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/commerce-subscription-status.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/confirm-checkout-params.mdx b/clerk-typedoc/types/confirm-checkout-params.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/confirm-checkout-params.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/create-checkout-params.mdx b/clerk-typedoc/types/create-checkout-params.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/create-checkout-params.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/experimental_checkout-button-props.mdx b/clerk-typedoc/types/experimental_checkout-button-props.mdx new file mode 100644 index 0000000000..dd556470b0 --- /dev/null +++ b/clerk-typedoc/types/experimental_checkout-button-props.mdx @@ -0,0 +1,23 @@ +> **\_\_experimental_CheckoutButtonProps** = \{ newSubscriptionRedirectUrl?: string; \} + +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. + +## See + +/docs/billing/overview + +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | +| --------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ | +| `newSubscriptionRedirectUrl?` | `string` | Full URL or path to navigate to after checkout is complete and the user clicks the "Continue" button. Defaults to `undefined`. | diff --git a/clerk-typedoc/types/experimental_plan-details-button-props.mdx b/clerk-typedoc/types/experimental_plan-details-button-props.mdx new file mode 100644 index 0000000000..4a00cab7d4 --- /dev/null +++ b/clerk-typedoc/types/experimental_plan-details-button-props.mdx @@ -0,0 +1,22 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. + +## Type declaration + +| Name | Type | +| -------------------- | -------------------------------------------------------------------------------------------- | +| `initialPlanPeriod?` | [`CommerceSubscriptionPlanPeriod`](commerce-subscription-plan-period.mdx) | +| `planDetailsProps?` | \{ appearance?: PlanDetailTheme; portalId?: string; portalRoot?: PortalRoot; \} | + +## See + +/docs/billing/overview + +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/experimental_subscription-details-button-props.mdx b/clerk-typedoc/types/experimental_subscription-details-button-props.mdx new file mode 100644 index 0000000000..af7d6709b0 --- /dev/null +++ b/clerk-typedoc/types/experimental_subscription-details-button-props.mdx @@ -0,0 +1,23 @@ +> **\_\_experimental_SubscriptionDetailsButtonProps** = \{ for?: [ForPayerType](for-payer-type.mdx); \} + +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. + +## See + +/docs/billing/overview + +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | +| ----------------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `for?` | [`ForPayerType`](for-payer-type.mdx) | The subscriber type to display the subscription details for. If `organization` is provided, the subscription details will be displayed for the active organization. Defaults to `'user'`. | diff --git a/clerk-typedoc/types/for-payer-type.mdx b/clerk-typedoc/types/for-payer-type.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/for-payer-type.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/get-payment-attempts-params.mdx b/clerk-typedoc/types/get-payment-attempts-params.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/get-payment-attempts-params.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/get-payment-sources-params.mdx b/clerk-typedoc/types/get-payment-sources-params.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/get-payment-sources-params.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/get-plans-params.mdx b/clerk-typedoc/types/get-plans-params.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/get-plans-params.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/get-statements-params.mdx b/clerk-typedoc/types/get-statements-params.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/get-statements-params.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/get-subscription-params.mdx b/clerk-typedoc/types/get-subscription-params.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/get-subscription-params.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/get-subscriptions-params.mdx b/clerk-typedoc/types/get-subscriptions-params.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/get-subscriptions-params.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/initialize-payment-source-params.mdx b/clerk-typedoc/types/initialize-payment-source-params.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/initialize-payment-source-params.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/internal_checkout-props.mdx b/clerk-typedoc/types/internal_checkout-props.mdx new file mode 100644 index 0000000000..59a0f5ad51 --- /dev/null +++ b/clerk-typedoc/types/internal_checkout-props.mdx @@ -0,0 +1,23 @@ +> **\_\_internal_CheckoutProps** = \{ newSubscriptionRedirectUrl?: string; \} + +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. + +## See + +/docs/billing/overview + +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | +| --------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------ | +| `newSubscriptionRedirectUrl?` | `string` | Full URL or path to navigate to after checkout is complete and the user clicks the "Continue" button. Defaults to `undefined`. | diff --git a/clerk-typedoc/types/internal_plan-details-props.mdx b/clerk-typedoc/types/internal_plan-details-props.mdx new file mode 100644 index 0000000000..e3190d675d --- /dev/null +++ b/clerk-typedoc/types/internal_plan-details-props.mdx @@ -0,0 +1,24 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. + +## Type declaration + +| Name | Type | +| -------------------- | ------------------------------------------------------------------------- | +| `appearance?` | `PlanDetailTheme` | +| `initialPlanPeriod?` | [`CommerceSubscriptionPlanPeriod`](commerce-subscription-plan-period.mdx) | +| `portalId?` | `string` | +| `portalRoot?` | `PortalRoot` | + +## See + +/docs/billing/overview + +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/internal_subscription-details-props.mdx b/clerk-typedoc/types/internal_subscription-details-props.mdx new file mode 100644 index 0000000000..a1288deb00 --- /dev/null +++ b/clerk-typedoc/types/internal_subscription-details-props.mdx @@ -0,0 +1,23 @@ +> **\_\_internal_SubscriptionDetailsProps** = \{ for?: [ForPayerType](for-payer-type.mdx); \} + +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. + +## See + +/docs/billing/overview + +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` + +## Properties + +| Property | Type | Description | +| ----------------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `for?` | [`ForPayerType`](for-payer-type.mdx) | The subscriber type to display the subscription details for. If `organization` is provided, the subscription details will be displayed for the active organization. Defaults to `'user'`. | diff --git a/clerk-typedoc/types/make-default-payment-source-params.mdx b/clerk-typedoc/types/make-default-payment-source-params.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/make-default-payment-source-params.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/organization-custom-role-key.mdx b/clerk-typedoc/types/organization-custom-role-key.mdx index b73ff20fbf..d3729132f8 100644 --- a/clerk-typedoc/types/organization-custom-role-key.mdx +++ b/clerk-typedoc/types/organization-custom-role-key.mdx @@ -1,3 +1,3 @@ `OrganizationCustomRoleKey` is a type that represents the user's role in an organization. It will be string unless the developer has provided their own types through [`ClerkAuthorization`](/docs/guides/custom-types#example-custom-roles-and-permissions). -Clerk provides the [default roles](/docs/organizations/roles-permissions#default-roles) `org:admin` and `org:member`. However, you can create [custom roles](/docs/organizations/create-roles-permissions) as well. +Clerk provides the [default roles](/docs/organizations/roles-permissions#default-roles) `org:admin` and `org:member`. However, you can create [custom roles](/docs/organizations/roles-permissions#custom-roles) as well. diff --git a/clerk-typedoc/types/organization-resource.mdx b/clerk-typedoc/types/organization-resource.mdx index 4984abf303..61c90acb56 100644 --- a/clerk-typedoc/types/organization-resource.mdx +++ b/clerk-typedoc/types/organization-resource.mdx @@ -4,10 +4,14 @@ To use these methods, you must have the **Organizations** feature [enabled in yo ## Properties -| Property | Type | Description | Overrides | -| -------------------------------- | -------- | -------------------------------------- | ------------------------------------------------------------------- | -| `id` | `string` | The unique identifier of the resource. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | -| `pathRoot` | `string` | The root path of the resource. | - | +| Property | Type | Description | Overrides | +| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `addPaymentSource` | (params) => Promise\<[CommercePaymentSourceResource](commerce-payment-source-resource.mdx)\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `getPaymentSources` | (params) => Promise\<[ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\<[CommercePaymentSourceResource](commerce-payment-source-resource.mdx)\>\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `getSubscriptions` | (params?) => Promise\<[ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\<[CommerceSubscriptionItemResource](commerce-subscription-item-resource.mdx)\>\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. | - | +| `id` | `string` | The unique identifier of the resource. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | +| `initializePaymentSource` | (params) => Promise\<[CommerceInitializedPaymentSourceResource](commerce-initialized-payment-source-resource.mdx)\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `pathRoot` | `string` | The root path of the resource. | - | ## Methods diff --git a/clerk-typedoc/types/payment-gateway.mdx b/clerk-typedoc/types/payment-gateway.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/payment-gateway.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/protect-props.mdx b/clerk-typedoc/types/protect-props.mdx new file mode 100644 index 0000000000..caa5998e83 --- /dev/null +++ b/clerk-typedoc/types/protect-props.mdx @@ -0,0 +1,22 @@ +Props for the `` component, which restricts access to its children based on authentication and authorization. + +Use `ProtectProps` to specify the required role, permission, feature, or plan for access. + +## Example + +```tsx +// Require a specific permission + + +// Require a specific role + + +// Use a custom condition callback + has({ permission: "a_permission_key" })} /> + +// Require a specific feature + + +// Require a specific plan + +``` diff --git a/clerk-typedoc/types/remove-payment-source-params.mdx b/clerk-typedoc/types/remove-payment-source-params.mdx new file mode 100644 index 0000000000..9bd89f7c79 --- /dev/null +++ b/clerk-typedoc/types/remove-payment-source-params.mdx @@ -0,0 +1,10 @@ +**`Experimental`** + +This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. +It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. + +## Example + +```tsx + +``` diff --git a/clerk-typedoc/types/server-get-token-options.mdx b/clerk-typedoc/types/server-get-token-options.mdx new file mode 100644 index 0000000000..a63b221731 --- /dev/null +++ b/clerk-typedoc/types/server-get-token-options.mdx @@ -0,0 +1,10 @@ +> **ServerGetTokenOptions** = \{ expiresInSeconds?: number; template?: string; \} + +Options for retrieving a session token. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `expiresInSeconds?` | `number` | The expiration time for the token in seconds. If provided, the token will expire after the specified number of seconds. Must be a positive integer. | +| `template?` | `string` | The name of a JWT template configured in the Clerk Dashboard. If provided, a JWT will be generated using the specified template. If not provided, the raw session token will be returned. | diff --git a/clerk-typedoc/types/server-get-token.mdx b/clerk-typedoc/types/server-get-token.mdx new file mode 100644 index 0000000000..b0e14e560a --- /dev/null +++ b/clerk-typedoc/types/server-get-token.mdx @@ -0,0 +1,11 @@ +A function that retrieves a session token or JWT template. + +## Parameters + +| Parameter | Type | Description | +| ---------- | ------------------------------------------------------- | ----------------------------------------- | +| `options?` | [`ServerGetTokenOptions`](server-get-token-options.mdx) | Configuration options for token retrieval | + +## Returns + +`Promise`\<string \| null\> — A promise that resolves to the token string, or null if no session exists diff --git a/clerk-typedoc/types/session-task.mdx b/clerk-typedoc/types/session-task.mdx new file mode 100644 index 0000000000..12c0552a25 --- /dev/null +++ b/clerk-typedoc/types/session-task.mdx @@ -0,0 +1,7 @@ +Represents the current pending task of a session. + +## Properties + +| Property | Type | Description | +| ---------------------- | ----------------------- | -------------------------------- | +| `key` | `"choose-organization"` | A unique identifier for the task | diff --git a/clerk-typedoc/types/use-session-return.mdx b/clerk-typedoc/types/use-session-return.mdx index d0c8564778..58f615aad8 100644 --- a/clerk-typedoc/types/use-session-return.mdx +++ b/clerk-typedoc/types/use-session-return.mdx @@ -4,7 +4,7 @@ | ------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------ | | `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | | `isSignedIn` | `undefined` | A boolean that indicates whether a user is currently signed in. | -| `session` | `undefined` | The current active session for the user. | +| `session` | `undefined` | The current session for the user. | | Name | Type | | ------------ | ------- | @@ -15,5 +15,5 @@ | Name | Type | | ------------ | ---------------------------------------------------------------- | | `isLoaded` | `true` | -| `isSignedIn` | `true` | +| `isSignedIn` | `boolean` | | `session` | [`SignedInSessionResource`](/docs/references/javascript/session) | diff --git a/clerk-typedoc/types/user-resource.mdx b/clerk-typedoc/types/user-resource.mdx index 3f91ce04d5..385cf6b953 100644 --- a/clerk-typedoc/types/user-resource.mdx +++ b/clerk-typedoc/types/user-resource.mdx @@ -8,11 +8,14 @@ The ClerkJS SDK provides some helper [methods](#methods) on the `User` object to ## Properties -| Property | Type | Description | Overrides | -| -------------------------------------------- | ---------------------------------- | ------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | `string` | The unique identifier of the resource. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | -| `pathRoot` | `string` | The root path of the resource. | - | -| ~~`samlAccounts`~~ | SamlAccountResource[] | **Deprecated.** Use `enterpriseAccounts` instead. | - | +| Property | Type | Description | Overrides | +| -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `addPaymentSource` | (params) => Promise\<[CommercePaymentSourceResource](commerce-payment-source-resource.mdx)\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `getPaymentSources` | (params) => Promise\<[ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\<[CommercePaymentSourceResource](commerce-payment-source-resource.mdx)\>\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `id` | `string` | The unique identifier of the resource. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | +| `initializePaymentSource` | (params) => Promise\<[CommerceInitializedPaymentSourceResource](commerce-initialized-payment-source-resource.mdx)\> | **`Experimental`** This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to pin the SDK version and the clerk-js version to a specific version to avoid breaking changes. Example: ``. | - | +| `pathRoot` | `string` | The root path of the resource. | - | +| ~~`samlAccounts`~~ | SamlAccountResource[] | **Deprecated.** Use `enterpriseAccounts` instead. | - | ## Methods diff --git a/scripts/extract-typedoc-pages.ts b/scripts/extract-typedoc-pages.ts index 918ff644cd..400e36af90 100644 --- a/scripts/extract-typedoc-pages.ts +++ b/scripts/extract-typedoc-pages.ts @@ -17,7 +17,7 @@ import { visit } from 'unist-util-visit' const processFiles = async (file: readdirp.EntryInfo, changedTypedocFiles: string[]) => { const contents = await fs.readFile(file.fullPath, 'utf8') - let effected = false + const matchedSources = new Set() await remark() .use(remarkFrontmatter) @@ -42,8 +42,8 @@ const processFiles = async (file: readdirp.EntryInfo, changedTypedocFiles: strin return } - if (changedTypedocFiles.includes(src)) { - effected = true + if (typeof src === 'string' && changedTypedocFiles.includes(src)) { + matchedSources.add(src) } }, ) @@ -53,23 +53,38 @@ const processFiles = async (file: readdirp.EntryInfo, changedTypedocFiles: strin value: contents, }) - return effected + return Array.from(matchedSources) } async function main() { - const changedTypedocFiles = process.argv.slice(2).map((file) => file.replace('.mdx', '')) + const argv = process.argv.slice(2) + const withSrc = argv.includes('--with-src') + + const changedTypedocFiles = argv + .filter((arg) => arg !== '--with-src') + .map((file) => file.replace('clerk-typedoc/', '').replace('.mdx', '')) const files = readdirp('docs', { fileFilter: '*.mdx', type: 'files' }) - const effectedFiles = new Set() + const effectedFiles = new Map() for await (const file of files) { - if (await processFiles(file, changedTypedocFiles)) { - effectedFiles.add(file.path) + const matches = await processFiles(file, changedTypedocFiles) + if (matches.length > 0) { + effectedFiles.set(file.path, matches) } } - console.log(Array.from(effectedFiles).join('\n')) + if (withSrc) { + console.log( + Array.from(effectedFiles.entries()) + .map(([docPath, sources]) => `${docPath}\n - ${sources.join('\n - ')}`) + .join('\n'), + ) + } else { + // Backwards-compatible: print only the effected guide paths + console.log(Array.from(effectedFiles.keys()).join('\n')) + } } main()