From 845b750436ed443374eb9276cd1cb5f99b52c80b Mon Sep 17 00:00:00 2001 From: panteliselef Date: Wed, 27 Aug 2025 22:25:29 +0300 Subject: [PATCH 01/22] wip typedocs files --- .gitignore | 2 +- .../docs/backend/allowlist-identifier.mdx | 13 + .typedoc/docs/backend/auth-object.mdx | 8 + .../backend/authenticate-request-options.mdx | 24 ++ .typedoc/docs/backend/client.mdx | 14 + ...rce-payment-attempt-webhook-event-json.mdx | 8 + .typedoc/docs/backend/commerce-plan-json.mdx | 24 ++ .typedoc/docs/backend/commerce-plan.mdx | 68 ++++ .../commerce-subscription-item-json.mdx | 27 ++ ...e-subscription-item-webhook-event-json.mdx | 8 + .../backend/commerce-subscription-item.mdx | 74 ++++ ...mmerce-subscription-webhook-event-json.mdx | 8 + .../docs/backend/commerce-subscription.mdx | 60 ++++ .typedoc/docs/backend/email-address.mdx | 14 + .typedoc/docs/backend/external-account.mdx | 22 ++ .typedoc/docs/backend/get-auth-fn.mdx | 101 ++++++ .typedoc/docs/backend/identification-link.mdx | 8 + .../infer-auth-object-from-token-array.mdx | 5 + .../backend/infer-auth-object-from-token.mdx | 2 + .typedoc/docs/backend/invitation-status.mdx | 0 .typedoc/docs/backend/invitation.mdx | 14 + .typedoc/docs/backend/o-auth-application.mdx | 26 ++ .../organization-invitation-status.mdx | 0 .../docs/backend/organization-invitation.mdx | 19 + ...ganization-membership-public-user-data.mdx | 8 + .../docs/backend/organization-membership.mdx | 15 + .../backend/organization-sync-options.mdx | 8 + .../docs/backend/organization-sync-target.mdx | 2 + .typedoc/docs/backend/organization.mdx | 19 + .../backend/paginated-resource-response.mdx | 14 + .typedoc/docs/backend/phone-number.mdx | 16 + .../backend/public-organization-data-json.mdx | 8 + .typedoc/docs/backend/redirect-url.mdx | 12 + .typedoc/docs/backend/saml-account.mdx | 15 + .typedoc/docs/backend/saml-connection.mdx | 27 ++ .typedoc/docs/backend/session-activity.mdx | 14 + .typedoc/docs/backend/session.mdx | 18 + .typedoc/docs/backend/user.mdx | 47 +++ .typedoc/docs/backend/verification.mdx | 13 + .../backend/verify-machine-auth-token.mdx | 12 + .../docs/backend/verify-token-options.mdx | 11 + .typedoc/docs/backend/verify-token.mdx | 83 +++++ .../docs/backend/verify-webhook-options.mdx | 7 + .typedoc/docs/backend/verify-webhook.mdx | 42 +++ .typedoc/docs/backend/web3-wallet.mdx | 11 + .typedoc/docs/clerk-react/api-keys.mdx | 19 + .../docs/clerk-react/clerk-provider-props.mdx | 43 +++ .typedoc/docs/clerk-react/protect.mdx | 21 ++ .../redirect-to-create-organization.mdx | 13 + .../redirect-to-organization-profile.mdx | 13 + .../clerk-react/redirect-to-user-profile.mdx | 13 + .typedoc/docs/clerk-react/use-auth.mdx | 176 ++++++++++ .typedoc/docs/clerk-react/use-clerk.mdx | 43 +++ .../clerk-react/use-organization-list.mdx | 146 ++++++++ .../docs/clerk-react/use-organization.mdx | 130 +++++++ .../docs/clerk-react/use-reverification.mdx | 54 +++ .../docs/clerk-react/use-session-list.mdx | 77 ++++ .typedoc/docs/clerk-react/use-session.mdx | 89 +++++ .typedoc/docs/clerk-react/use-sign-in.mdx | 73 ++++ .typedoc/docs/clerk-react/use-sign-up.mdx | 73 ++++ .typedoc/docs/clerk-react/use-user.mdx | 208 +++++++++++ .typedoc/docs/nextjs/auth.mdx | 5 + .typedoc/docs/nextjs/build-clerk-props.mdx | 38 ++ .../nextjs/clerk-middleware-auth-object.mdx | 3 + .../docs/nextjs/clerk-middleware-options.mdx | 29 ++ .typedoc/docs/nextjs/clerk-middleware.mdx | 1 + .../docs/nextjs/create-async-get-auth.mdx | 23 ++ .typedoc/docs/nextjs/create-sync-get-auth.mdx | 24 ++ .typedoc/docs/nextjs/current-user.mdx | 25 ++ .typedoc/docs/nextjs/get-auth.mdx | 78 ++++ .../shared/api-url-from-publishable-key.mdx | 12 + .../build-clerk-js-script-attributes.mdx | 11 + .../docs/shared/build-publishable-key.mdx | 11 + .typedoc/docs/shared/camel-to-snake.mdx | 11 + .typedoc/docs/shared/clerk-js-script-url.mdx | 18 + .typedoc/docs/shared/clerk-runtime-error.mdx | 26 ++ .../create-dev-or-staging-url-cache.mdx | 10 + .typedoc/docs/shared/create-path-matcher.mdx | 21 ++ .typedoc/docs/shared/deep-camel-to-snake.mdx | 13 + .typedoc/docs/shared/deep-snake-to-camel.mdx | 13 + .../shared/deprecated-object-property.mdx | 21 ++ .typedoc/docs/shared/derive-state.mdx | 29 ++ .../extract-dev-browser-jwt-from-url.mdx | 13 + .../shared/fast-deep-merge-and-replace.mdx | 14 + .../get-clerk-js-major-version-or-tag.mdx | 14 + .typedoc/docs/shared/get-cookie-suffix.mdx | 13 + .typedoc/docs/shared/get-env-variable.mdx | 12 + .../docs/shared/get-non-undefined-values.mdx | 11 + .typedoc/docs/shared/get-script-url.mdx | 14 + .../docs/shared/get-suffixed-cookie-name.mdx | 13 + .typedoc/docs/shared/icon-image-url.mdx | 13 + .typedoc/docs/shared/in-browser.mdx | 5 + .typedoc/docs/shared/is-browser-online.mdx | 5 + .../docs/shared/is-clerk-runtime-error.mdx | 24 ++ .../is-development-from-publishable-key.mdx | 12 + .../shared/is-development-from-secret-key.mdx | 12 + .typedoc/docs/shared/is-ipv4-address.mdx | 11 + .../is-production-from-publishable-key.mdx | 12 + .../shared/is-production-from-secret-key.mdx | 12 + .typedoc/docs/shared/is-publishable-key.mdx | 11 + .typedoc/docs/shared/is-staging.mdx | 11 + .typedoc/docs/shared/is-truthy.mdx | 11 + .../docs/shared/is-valid-browser-online.mdx | 5 + .typedoc/docs/shared/is-valid-browser.mdx | 5 + .typedoc/docs/shared/isomorphic-atob.mdx | 12 + .typedoc/docs/shared/load-clerk-js-script.mdx | 26 ++ .../docs/shared/pages-or-infinite-options.mdx | 4 + .../docs/shared/paginated-hook-config.mdx | 4 + .typedoc/docs/shared/paginated-resources.mdx | 17 + .../docs/shared/parse-publishable-key.mdx | 47 +++ .typedoc/docs/shared/read-json-file.mdx | 15 + ...et-clerk-js-loading-error-package-name.mdx | 17 + .typedoc/docs/shared/snake-to-camel.mdx | 11 + .typedoc/docs/shared/titleize.mdx | 17 + .typedoc/docs/shared/to-sentence.mdx | 11 + .typedoc/docs/shared/use-clerk.mdx | 43 +++ .../shared/use-organization-list-params.mdx | 5 + .../shared/use-organization-list-return.mdx | 8 + .../docs/shared/use-organization-list.mdx | 146 ++++++++ .../docs/shared/use-organization-params.mdx | 7 + .../docs/shared/use-organization-return.mdx | 10 + .typedoc/docs/shared/use-organization.mdx | 130 +++++++ .typedoc/docs/shared/use-reverification.mdx | 54 +++ .typedoc/docs/shared/use-session-list.mdx | 77 ++++ .typedoc/docs/shared/use-session.mdx | 89 +++++ .typedoc/docs/shared/use-user.mdx | 208 +++++++++++ .typedoc/docs/shared/user-agent-is-robot.mdx | 11 + .typedoc/docs/shared/version-selector.mdx | 17 + .typedoc/docs/types/act-claim.mdx | 1 + .typedoc/docs/types/act-jwt-claim.mdx | 5 + .../docs/types/active-session-resource.mdx | 33 ++ .../docs/types/add-payment-source-params.mdx | 10 + .../docs/types/cancel-subscription-params.mdx | 10 + .../docs/types/check-authorization-fn.mdx | 9 + ...heck-authorization-from-session-claims.mdx | 13 + ...thorization-params-from-session-claims.mdx | 9 + ...-authorization-with-custom-permissions.mdx | 0 .typedoc/docs/types/clerk-api-error.mdx | 24 ++ .../docs/types/clerk-api-response-error.mdx | 1 + .typedoc/docs/types/clerk-host-router.mdx | 1 + .typedoc/docs/types/clerk-jwt-claims.mdx | 28 ++ .../docs/types/clerk-paginated-response.mdx | 11 + .../docs/types/clerk-pagination-params.mdx | 6 + .../docs/types/clerk-pagination-request.mdx | 8 + .typedoc/docs/types/clerk-resource.mdx | 24 ++ .typedoc/docs/types/clerk-status.mdx | 0 .typedoc/docs/types/clerk.mdx | 332 ++++++++++++++++++ .../docs/types/commerce-billing-namespace.mdx | 24 ++ .../docs/types/commerce-checkout-json.mdx | 27 ++ .../docs/types/commerce-checkout-resource.mdx | 48 +++ .../types/commerce-checkout-totals-json.mdx | 20 ++ .../docs/types/commerce-checkout-totals.mdx | 21 ++ .typedoc/docs/types/commerce-feature-json.mdx | 21 ++ .../docs/types/commerce-feature-resource.mdx | 42 +++ ...mmerce-initialized-payment-source-json.mdx | 20 ++ ...ce-initialized-payment-source-resource.mdx | 40 +++ .../docs/types/commerce-money-amount-json.mdx | 19 + .typedoc/docs/types/commerce-money-amount.mdx | 19 + .../types/commerce-payer-resource-type.mdx | 10 + .../types/commerce-payment-charge-type.mdx | 10 + .typedoc/docs/types/commerce-payment-json.mdx | 26 ++ .../docs/types/commerce-payment-resource.mdx | 46 +++ .../types/commerce-payment-source-json.mdx | 24 ++ .../types/commerce-payment-source-methods.mdx | 18 + .../commerce-payment-source-resource.mdx | 46 +++ .../types/commerce-payment-source-status.mdx | 10 + .../docs/types/commerce-payment-status.mdx | 10 + .typedoc/docs/types/commerce-plan-json.mdx | 40 +++ .../docs/types/commerce-plan-resource.mdx | 52 +++ .typedoc/docs/types/commerce-product-json.mdx | 21 ++ .../docs/types/commerce-product-resource.mdx | 41 +++ .../types/commerce-statement-group-json.mdx | 19 + .../docs/types/commerce-statement-group.mdx | 17 + .../docs/types/commerce-statement-json.mdx | 21 ++ .../types/commerce-statement-resource.mdx | 41 +++ .../docs/types/commerce-statement-status.mdx | 10 + .../types/commerce-statement-totals-json.mdx | 19 + .../docs/types/commerce-statement-totals.mdx | 20 ++ .../types/commerce-subscription-item-json.mdx | 30 ++ .../commerce-subscription-item-resource.mdx | 51 +++ .../docs/types/commerce-subscription-json.mdx | 27 ++ .../commerce-subscription-plan-period.mdx | 10 + .../types/commerce-subscription-resource.mdx | 45 +++ .../types/commerce-subscription-status.mdx | 10 + .../docs/types/confirm-checkout-params.mdx | 10 + .../docs/types/create-checkout-params.mdx | 10 + .../docs/types/create-organization-params.mdx | 4 + .typedoc/docs/types/element-object-key.mdx | 1 + .typedoc/docs/types/elements-config.mdx | 3 + .../experimental_checkout-button-props.mdx | 23 ++ ...experimental_plan-details-button-props.mdx | 22 ++ ...ntal_subscription-details-button-props.mdx | 23 ++ .typedoc/docs/types/for-payer-type.mdx | 10 + .../types/get-payment-attempts-params.mdx | 10 + .../docs/types/get-payment-sources-params.mdx | 10 + .typedoc/docs/types/get-plans-params.mdx | 10 + .typedoc/docs/types/get-statements-params.mdx | 10 + .../docs/types/get-subscription-params.mdx | 10 + .../docs/types/get-subscriptions-params.mdx | 10 + .typedoc/docs/types/get-token.mdx | 9 + .typedoc/docs/types/id-selectors.mdx | 1 + .../initialize-payment-source-params.mdx | 10 + .../docs/types/internal_checkout-props.mdx | 23 ++ .../types/internal_plan-details-props.mdx | 24 ++ .../internal_subscription-details-props.mdx | 23 ++ .typedoc/docs/types/jwt-claims.mdx | 27 ++ .typedoc/docs/types/jwt-header.mdx | 3 + .typedoc/docs/types/legacy-redirect-props.mdx | 13 + .typedoc/docs/types/localization-resource.mdx | 13 + .../make-default-payment-source-params.mdx | 10 + .../docs/types/multi-domain-and-or-proxy.mdx | 26 ++ .../types/organization-custom-role-key.mdx | 3 + .../types/organization-domain-resource.mdx | 28 ++ ...rganization-domain-verification-status.mdx | 0 .../types/organization-enrollment-mode.mdx | 0 .../organization-invitation-resource.mdx | 28 ++ .../types/organization-invitation-status.mdx | 0 ...ganization-membership-request-resource.mdx | 28 ++ .../organization-membership-resource.mdx | 28 ++ .../types/organization-permission-key.mdx | 2 + .typedoc/docs/types/organization-resource.mdx | 34 ++ .../organization-suggestion-resource.mdx | 28 ++ .../types/organization-suggestion-status.mdx | 0 .../docs/types/organizations-jwt-claim.mdx | 3 + .typedoc/docs/types/override.mdx | 4 + .typedoc/docs/types/path-value.mdx | 4 + .typedoc/docs/types/payment-gateway.mdx | 10 + .../docs/types/pending-session-options.mdx | 7 + .../docs/types/pending-session-resource.mdx | 32 ++ .typedoc/docs/types/protect-props.mdx | 22 ++ .typedoc/docs/types/record-to-path.mdx | 4 + .typedoc/docs/types/redirect-options.mdx | 2 + .../types/remove-payment-source-params.mdx | 10 + .typedoc/docs/types/reverification-config.mdx | 10 + .typedoc/docs/types/saml-strategy.mdx | 3 + .typedoc/docs/types/sdk-metadata.mdx | 9 + .../docs/types/server-get-token-options.mdx | 10 + .typedoc/docs/types/server-get-token.mdx | 11 + .typedoc/docs/types/session-resource.mdx | 43 +++ .typedoc/docs/types/session-status-claim.mdx | 1 + .typedoc/docs/types/session-task.mdx | 7 + .../docs/types/session-verification-level.mdx | 0 .../docs/types/session-verification-types.mdx | 0 .typedoc/docs/types/set-active-params.mdx | 11 + .typedoc/docs/types/set-active.mdx | 9 + .typedoc/docs/types/sign-in-resource.mdx | 30 ++ .typedoc/docs/types/sign-out.mdx | 24 ++ ...n-up-authenticate-with-metamask-params.mdx | 3 + .typedoc/docs/types/sign-up-resource.mdx | 29 ++ .../docs/types/signed-in-session-resource.mdx | 2 + .typedoc/docs/types/state-selectors.mdx | 1 + .typedoc/docs/types/telemetry-log-entry.mdx | 1 + .typedoc/docs/types/use-auth-return.mdx | 61 ++++ .../docs/types/use-session-list-return.mdx | 13 + .typedoc/docs/types/use-session-return.mdx | 19 + .typedoc/docs/types/use-sign-in-return.mdx | 13 + .typedoc/docs/types/use-sign-up-return.mdx | 13 + .typedoc/docs/types/use-user-return.mdx | 19 + .../user-organization-invitation-resource.mdx | 28 ++ .typedoc/docs/types/user-resource.mdx | 38 ++ .typedoc/docs/types/without.mdx | 1 + 261 files changed, 6336 insertions(+), 1 deletion(-) create mode 100644 .typedoc/docs/backend/allowlist-identifier.mdx create mode 100644 .typedoc/docs/backend/auth-object.mdx create mode 100644 .typedoc/docs/backend/authenticate-request-options.mdx create mode 100644 .typedoc/docs/backend/client.mdx create mode 100644 .typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx create mode 100644 .typedoc/docs/backend/commerce-plan-json.mdx create mode 100644 .typedoc/docs/backend/commerce-plan.mdx create mode 100644 .typedoc/docs/backend/commerce-subscription-item-json.mdx create mode 100644 .typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx create mode 100644 .typedoc/docs/backend/commerce-subscription-item.mdx create mode 100644 .typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx create mode 100644 .typedoc/docs/backend/commerce-subscription.mdx create mode 100644 .typedoc/docs/backend/email-address.mdx create mode 100644 .typedoc/docs/backend/external-account.mdx create mode 100644 .typedoc/docs/backend/get-auth-fn.mdx create mode 100644 .typedoc/docs/backend/identification-link.mdx create mode 100644 .typedoc/docs/backend/infer-auth-object-from-token-array.mdx create mode 100644 .typedoc/docs/backend/infer-auth-object-from-token.mdx create mode 100644 .typedoc/docs/backend/invitation-status.mdx create mode 100644 .typedoc/docs/backend/invitation.mdx create mode 100644 .typedoc/docs/backend/o-auth-application.mdx create mode 100644 .typedoc/docs/backend/organization-invitation-status.mdx create mode 100644 .typedoc/docs/backend/organization-invitation.mdx create mode 100644 .typedoc/docs/backend/organization-membership-public-user-data.mdx create mode 100644 .typedoc/docs/backend/organization-membership.mdx create mode 100644 .typedoc/docs/backend/organization-sync-options.mdx create mode 100644 .typedoc/docs/backend/organization-sync-target.mdx create mode 100644 .typedoc/docs/backend/organization.mdx create mode 100644 .typedoc/docs/backend/paginated-resource-response.mdx create mode 100644 .typedoc/docs/backend/phone-number.mdx create mode 100644 .typedoc/docs/backend/public-organization-data-json.mdx create mode 100644 .typedoc/docs/backend/redirect-url.mdx create mode 100644 .typedoc/docs/backend/saml-account.mdx create mode 100644 .typedoc/docs/backend/saml-connection.mdx create mode 100644 .typedoc/docs/backend/session-activity.mdx create mode 100644 .typedoc/docs/backend/session.mdx create mode 100644 .typedoc/docs/backend/user.mdx create mode 100644 .typedoc/docs/backend/verification.mdx create mode 100644 .typedoc/docs/backend/verify-machine-auth-token.mdx create mode 100644 .typedoc/docs/backend/verify-token-options.mdx create mode 100644 .typedoc/docs/backend/verify-token.mdx create mode 100644 .typedoc/docs/backend/verify-webhook-options.mdx create mode 100644 .typedoc/docs/backend/verify-webhook.mdx create mode 100644 .typedoc/docs/backend/web3-wallet.mdx create mode 100644 .typedoc/docs/clerk-react/api-keys.mdx create mode 100644 .typedoc/docs/clerk-react/clerk-provider-props.mdx create mode 100644 .typedoc/docs/clerk-react/protect.mdx create mode 100644 .typedoc/docs/clerk-react/redirect-to-create-organization.mdx create mode 100644 .typedoc/docs/clerk-react/redirect-to-organization-profile.mdx create mode 100644 .typedoc/docs/clerk-react/redirect-to-user-profile.mdx create mode 100644 .typedoc/docs/clerk-react/use-auth.mdx create mode 100644 .typedoc/docs/clerk-react/use-clerk.mdx create mode 100644 .typedoc/docs/clerk-react/use-organization-list.mdx create mode 100644 .typedoc/docs/clerk-react/use-organization.mdx create mode 100644 .typedoc/docs/clerk-react/use-reverification.mdx create mode 100644 .typedoc/docs/clerk-react/use-session-list.mdx create mode 100644 .typedoc/docs/clerk-react/use-session.mdx create mode 100644 .typedoc/docs/clerk-react/use-sign-in.mdx create mode 100644 .typedoc/docs/clerk-react/use-sign-up.mdx create mode 100644 .typedoc/docs/clerk-react/use-user.mdx create mode 100644 .typedoc/docs/nextjs/auth.mdx create mode 100644 .typedoc/docs/nextjs/build-clerk-props.mdx create mode 100644 .typedoc/docs/nextjs/clerk-middleware-auth-object.mdx create mode 100644 .typedoc/docs/nextjs/clerk-middleware-options.mdx create mode 100644 .typedoc/docs/nextjs/clerk-middleware.mdx create mode 100644 .typedoc/docs/nextjs/create-async-get-auth.mdx create mode 100644 .typedoc/docs/nextjs/create-sync-get-auth.mdx create mode 100644 .typedoc/docs/nextjs/current-user.mdx create mode 100644 .typedoc/docs/nextjs/get-auth.mdx create mode 100644 .typedoc/docs/shared/api-url-from-publishable-key.mdx create mode 100644 .typedoc/docs/shared/build-clerk-js-script-attributes.mdx create mode 100644 .typedoc/docs/shared/build-publishable-key.mdx create mode 100644 .typedoc/docs/shared/camel-to-snake.mdx create mode 100644 .typedoc/docs/shared/clerk-js-script-url.mdx create mode 100644 .typedoc/docs/shared/clerk-runtime-error.mdx create mode 100644 .typedoc/docs/shared/create-dev-or-staging-url-cache.mdx create mode 100644 .typedoc/docs/shared/create-path-matcher.mdx create mode 100644 .typedoc/docs/shared/deep-camel-to-snake.mdx create mode 100644 .typedoc/docs/shared/deep-snake-to-camel.mdx create mode 100644 .typedoc/docs/shared/deprecated-object-property.mdx create mode 100644 .typedoc/docs/shared/derive-state.mdx create mode 100644 .typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx create mode 100644 .typedoc/docs/shared/fast-deep-merge-and-replace.mdx create mode 100644 .typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx create mode 100644 .typedoc/docs/shared/get-cookie-suffix.mdx create mode 100644 .typedoc/docs/shared/get-env-variable.mdx create mode 100644 .typedoc/docs/shared/get-non-undefined-values.mdx create mode 100644 .typedoc/docs/shared/get-script-url.mdx create mode 100644 .typedoc/docs/shared/get-suffixed-cookie-name.mdx create mode 100644 .typedoc/docs/shared/icon-image-url.mdx create mode 100644 .typedoc/docs/shared/in-browser.mdx create mode 100644 .typedoc/docs/shared/is-browser-online.mdx create mode 100644 .typedoc/docs/shared/is-clerk-runtime-error.mdx create mode 100644 .typedoc/docs/shared/is-development-from-publishable-key.mdx create mode 100644 .typedoc/docs/shared/is-development-from-secret-key.mdx create mode 100644 .typedoc/docs/shared/is-ipv4-address.mdx create mode 100644 .typedoc/docs/shared/is-production-from-publishable-key.mdx create mode 100644 .typedoc/docs/shared/is-production-from-secret-key.mdx create mode 100644 .typedoc/docs/shared/is-publishable-key.mdx create mode 100644 .typedoc/docs/shared/is-staging.mdx create mode 100644 .typedoc/docs/shared/is-truthy.mdx create mode 100644 .typedoc/docs/shared/is-valid-browser-online.mdx create mode 100644 .typedoc/docs/shared/is-valid-browser.mdx create mode 100644 .typedoc/docs/shared/isomorphic-atob.mdx create mode 100644 .typedoc/docs/shared/load-clerk-js-script.mdx create mode 100644 .typedoc/docs/shared/pages-or-infinite-options.mdx create mode 100644 .typedoc/docs/shared/paginated-hook-config.mdx create mode 100644 .typedoc/docs/shared/paginated-resources.mdx create mode 100644 .typedoc/docs/shared/parse-publishable-key.mdx create mode 100644 .typedoc/docs/shared/read-json-file.mdx create mode 100644 .typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx create mode 100644 .typedoc/docs/shared/snake-to-camel.mdx create mode 100644 .typedoc/docs/shared/titleize.mdx create mode 100644 .typedoc/docs/shared/to-sentence.mdx create mode 100644 .typedoc/docs/shared/use-clerk.mdx create mode 100644 .typedoc/docs/shared/use-organization-list-params.mdx create mode 100644 .typedoc/docs/shared/use-organization-list-return.mdx create mode 100644 .typedoc/docs/shared/use-organization-list.mdx create mode 100644 .typedoc/docs/shared/use-organization-params.mdx create mode 100644 .typedoc/docs/shared/use-organization-return.mdx create mode 100644 .typedoc/docs/shared/use-organization.mdx create mode 100644 .typedoc/docs/shared/use-reverification.mdx create mode 100644 .typedoc/docs/shared/use-session-list.mdx create mode 100644 .typedoc/docs/shared/use-session.mdx create mode 100644 .typedoc/docs/shared/use-user.mdx create mode 100644 .typedoc/docs/shared/user-agent-is-robot.mdx create mode 100644 .typedoc/docs/shared/version-selector.mdx create mode 100644 .typedoc/docs/types/act-claim.mdx create mode 100644 .typedoc/docs/types/act-jwt-claim.mdx create mode 100644 .typedoc/docs/types/active-session-resource.mdx create mode 100644 .typedoc/docs/types/add-payment-source-params.mdx create mode 100644 .typedoc/docs/types/cancel-subscription-params.mdx create mode 100644 .typedoc/docs/types/check-authorization-fn.mdx create mode 100644 .typedoc/docs/types/check-authorization-from-session-claims.mdx create mode 100644 .typedoc/docs/types/check-authorization-params-from-session-claims.mdx create mode 100644 .typedoc/docs/types/check-authorization-with-custom-permissions.mdx create mode 100644 .typedoc/docs/types/clerk-api-error.mdx create mode 100644 .typedoc/docs/types/clerk-api-response-error.mdx create mode 100644 .typedoc/docs/types/clerk-host-router.mdx create mode 100644 .typedoc/docs/types/clerk-jwt-claims.mdx create mode 100644 .typedoc/docs/types/clerk-paginated-response.mdx create mode 100644 .typedoc/docs/types/clerk-pagination-params.mdx create mode 100644 .typedoc/docs/types/clerk-pagination-request.mdx create mode 100644 .typedoc/docs/types/clerk-resource.mdx create mode 100644 .typedoc/docs/types/clerk-status.mdx create mode 100644 .typedoc/docs/types/clerk.mdx create mode 100644 .typedoc/docs/types/commerce-billing-namespace.mdx create mode 100644 .typedoc/docs/types/commerce-checkout-json.mdx create mode 100644 .typedoc/docs/types/commerce-checkout-resource.mdx create mode 100644 .typedoc/docs/types/commerce-checkout-totals-json.mdx create mode 100644 .typedoc/docs/types/commerce-checkout-totals.mdx create mode 100644 .typedoc/docs/types/commerce-feature-json.mdx create mode 100644 .typedoc/docs/types/commerce-feature-resource.mdx create mode 100644 .typedoc/docs/types/commerce-initialized-payment-source-json.mdx create mode 100644 .typedoc/docs/types/commerce-initialized-payment-source-resource.mdx create mode 100644 .typedoc/docs/types/commerce-money-amount-json.mdx create mode 100644 .typedoc/docs/types/commerce-money-amount.mdx create mode 100644 .typedoc/docs/types/commerce-payer-resource-type.mdx create mode 100644 .typedoc/docs/types/commerce-payment-charge-type.mdx create mode 100644 .typedoc/docs/types/commerce-payment-json.mdx create mode 100644 .typedoc/docs/types/commerce-payment-resource.mdx create mode 100644 .typedoc/docs/types/commerce-payment-source-json.mdx create mode 100644 .typedoc/docs/types/commerce-payment-source-methods.mdx create mode 100644 .typedoc/docs/types/commerce-payment-source-resource.mdx create mode 100644 .typedoc/docs/types/commerce-payment-source-status.mdx create mode 100644 .typedoc/docs/types/commerce-payment-status.mdx create mode 100644 .typedoc/docs/types/commerce-plan-json.mdx create mode 100644 .typedoc/docs/types/commerce-plan-resource.mdx create mode 100644 .typedoc/docs/types/commerce-product-json.mdx create mode 100644 .typedoc/docs/types/commerce-product-resource.mdx create mode 100644 .typedoc/docs/types/commerce-statement-group-json.mdx create mode 100644 .typedoc/docs/types/commerce-statement-group.mdx create mode 100644 .typedoc/docs/types/commerce-statement-json.mdx create mode 100644 .typedoc/docs/types/commerce-statement-resource.mdx create mode 100644 .typedoc/docs/types/commerce-statement-status.mdx create mode 100644 .typedoc/docs/types/commerce-statement-totals-json.mdx create mode 100644 .typedoc/docs/types/commerce-statement-totals.mdx create mode 100644 .typedoc/docs/types/commerce-subscription-item-json.mdx create mode 100644 .typedoc/docs/types/commerce-subscription-item-resource.mdx create mode 100644 .typedoc/docs/types/commerce-subscription-json.mdx create mode 100644 .typedoc/docs/types/commerce-subscription-plan-period.mdx create mode 100644 .typedoc/docs/types/commerce-subscription-resource.mdx create mode 100644 .typedoc/docs/types/commerce-subscription-status.mdx create mode 100644 .typedoc/docs/types/confirm-checkout-params.mdx create mode 100644 .typedoc/docs/types/create-checkout-params.mdx create mode 100644 .typedoc/docs/types/create-organization-params.mdx create mode 100644 .typedoc/docs/types/element-object-key.mdx create mode 100644 .typedoc/docs/types/elements-config.mdx create mode 100644 .typedoc/docs/types/experimental_checkout-button-props.mdx create mode 100644 .typedoc/docs/types/experimental_plan-details-button-props.mdx create mode 100644 .typedoc/docs/types/experimental_subscription-details-button-props.mdx create mode 100644 .typedoc/docs/types/for-payer-type.mdx create mode 100644 .typedoc/docs/types/get-payment-attempts-params.mdx create mode 100644 .typedoc/docs/types/get-payment-sources-params.mdx create mode 100644 .typedoc/docs/types/get-plans-params.mdx create mode 100644 .typedoc/docs/types/get-statements-params.mdx create mode 100644 .typedoc/docs/types/get-subscription-params.mdx create mode 100644 .typedoc/docs/types/get-subscriptions-params.mdx create mode 100644 .typedoc/docs/types/get-token.mdx create mode 100644 .typedoc/docs/types/id-selectors.mdx create mode 100644 .typedoc/docs/types/initialize-payment-source-params.mdx create mode 100644 .typedoc/docs/types/internal_checkout-props.mdx create mode 100644 .typedoc/docs/types/internal_plan-details-props.mdx create mode 100644 .typedoc/docs/types/internal_subscription-details-props.mdx create mode 100644 .typedoc/docs/types/jwt-claims.mdx create mode 100644 .typedoc/docs/types/jwt-header.mdx create mode 100644 .typedoc/docs/types/legacy-redirect-props.mdx create mode 100644 .typedoc/docs/types/localization-resource.mdx create mode 100644 .typedoc/docs/types/make-default-payment-source-params.mdx create mode 100644 .typedoc/docs/types/multi-domain-and-or-proxy.mdx create mode 100644 .typedoc/docs/types/organization-custom-role-key.mdx create mode 100644 .typedoc/docs/types/organization-domain-resource.mdx create mode 100644 .typedoc/docs/types/organization-domain-verification-status.mdx create mode 100644 .typedoc/docs/types/organization-enrollment-mode.mdx create mode 100644 .typedoc/docs/types/organization-invitation-resource.mdx create mode 100644 .typedoc/docs/types/organization-invitation-status.mdx create mode 100644 .typedoc/docs/types/organization-membership-request-resource.mdx create mode 100644 .typedoc/docs/types/organization-membership-resource.mdx create mode 100644 .typedoc/docs/types/organization-permission-key.mdx create mode 100644 .typedoc/docs/types/organization-resource.mdx create mode 100644 .typedoc/docs/types/organization-suggestion-resource.mdx create mode 100644 .typedoc/docs/types/organization-suggestion-status.mdx create mode 100644 .typedoc/docs/types/organizations-jwt-claim.mdx create mode 100644 .typedoc/docs/types/override.mdx create mode 100644 .typedoc/docs/types/path-value.mdx create mode 100644 .typedoc/docs/types/payment-gateway.mdx create mode 100644 .typedoc/docs/types/pending-session-options.mdx create mode 100644 .typedoc/docs/types/pending-session-resource.mdx create mode 100644 .typedoc/docs/types/protect-props.mdx create mode 100644 .typedoc/docs/types/record-to-path.mdx create mode 100644 .typedoc/docs/types/redirect-options.mdx create mode 100644 .typedoc/docs/types/remove-payment-source-params.mdx create mode 100644 .typedoc/docs/types/reverification-config.mdx create mode 100644 .typedoc/docs/types/saml-strategy.mdx create mode 100644 .typedoc/docs/types/sdk-metadata.mdx create mode 100644 .typedoc/docs/types/server-get-token-options.mdx create mode 100644 .typedoc/docs/types/server-get-token.mdx create mode 100644 .typedoc/docs/types/session-resource.mdx create mode 100644 .typedoc/docs/types/session-status-claim.mdx create mode 100644 .typedoc/docs/types/session-task.mdx create mode 100644 .typedoc/docs/types/session-verification-level.mdx create mode 100644 .typedoc/docs/types/session-verification-types.mdx create mode 100644 .typedoc/docs/types/set-active-params.mdx create mode 100644 .typedoc/docs/types/set-active.mdx create mode 100644 .typedoc/docs/types/sign-in-resource.mdx create mode 100644 .typedoc/docs/types/sign-out.mdx create mode 100644 .typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx create mode 100644 .typedoc/docs/types/sign-up-resource.mdx create mode 100644 .typedoc/docs/types/signed-in-session-resource.mdx create mode 100644 .typedoc/docs/types/state-selectors.mdx create mode 100644 .typedoc/docs/types/telemetry-log-entry.mdx create mode 100644 .typedoc/docs/types/use-auth-return.mdx create mode 100644 .typedoc/docs/types/use-session-list-return.mdx create mode 100644 .typedoc/docs/types/use-session-return.mdx create mode 100644 .typedoc/docs/types/use-sign-in-return.mdx create mode 100644 .typedoc/docs/types/use-sign-up-return.mdx create mode 100644 .typedoc/docs/types/use-user-return.mdx create mode 100644 .typedoc/docs/types/user-organization-invitation-resource.mdx create mode 100644 .typedoc/docs/types/user-resource.mdx create mode 100644 .typedoc/docs/types/without.mdx diff --git a/.gitignore b/.gitignore index dd5f9738fb7..082710d3a61 100644 --- a/.gitignore +++ b/.gitignore @@ -97,5 +97,5 @@ scripts/.env !scripts/.env.example # typedoc -.typedoc/docs +# .typedoc/docs .typedoc/docs.json diff --git a/.typedoc/docs/backend/allowlist-identifier.mdx b/.typedoc/docs/backend/allowlist-identifier.mdx new file mode 100644 index 00000000000..bb250e6833a --- /dev/null +++ b/.typedoc/docs/backend/allowlist-identifier.mdx @@ -0,0 +1,13 @@ +The Backend `AllowlistIdentifier` object represents an identifier that has been added to the allowlist of your application. The Backend `AllowlistIdentifier` object is used in the [Backend API](/docs/reference/backend-api/tag/Allow-list-Block-list#operation/ListAllowlistIdentifiers) and is not directly accessible from the Frontend API. + +## Properties + +| Property | Type | Description | +| -------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `createdAt` | `number` | The date when the allowlist identifier was first created. | +| `id` | `string` | A unique ID for the allowlist identifier. | +| `identifier` | `string` | The [identifier](/docs/authentication/configuration/sign-up-sign-in-options#identifiers) that was added to the allowlist. | +| `identifierType` | "email_address" \| "phone_number" \| "web3_wallet" | The type of the allowlist identifier. | +| `instanceId?` | `string` | The ID of the instance that this allowlist identifier belongs to. | +| `invitationId?` | `string` | The ID of the invitation sent to the identifier. | +| `updatedAt` | `number` | The date when the allowlist identifier was last updated. | diff --git a/.typedoc/docs/backend/auth-object.mdx b/.typedoc/docs/backend/auth-object.mdx new file mode 100644 index 00000000000..06d1716405b --- /dev/null +++ b/.typedoc/docs/backend/auth-object.mdx @@ -0,0 +1,8 @@ +## Properties + +| 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/.typedoc/docs/backend/authenticate-request-options.mdx b/.typedoc/docs/backend/authenticate-request-options.mdx new file mode 100644 index 00000000000..b28fe984305 --- /dev/null +++ b/.typedoc/docs/backend/authenticate-request-options.mdx @@ -0,0 +1,24 @@ +| 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/.typedoc/docs/backend/client.mdx b/.typedoc/docs/backend/client.mdx new file mode 100644 index 00000000000..f9c1d5dc0d9 --- /dev/null +++ b/.typedoc/docs/backend/client.mdx @@ -0,0 +1,14 @@ +The Backend `Client` object is similar to the [`Client`](/docs/references/javascript/client) object as it holds information about the authenticated sessions in the current device. However, the Backend `Client` object is different from the `Client` object in that it is used in the [Backend API](/docs/reference/backend-api/tag/Clients#operation/GetClient) and is not directly accessible from the Frontend API. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------------ | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- | +| `createdAt` | `number` | The date when the `Client` was first created. | +| `id` | `string` | The unique identifier for the `Client`. | +| `lastActiveSessionId` | null \| string | The ID of the last active [Session](/docs/references/backend/types/backend-session). | +| `sessionIds` | string[] | An array of [Session](/docs/references/backend/types/backend-session){{ target: '_blank' }} IDs associated with the `Client`. | +| `sessions` | [Session](/docs/references/backend/types/backend-session)[] | An array of [Session](/docs/references/backend/types/backend-session){{ target: '_blank' }} objects associated with the `Client`. | +| `signInId` | null \| string | The ID of the [`SignIn`](/docs/references/javascript/sign-in){{ target: '_blank' }}. | +| `signUpId` | null \| string | The ID of the [`SignUp`](/docs/references/javascript/sign-up){{ target: '_blank' }}. | +| `updatedAt` | `number` | The date when the `Client` was last updated. | diff --git a/.typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx b/.typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx new file mode 100644 index 00000000000..5cf86956ee7 --- /dev/null +++ b/.typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx @@ -0,0 +1,8 @@ +Webhooks specific interface for CommercePaymentAttempt. + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------- | ---------------------------- | --------------------------------------- | -------------------------- | +| `id` | `string` | The unique identifier for the resource. | - | +| `object` | `"commerce_payment_attempt"` | The type of the resource. | `ClerkResourceJSON.object` | diff --git a/.typedoc/docs/backend/commerce-plan-json.mdx b/.typedoc/docs/backend/commerce-plan-json.mdx new file mode 100644 index 00000000000..da74022198c --- /dev/null +++ b/.typedoc/docs/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` | `CommerceMoneyAmountJSON` | **`Experimental`** | - | +| `annual_monthly_fee` | `CommerceMoneyAmountJSON` | **`Experimental`** | - | +| `description?` | `string` | **`Experimental`** | - | +| `features` | FeatureJSON[] | **`Experimental`** | - | +| `fee` | `CommerceMoneyAmountJSON` | **`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/.typedoc/docs/backend/commerce-plan.mdx b/.typedoc/docs/backend/commerce-plan.mdx new file mode 100644 index 00000000000..f43e80be19f --- /dev/null +++ b/.typedoc/docs/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` | `CommerceMoneyAmount` | The monthly fee of the plan. | +| `annualFee` | `CommerceMoneyAmount` | The annual fee of the plan. | +| `annualMonthlyFee` | `CommerceMoneyAmount` | 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` | `CommerceMoneyAmount` | **`Experimental`** The annual fee of the plan. | +| `annualMonthlyFee` | `CommerceMoneyAmount` | **`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` | `CommerceMoneyAmount` | **`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/.typedoc/docs/backend/commerce-subscription-item-json.mdx b/.typedoc/docs/backend/commerce-subscription-item-json.mdx new file mode 100644 index 00000000000..adb3ec596ea --- /dev/null +++ b/.typedoc/docs/backend/commerce-subscription-item-json.mdx @@ -0,0 +1,27 @@ +**`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 | +| ------------------------------------------- | -------------------------------------------------------- | ---------------------------------------------------------- | -------------------------- | +| `amount` | null \| CommerceMoneyAmountJSON | **`Experimental`** | - | +| `canceled_at` | null \| number | **`Experimental`** | - | +| `created_at` | `number` | **`Experimental`** | - | +| `ended_at` | null \| number | **`Experimental`** | - | +| `id` | `string` | **`Experimental`** The unique identifier for the resource. | - | +| `is_free_trial?` | `boolean` | **`Experimental`** | - | +| `lifetime_paid` | `CommerceMoneyAmountJSON` | **`Experimental`** | - | +| `next_payment` | null \| \{ amount: number; date: number; \} | **`Experimental`** | - | +| `object` | `"commerce_subscription_item"` | **`Experimental`** The type of the resource. | `ClerkResourceJSON.object` | +| `past_due_at` | null \| number | **`Experimental`** | - | +| `payer_id` | `string` | **`Experimental`** | - | +| `period_end` | null \| number | **`Experimental`** | - | +| `period_start` | `number` | **`Experimental`** | - | +| `plan` | [`CommercePlanJSON`](commerce-plan-json.mdx) | **`Experimental`** | - | +| `plan_id` | `string` | **`Experimental`** | - | +| `plan_period` | "month" \| "annual" | **`Experimental`** | - | +| `status` | `CommerceSubscriptionItemStatus` | **`Experimental`** | - | +| `updated_at` | `number` | **`Experimental`** | - | diff --git a/.typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx b/.typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx new file mode 100644 index 00000000000..103e78c0efe --- /dev/null +++ b/.typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx @@ -0,0 +1,8 @@ +Webhooks specific interface for CommerceSubscriptionItem. + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------- | ------------------------------ | --------------------------------------- | -------------------------- | +| `id` | `string` | The unique identifier for the resource. | - | +| `object` | `"commerce_subscription_item"` | The type of the resource. | `ClerkResourceJSON.object` | diff --git a/.typedoc/docs/backend/commerce-subscription-item.mdx b/.typedoc/docs/backend/commerce-subscription-item.mdx new file mode 100644 index 00000000000..152a89b9219 --- /dev/null +++ b/.typedoc/docs/backend/commerce-subscription-item.mdx @@ -0,0 +1,74 @@ +**`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 subscription item. | +| `status` | `CommerceSubscriptionItemStatus` | The status of the subscription item. | +| `planPeriod` | "month" \| "annual" | The plan period for the subscription item. | +| `periodStart` | `number` | The start of the current period. | +| `nextPayment` | null \| \{ amount: number; date: number; \} | The next payment information. | +| `amount` | undefined \| null \| CommerceMoneyAmount | The current amount for the subscription item. | +| `plan` | [`CommercePlan`](commerce-plan.mdx) | The plan associated with this subscription item. | +| `planId` | `string` | The plan ID. | +| `createdAt` | `number` | The date and time the subscription item was created. | +| `updatedAt` | `number` | The date and time the subscription item was last updated. | +| `periodEnd` | null \| number | The end of the current period. | +| `canceledAt` | null \| number | When the subscription item was canceled. | +| `pastDueAt` | null \| number | When the subscription item became past due. | +| `endedAt` | null \| number | When the subscription item ended. | +| `payerId` | `string` | The payer ID. | +| `isFreeTrial?` | `boolean` | Whether this subscription item is currently in a free trial period. | +| `lifetimePaid?` | null \| CommerceMoneyAmount | The lifetime amount paid for this subscription item. | + +#### Returns + +`CommerceSubscriptionItem` + +## Properties + +| Property | Type | Description | +| ----------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `amount` | undefined \| null \| CommerceMoneyAmount | **`Experimental`** The current amount for the subscription item. | +| `canceledAt` | null \| number | **`Experimental`** When the subscription item was canceled. | +| `createdAt` | `number` | **`Experimental`** The date and time the subscription item was created. | +| `endedAt` | null \| number | **`Experimental`** When the subscription item ended. | +| `id` | `string` | **`Experimental`** The unique identifier for the subscription item. | +| `isFreeTrial?` | `boolean` | **`Experimental`** Whether this subscription item is currently in a free trial period. | +| `lifetimePaid?` | null \| CommerceMoneyAmount | **`Experimental`** The lifetime amount paid for this subscription item. | +| `nextPayment` | null \| \{ amount: number; date: number; \} | **`Experimental`** The next payment information. | +| `pastDueAt` | null \| number | **`Experimental`** When the subscription item became past due. | +| `payerId` | `string` | **`Experimental`** The payer ID. | +| `periodEnd` | null \| number | **`Experimental`** The end of the current period. | +| `periodStart` | `number` | **`Experimental`** The start of the current period. | +| `plan` | [`CommercePlan`](commerce-plan.mdx) | **`Experimental`** The plan associated with this subscription item. | +| `planId` | `string` | **`Experimental`** The plan ID. | +| `planPeriod` | "month" \| "annual" | **`Experimental`** The plan period for the subscription item. | +| `status` | `CommerceSubscriptionItemStatus` | **`Experimental`** The status of the subscription item. | +| `updatedAt` | `number` | **`Experimental`** The date and time the subscription item was last updated. | + +## Methods + +### fromJSON() + +**`Experimental`** + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------- | +| `data` | [`CommerceSubscriptionItemJSON`](commerce-subscription-item-json.mdx) | + +#### Returns + +`CommerceSubscriptionItem` diff --git a/.typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx b/.typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx new file mode 100644 index 00000000000..587f9b985a1 --- /dev/null +++ b/.typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx @@ -0,0 +1,8 @@ +Webhooks specific interface for CommerceSubscription. + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------- | ------------------------- | --------------------------------------- | -------------------------- | +| `id` | `string` | The unique identifier for the resource. | - | +| `object` | `"commerce_subscription"` | The type of the resource. | `ClerkResourceJSON.object` | diff --git a/.typedoc/docs/backend/commerce-subscription.mdx b/.typedoc/docs/backend/commerce-subscription.mdx new file mode 100644 index 00000000000..9343e46b5f0 --- /dev/null +++ b/.typedoc/docs/backend/commerce-subscription.mdx @@ -0,0 +1,60 @@ +**`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 commerce subscription. | +| `status` | "abandoned" \| "active" \| "ended" \| "canceled" \| "incomplete" \| "past_due" | The current status of the subscription. | +| `payerId` | `string` | The ID of the payer for this subscription. | +| `createdAt` | `number` | Unix timestamp (milliseconds) of creation. | +| `updatedAt` | `number` | Unix timestamp (milliseconds) of last update. | +| `activeAt` | null \| number | Unix timestamp (milliseconds) when the subscription became active. | +| `pastDueAt` | null \| number | Unix timestamp (milliseconds) when the subscription became past due. | +| `subscriptionItems` | [CommerceSubscriptionItem](commerce-subscription-item.mdx)[] | Array of subscription items in this subscription. | +| `nextPayment` | null \| \{ amount: CommerceMoneyAmount; date: number; \} | Information about the next scheduled payment. | +| `eligibleForFreeTrial` | `boolean` | Whether the payer is eligible for a free trial. | + +#### Returns + +`CommerceSubscription` + +## Properties + +| Property | Type | Description | +| -------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `activeAt` | null \| number | **`Experimental`** Unix timestamp (milliseconds) when the subscription became active. | +| `createdAt` | `number` | **`Experimental`** Unix timestamp (milliseconds) of creation. | +| `eligibleForFreeTrial` | `boolean` | **`Experimental`** Whether the payer is eligible for a free trial. | +| `id` | `string` | **`Experimental`** The unique identifier for the commerce subscription. | +| `nextPayment` | null \| \{ amount: CommerceMoneyAmount; date: number; \} | **`Experimental`** Information about the next scheduled payment. | +| `pastDueAt` | null \| number | **`Experimental`** Unix timestamp (milliseconds) when the subscription became past due. | +| `payerId` | `string` | **`Experimental`** The ID of the payer for this subscription. | +| `status` | "abandoned" \| "active" \| "ended" \| "canceled" \| "incomplete" \| "past_due" | **`Experimental`** The current status of the subscription. | +| `subscriptionItems` | [CommerceSubscriptionItem](commerce-subscription-item.mdx)[] | **`Experimental`** Array of subscription items in this subscription. | +| `updatedAt` | `number` | **`Experimental`** Unix timestamp (milliseconds) of last update. | + +## Methods + +### fromJSON() + +**`Experimental`** + +#### Parameters + +| Parameter | Type | +| --------- | -------------------------- | +| `data` | `CommerceSubscriptionJSON` | + +#### Returns + +`CommerceSubscription` diff --git a/.typedoc/docs/backend/email-address.mdx b/.typedoc/docs/backend/email-address.mdx new file mode 100644 index 00000000000..f4ddfe2caf9 --- /dev/null +++ b/.typedoc/docs/backend/email-address.mdx @@ -0,0 +1,14 @@ +The Backend `EmailAddress` object is a model around an email address. Email addresses are one of the [identifiers](/docs/authentication/configuration/sign-up-sign-in-options#identifiers) used to provide identification for users. + +Email addresses must be **verified** to ensure that they are assigned to their rightful owners. The `EmailAddress` object holds all necessary state around the verification process. + +For implementation examples for adding and verifying email addresses, see the [email link custom flow](/docs/custom-flows/email-links) and [email code custom flow](/docs/custom-flows/add-email) guides. + +## Properties + +| Property | Type | Description | +| ---------------------------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `emailAddress` | `string` | The value of the email address. | +| `id` | `string` | The unique identifier for the email address. | +| `linkedTo` | [IdentificationLink](/docs/references/backend/types/backend-identification-link)[] | An array of objects containing information about any identifications that might be linked to the email address. | +| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of the email address. | diff --git a/.typedoc/docs/backend/external-account.mdx b/.typedoc/docs/backend/external-account.mdx new file mode 100644 index 00000000000..278b9fdae4d --- /dev/null +++ b/.typedoc/docs/backend/external-account.mdx @@ -0,0 +1,22 @@ +The Backend `ExternalAccount` object is a model around an identification obtained by an external provider (e.g. a social provider such as Google). + +External account must be verified, so that you can make sure they can be assigned to their rightful owners. The `ExternalAccount` object holds all necessary state around the verification process. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------ | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `approvedScopes` | `string` | The scopes that the user has granted access to. | +| `emailAddress` | `string` | The user's email address. | +| `externalId` | `string` | The unique ID of the user in the provider. | +| `firstName` | `string` | The user's first name. | +| `id` | `string` | The unique identifier for this external account. | +| `identificationId` | `string` | The identification with which this external account is associated. | +| `imageUrl` | `string` | The user's image URL. | +| `label` | null \| string | A descriptive label to differentiate multiple external accounts of the same user for the same provider. | +| `lastName` | `string` | The user's last name. | +| `phoneNumber` | null \| string | The phone number related to this specific external account. | +| `provider` | `string` | The provider name (e.g., `google`). | +| `publicMetadata` | null \| Record\ | Metadata that can be read from the Frontend API and Backend API and can be set only from the Backend API. | +| `username` | null \| string | The user's username. | +| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of this external account. | diff --git a/.typedoc/docs/backend/get-auth-fn.mdx b/.typedoc/docs/backend/get-auth-fn.mdx new file mode 100644 index 00000000000..d069f7df58b --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/backend/identification-link.mdx b/.typedoc/docs/backend/identification-link.mdx new file mode 100644 index 00000000000..5ed1b59fce1 --- /dev/null +++ b/.typedoc/docs/backend/identification-link.mdx @@ -0,0 +1,8 @@ +Contains information about any identifications that might be linked to the email address. + +## Properties + +| Property | Type | Description | +| ------------------------ | -------- | ------------------------------------------------------------------------------------ | +| `id` | `string` | The unique identifier for the identification link. | +| `type` | `string` | The type of the identification link, e.g., `"email_address"`, `"phone_number"`, etc. | diff --git a/.typedoc/docs/backend/infer-auth-object-from-token-array.mdx b/.typedoc/docs/backend/infer-auth-object-from-token-array.mdx new file mode 100644 index 00000000000..a7421ad97d0 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/backend/infer-auth-object-from-token.mdx b/.typedoc/docs/backend/infer-auth-object-from-token.mdx new file mode 100644 index 00000000000..09a78f383a0 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/backend/invitation-status.mdx b/.typedoc/docs/backend/invitation-status.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/backend/invitation.mdx b/.typedoc/docs/backend/invitation.mdx new file mode 100644 index 00000000000..f7581ba48cd --- /dev/null +++ b/.typedoc/docs/backend/invitation.mdx @@ -0,0 +1,14 @@ +The Backend `Invitation` object represents an invitation to join your application. + +## Properties + +| Property | Type | Description | +| -------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `createdAt` | `number` | The date when the `Invitation` was first created. | +| `emailAddress` | `string` | The email address that the invitation was sent to. | +| `id` | `string` | The unique identifier for the `Invitation`. | +| `publicMetadata` | null \| Record\ | [Metadata](/docs/references/javascript/types/metadata#user-public-metadata){{ target: '_blank' }} that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. Once the user accepts the invitation and signs up, these metadata will end up in the user's public metadata. | +| `revoked?` | `boolean` | Whether the `Invitation` has been revoked. | +| `status` | "expired" \| "revoked" \| "pending" \| "accepted" | The status of the `Invitation`. | +| `updatedAt` | `number` | The date when the `Invitation` was last updated. | +| `url?` | `string` | The URL that the user can use to accept the invitation. | diff --git a/.typedoc/docs/backend/o-auth-application.mdx b/.typedoc/docs/backend/o-auth-application.mdx new file mode 100644 index 00000000000..030d68ff7b0 --- /dev/null +++ b/.typedoc/docs/backend/o-auth-application.mdx @@ -0,0 +1,26 @@ +The Backend `OAuthApplication` object holds information about an OAuth application. + +## Properties + +| Property | Type | Description | +| ---------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `authorizeUrl` | `string` | The URL used to authorize the user and obtain an authorization code. | +| `clientId` | `string` | The ID of the client associated with the OAuth application. | +| `clientImageUrl` | null \| string | The URL of the image or logo representing the OAuth application. | +| `clientSecret?` | `string` | The client secret associated with the OAuth application. Empty if public client. | +| `clientUri` | null \| string | The public-facing URL of the OAuth application, often shown on consent screens. | +| `consentScreenEnabled` | `boolean` | Specifies whether the consent screen should be displayed in the authentication flow. Cannot be disabled for dynamically registered OAuth applications. | +| `createdAt` | `number` | The date when the OAuth application was first created. | +| `discoveryUrl` | `string` | The OpenID Connect discovery endpoint URL for this OAuth application. | +| `dynamicallyRegistered` | `boolean` | Specifies whether the OAuth application is dynamically registered. | +| `id` | `string` | The unique identifier for the OAuth application. | +| `instanceId` | `string` | The ID of the instance that this OAuth application belongs to. | +| `isPublic` | `boolean` | Indicates whether the client is public. If true, the Proof Key of Code Exchange (PKCE) flow can be used. | +| `name` | `string` | The name of the new OAuth application. | +| `pkceRequired` | `boolean` | Specifies whether the Proof Key of Code Exchange (PKCE) flow should be required in the authentication flow. | +| `redirectUris` | string[] | An array of redirect URIs of the new OAuth application. | +| `scopes` | `string` | Scopes for the new OAuth application. | +| `tokenFetchUrl` | `string` | The URL used by the client to exchange an authorization code for an access token. | +| `tokenIntrospectionUrl` | `string` | The URL used to introspect and validate issued access tokens. | +| `updatedAt` | `number` | The date when the OAuth application was last updated. | +| `userInfoUrl` | `string` | The URL where the client can retrieve user information using an access token. | diff --git a/.typedoc/docs/backend/organization-invitation-status.mdx b/.typedoc/docs/backend/organization-invitation-status.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/backend/organization-invitation.mdx b/.typedoc/docs/backend/organization-invitation.mdx new file mode 100644 index 00000000000..41b8a55b0a7 --- /dev/null +++ b/.typedoc/docs/backend/organization-invitation.mdx @@ -0,0 +1,19 @@ +The Backend `OrganizationInvitation` object is similar to the [`OrganizationInvitation`](/docs/references/javascript/types/organization-invitation) object as it's the model around an organization invitation. However, the Backend `OrganizationInvitation` object is different in that it's used in the [Backend API](/docs/reference/backend-api/tag/Organization-Invitations#operation/CreateOrganizationInvitation){{ target: '_blank' }} and is not directly accessible from the Frontend API. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `createdAt` | `number` | The date when the invitation was first created. | +| `emailAddress` | `string` | The email address of the user who is invited to the [`Organization`](/docs/references/backend/types/backend-organization). | +| `expiresAt` | `number` | The date when the invitation expires. | +| `id` | `string` | The unique identifier for the `OrganizationInvitation`. | +| `organizationId` | `string` | The ID of the [`Organization`](/docs/references/backend/types/backend-organization) that the user is invited to. | +| `privateMetadata` | [`OrganizationInvitationPrivateMetadata`](/docs/references/javascript/types/metadata#organization-invitation-private-metadata) | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | +| `publicMetadata` | [`OrganizationInvitationPublicMetadata`](/docs/references/javascript/types/metadata#organization-invitation-public-metadata) | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | +| `publicOrganizationData?` | null \| [PublicOrganizationDataJSON](#public-organization-data-json) | Public data about the organization that the user is invited to. | +| `role` | `string` | The role of the invited user. | +| `roleName` | `string` | The name of the role of the invited user. | +| `status?` | "expired" \| "revoked" \| "pending" \| "accepted" | The status of the invitation. | +| `updatedAt` | `number` | The date when the invitation was last updated. | +| `url` | null \| string | The URL that the user can use to accept the invitation. | diff --git a/.typedoc/docs/backend/organization-membership-public-user-data.mdx b/.typedoc/docs/backend/organization-membership-public-user-data.mdx new file mode 100644 index 00000000000..0c5cc72dbcd --- /dev/null +++ b/.typedoc/docs/backend/organization-membership-public-user-data.mdx @@ -0,0 +1,8 @@ +| Property | Type | Description | +| ------------------------------------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `firstName` | null \| string | The first name of the user. | +| `hasImage` | `boolean` | Whether the user has a profile picture. | +| `identifier` | `string` | The [identifier](/docs/authentication/configuration/sign-up-sign-in-options#identifiers) of the user. | +| `imageUrl` | `string` | Holds the default avatar or user's uploaded profile image. Compatible with Clerk's [Image Optimization](/docs/guides/image-optimization). | +| `lastName` | null \| string | The last name of the user. | +| `userId` | `string` | The ID of the user that this public data belongs to. | diff --git a/.typedoc/docs/backend/organization-membership.mdx b/.typedoc/docs/backend/organization-membership.mdx new file mode 100644 index 00000000000..585912c6ef4 --- /dev/null +++ b/.typedoc/docs/backend/organization-membership.mdx @@ -0,0 +1,15 @@ +The Backend `OrganizationMembership` object is similar to the [`OrganizationMembership`](/docs/references/javascript/types/organization-membership) object as it's the model around an organization membership entity and describes the relationship between users and organizations. However, the Backend `OrganizationMembership` object is different in that it's used in the [Backend API](/docs/reference/backend-api/tag/Organization-Memberships#operation/CreateOrganizationMembership){{ target: '_blank' }} and is not directly accessible from the Frontend API. + +## Properties + +| Property | Type | Description | +| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `createdAt` | `number` | The date when the membership was first created. | +| `id` | `string` | The unique identifier for the membership. | +| `organization` | [`Organization`](/docs/references/backend/types/backend-organization) | The organization that the user is a member of. | +| `permissions` | string[] | The permissions granted to the user in the organization. | +| `privateMetadata` | [`OrganizationMembershipPrivateMetadata`](/docs/references/javascript/types/metadata#organization-membership-private-metadata) | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | +| `publicMetadata` | [`OrganizationMembershipPublicMetadata`](/docs/references/javascript/types/metadata#organization-membership-public-metadata) | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | +| `publicUserData?` | null \| [OrganizationMembershipPublicUserData](#organization-membership-public-user-data) | Public information about the user that this membership belongs to. | +| `role` | `string` | The role of the user. | +| `updatedAt` | `number` | The date when the membership was last updated. | diff --git a/.typedoc/docs/backend/organization-sync-options.mdx b/.typedoc/docs/backend/organization-sync-options.mdx new file mode 100644 index 00000000000..5a3609e438f --- /dev/null +++ b/.typedoc/docs/backend/organization-sync-options.mdx @@ -0,0 +1,8 @@ +> **OrganizationSyncOptions** = \{ organizationPatterns?: Pattern[]; personalAccountPatterns?: Pattern[]; \} + +## Properties + +| Property | Type | Description | +| --------------------------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationPatterns?` | Pattern[] | 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/(.*)"]`. | +| `personalAccountPatterns?` | Pattern[] | 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/.typedoc/docs/backend/organization-sync-target.mdx b/.typedoc/docs/backend/organization-sync-target.mdx new file mode 100644 index 00000000000..42fb0f448bb --- /dev/null +++ b/.typedoc/docs/backend/organization-sync-target.mdx @@ -0,0 +1,2 @@ +Represents an organization or a personal account - e.g. an +entity that can be activated by the handshake API. diff --git a/.typedoc/docs/backend/organization.mdx b/.typedoc/docs/backend/organization.mdx new file mode 100644 index 00000000000..4da8acac205 --- /dev/null +++ b/.typedoc/docs/backend/organization.mdx @@ -0,0 +1,19 @@ +The Backend `Organization` object is similar to the [`Organization`](/docs/references/javascript/organization) object as it holds information about an organization, as well as methods for managing it. However, the Backend `Organization` object is different in that it is used in the [Backend API](/docs/reference/backend-api/tag/Organizations#operation/ListOrganizations){{ target: '_blank' }} and is not directly accessible from the Frontend API. + +## Properties + +| Property | Type | Description | +| ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `adminDeleteEnabled` | `boolean` | Whether the organization allows admins to delete users. | +| `createdAt` | `number` | The date when the organization was first created. | +| `createdBy?` | `string` | The ID of the user who created the organization. | +| `hasImage` | `boolean` | Whether the organization has an image. | +| `id` | `string` | The unique identifier for the organization. | +| `imageUrl` | `string` | Holds the organization's logo. Compatible with Clerk's [Image Optimization](/docs/guides/image-optimization). | +| `maxAllowedMemberships` | `number` | The maximum number of memberships allowed in the organization. | +| `membersCount?` | `number` | The number of members in the organization. | +| `name` | `string` | The name of the organization. | +| `privateMetadata` | [`OrganizationPrivateMetadata`](/docs/references/javascript/types/metadata#organization-private-metadata) | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | +| `publicMetadata` | null \| [OrganizationPublicMetadata](/docs/references/javascript/types/metadata#organization-public-metadata) | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | +| `slug` | `string` | The URL-friendly identifier of the user's active organization. If supplied, it must be unique for the instance. | +| `updatedAt` | `number` | The date when the organization was last updated. | diff --git a/.typedoc/docs/backend/paginated-resource-response.mdx b/.typedoc/docs/backend/paginated-resource-response.mdx new file mode 100644 index 00000000000..1603ff21b4e --- /dev/null +++ b/.typedoc/docs/backend/paginated-resource-response.mdx @@ -0,0 +1,14 @@ +An interface that describes the response of a method that returns a paginated list of resources. + +If the promise resolves, you will get back the [properties](#properties) listed below. `data` will be an array of the resource type you requested. You can use the `totalCount` property to determine how many total items exist remotely. + +Some methods that return this type allow pagination with the `limit` and `offset` parameters, in which case the first 10 items will be returned by default. For methods such as [`getAllowlistIdentifierList()`](/docs/references/backend/allowlist/get-allowlist-identifier-list), which do not take a `limit` or `offset`, all items will be returned. + +If the promise is rejected, you will receive a `ClerkAPIResponseError` or network error. + +## Properties + +| Property | Type | Description | +| ------------------------------------ | -------- | -------------------------------------------- | +| `data` | `T` | An array that contains the fetched data. | +| `totalCount` | `number` | The total count of data that exist remotely. | diff --git a/.typedoc/docs/backend/phone-number.mdx b/.typedoc/docs/backend/phone-number.mdx new file mode 100644 index 00000000000..01d074308db --- /dev/null +++ b/.typedoc/docs/backend/phone-number.mdx @@ -0,0 +1,16 @@ +The Backend `PhoneNumber` object describes a phone number. Phone numbers can be used as a proof of identification for users, or simply as a means of contacting users. + +Phone numbers must be **verified** to ensure that they can be assigned to their rightful owners. The `PhoneNumber` object holds all the necessary state around the verification process. + +Finally, phone numbers can be used as part of [multi-factor authentication](/docs/authentication/configuration/sign-up-sign-in-options#multi-factor-authentication). During sign in, users can opt in to an extra verification step where they will receive an SMS message with a one-time code. This code must be entered to complete the sign in process. + +## Properties + +| Property | Type | Description | +| -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `defaultSecondFactor` | `boolean` | Set to `true` if this phone number is the default second factor. Set to `false` otherwise. A user must have exactly one default second factor, if multi-factor authentication (2FA) is enabled. | +| `id` | `string` | The unique identifier for this phone number. | +| `linkedTo` | [IdentificationLink](/docs/references/backend/types/backend-identification-link)[] | An object containing information about any other identification that might be linked to this phone number. | +| `phoneNumber` | `string` | The value of this phone number, in [E.164 format](https://en.wikipedia.org/wiki/E.164). | +| `reservedForSecondFactor` | `boolean` | Set to `true` if this phone number is reserved for multi-factor authentication (2FA). Set to `false` otherwise. | +| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of this phone number. | diff --git a/.typedoc/docs/backend/public-organization-data-json.mdx b/.typedoc/docs/backend/public-organization-data-json.mdx new file mode 100644 index 00000000000..4a509f0f1b1 --- /dev/null +++ b/.typedoc/docs/backend/public-organization-data-json.mdx @@ -0,0 +1,8 @@ +| Property | Type | Description | +| ----------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------- | +| `has_image` | `boolean` | Whether the organization has a profile image. | +| `id` | `string` | The unique identifier for the resource. | +| `image_url?` | `string` | Holds the default organization profile image. Compatible with Clerk's [Image Optimization](/docs/guides/image-optimization). | +| `name` | `string` | The name of the organization. | +| `object` | `ObjectType` | The type of the resource. | +| `slug` | `string` | The slug of the organization. | diff --git a/.typedoc/docs/backend/redirect-url.mdx b/.typedoc/docs/backend/redirect-url.mdx new file mode 100644 index 00000000000..1b128348cea --- /dev/null +++ b/.typedoc/docs/backend/redirect-url.mdx @@ -0,0 +1,12 @@ +Redirect URLs are whitelisted URLs that facilitate secure authentication flows in native applications (e.g. React Native, Expo). In these contexts, Clerk ensures that security-critical nonces are passed only to the whitelisted URLs. + +The Backend `RedirectUrl` object represents a redirect URL in your application. This object is used in the Backend API. + +## Properties + +| Property | Type | Description | +| ---------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `createdAt` | `number` | The date when the redirect URL was first created. | +| `id` | `string` | The unique identifier for the redirect URL. | +| `updatedAt` | `number` | The date when the redirect URL was last updated. | +| `url` | `string` | The full URL value prefixed with `https://` or a custom scheme. Examples: `https://my-app.com/oauth-callback`, `my-app://oauth-callback`. | diff --git a/.typedoc/docs/backend/saml-account.mdx b/.typedoc/docs/backend/saml-account.mdx new file mode 100644 index 00000000000..9099ed83ecc --- /dev/null +++ b/.typedoc/docs/backend/saml-account.mdx @@ -0,0 +1,15 @@ +The Backend `SamlAccount` object describes a SAML account. + +## Properties + +| Property | Type | Description | +| -------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------ | +| `active` | `boolean` | A boolean that indicates whether the SAML account is active. | +| `emailAddress` | `string` | The email address of the SAML account. | +| `firstName` | `string` | The first name of the SAML account. | +| `id` | `string` | The unique identifier for the SAML account. | +| `lastName` | `string` | The last name of the SAML account. | +| `provider` | `string` | The provider of the SAML account. | +| `providerUserId` | null \| string | The user's ID as used in the provider. | +| `samlConnection` | null \| SamlAccountConnection | The SAML connection of the SAML account. | +| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | The verification of the SAML account. | diff --git a/.typedoc/docs/backend/saml-connection.mdx b/.typedoc/docs/backend/saml-connection.mdx new file mode 100644 index 00000000000..d55d90126bd --- /dev/null +++ b/.typedoc/docs/backend/saml-connection.mdx @@ -0,0 +1,27 @@ +The Backend `SamlConnection` object holds information about a SAML connection for an organization. + +## Properties + +| Property | Type | Description | +| ---------------------------------------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `acsUrl` | `string` | The Assertion Consumer Service (ACS) URL of the connection. | +| `active` | `boolean` | Indicates whether the connection is active or not. | +| `allowIdpInitiated` | `boolean` | Indicates whether the connection allows Identity Provider (IdP) initiated flows or not. | +| `allowSubdomains` | `boolean` | Indicates whether users with an email address subdomain are allowed to use this connection in order to authenticate or not. | +| `attributeMapping` | `AttributeMapping` | Defines the attribute name mapping between the Identity Provider (IdP) and Clerk's [`User`](/docs/references/javascript/user) properties. | +| `createdAt` | `number` | The date when the connection was first created. | +| `domain` | `string` | The domain of your organization. Sign in flows using an email with this domain will use the connection. | +| `id` | `string` | The unique identifier for the connection. | +| `idpCertificate` | null \| string | The X.509 certificate as provided by the Identity Provider (IdP). | +| `idpEntityId` | null \| string | The Entity ID as provided by the Identity Provider (IdP). | +| `idpMetadata` | null \| string | The XML content of the Identity Provider (IdP) metadata file. If present, it takes priority over the corresponding individual properties. | +| `idpMetadataUrl` | null \| string | The URL which serves the Identity Provider (IdP) metadata. If present, it takes priority over the corresponding individual properties. | +| `idpSsoUrl` | null \| string | The Single-Sign On URL as provided by the Identity Provider (IdP). | +| `name` | `string` | The name to use as a label for the connection. | +| `organizationId` | null \| string | The organization ID of the organization. | +| `provider` | `string` | The Identity Provider (IdP) of the connection. | +| `spEntityId` | `string` | The Entity ID as provided by the Service Provider (Clerk). | +| `spMetadataUrl` | `string` | The metadata URL as provided by the Service Provider (Clerk). | +| `syncUserAttributes` | `boolean` | Indicates whether the connection syncs user attributes between the Service Provider (SP) and Identity Provider (IdP) or not. | +| `updatedAt` | `number` | The date when the SAML connection was last updated. | +| `userCount` | `number` | The number of users associated with the connection. | diff --git a/.typedoc/docs/backend/session-activity.mdx b/.typedoc/docs/backend/session-activity.mdx new file mode 100644 index 00000000000..b6a304b26e0 --- /dev/null +++ b/.typedoc/docs/backend/session-activity.mdx @@ -0,0 +1,14 @@ +The Backend `SessionActivity` object models the activity of a user session, capturing details such as the device type, browser information, and geographical location. + +## Properties + +| Property | Type | Description | +| --------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------- | +| `browserName?` | `string` | The name of the browser from which this session activity occurred. | +| `browserVersion?` | `string` | The version of the browser from which this session activity occurred. | +| `city?` | `string` | The city from which this session activity occurred. Resolved by IP address geo-location. | +| `country?` | `string` | The country from which this session activity occurred. Resolved by IP address geo-location. | +| `deviceType?` | `string` | The type of the device which was used in this session activity. | +| `id` | `string` | The unique identifier for the session activity record. | +| `ipAddress?` | `string` | The IP address from which this session activity originated. | +| `isMobile` | `boolean` | Will be set to `true` if the session activity came from a mobile device. Set to `false` otherwise. | diff --git a/.typedoc/docs/backend/session.mdx b/.typedoc/docs/backend/session.mdx new file mode 100644 index 00000000000..6cf5fa2e50b --- /dev/null +++ b/.typedoc/docs/backend/session.mdx @@ -0,0 +1,18 @@ +The Backend `Session` object is similar to the [`Session`](/docs/references/javascript/session) object as it is an abstraction over an HTTP session and models the period of information exchange between a user and the server. However, the Backend `Session` object is different as it is used in the [Backend API](/docs/reference/backend-api/tag/Sessions#operation/GetSessionList) and is not directly accessible from the Frontend API. + +## Properties + +| Property | Type | Description | +| ----------------------------------------------------------------- | ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `abandonAt` | `number` | The date when the `Session` will be abandoned. | +| `actor` | null \| Record\ | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | +| `clientId` | `string` | The ID of the client associated with the `Session`. | +| `createdAt` | `number` | The date when the `Session` was first created. | +| `expireAt` | `number` | The date when the `Session` will expire. | +| `id` | `string` | The unique identifier for the `Session`. | +| `lastActiveAt` | `number` | The time the session was last active on the [`Client`](/docs/references/backend/types/backend-client). | +| `lastActiveOrganizationId?` | `string` | The ID of the last active organization. | +| `latestActivity?` | [`SessionActivity`](/docs/references/backend/types/backend-session-activity) | An object that provides additional information about this session, focused around user activity data. | +| `status` | `string` | The current state of the `Session`. | +| `updatedAt` | `number` | The date when the `Session` was last updated. | +| `userId` | `string` | The ID of the user associated with the `Session`. | diff --git a/.typedoc/docs/backend/user.mdx b/.typedoc/docs/backend/user.mdx new file mode 100644 index 00000000000..9847d75c136 --- /dev/null +++ b/.typedoc/docs/backend/user.mdx @@ -0,0 +1,47 @@ +The Backend `User` object is similar to the `User` object as it holds information about a user of your application, such as their unique identifier, name, email addresses, phone numbers, and more. However, the Backend `User` object is different from the `User` object in that it is used in the [Backend API](/docs/reference/backend-api/tag/Users#operation/GetUser){{ target: '_blank' }} and is not directly accessible from the Frontend API. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `backupCodeEnabled` | `boolean` | A boolean indicating whether the user has enabled Backup codes. | +| `banned` | `boolean` | A boolean indicating whether the user is banned or not. | +| `createdAt` | `number` | The date when the user was first created. | +| `createOrganizationEnabled` | `boolean` | A boolean indicating whether the organization creation is enabled for the user or not. | +| `createOrganizationsLimit` | null \| number | An integer indicating the number of organizations that can be created by the user. If the value is `0`, then the user can create unlimited organizations. Default is `null`. | +| `deleteSelfEnabled` | `boolean` | A boolean indicating whether the user can delete their own account. | +| `emailAddresses` | [EmailAddress](/docs/references/backend/types/backend-email-address)[] | An array of all the `EmailAddress` objects associated with the user. Includes the primary. | +| `externalAccounts` | [ExternalAccount](/docs/references/backend/types/backend-external-account)[] | An array of all the `ExternalAccount` objects associated with the user via OAuth. **Note**: This includes both verified & unverified external accounts. | +| `externalId` | null \| string | The ID of the user as used in your external systems. Must be unique across your instance. | +| `firstName` | null \| string | The user's first name. | +| `hasImage` | `boolean` | A getter boolean to check if the user has uploaded an image or one was copied from OAuth. Returns `false` if Clerk is displaying an avatar for the user. | +| `id` | `string` | The unique identifier for the user. | +| `imageUrl` | `string` | The URL of the user's profile image. | +| `lastActiveAt` | null \| number | Date when the user was last active. | +| `lastName` | null \| string | The user's last name. | +| `lastSignInAt` | null \| number | The date when the user last signed in. May be empty if the user has never signed in. | +| `legalAcceptedAt` | null \| number | The unix timestamp of when the user accepted the legal requirements. `null` if [**Require express consent to legal documents**](/docs/authentication/configuration/legal-compliance) is not enabled. | +| `locked` | `boolean` | A boolean indicating whether the user is banned or not. | +| `passwordEnabled` | `boolean` | A boolean indicating whether the user has a password on their account. | +| `phoneNumbers` | [PhoneNumber](/docs/references/backend/types/backend-phone-number)[] | An array of all the `PhoneNumber` objects associated with the user. Includes the primary. | +| `primaryEmailAddressId` | null \| string | The ID for the `EmailAddress` that the user has set as primary. | +| `primaryPhoneNumberId` | null \| string | The ID for the `PhoneNumber` that the user has set as primary. | +| `primaryWeb3WalletId` | null \| string | The ID for the [`Web3Wallet`](/docs/references/backend/types/backend-web3-wallet) that the user signed up with. | +| `privateMetadata` | `UserPrivateMetadata` | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | +| `publicMetadata` | `UserPublicMetadata` | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | +| `samlAccounts` | [SamlAccount](/docs/references/backend/types/backend-saml-account)[] | An array of all the `SamlAccount` objects associated with the user via SAML. | +| `totpEnabled` | `boolean` | A boolean indicating whether the user has enabled TOTP by generating a TOTP secret and verifying it via an authenticator app. | +| `twoFactorEnabled` | `boolean` | A boolean indicating whether the user has enabled two-factor authentication. | +| `unsafeMetadata` | `UserUnsafeMetadata` | Metadata that can be read and set from the Frontend API. It's considered unsafe because it can be modified from the frontend. | +| `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 + +| Property | Type | Description | +| ------------------------------------------------------ | ----------------------------------------------------------------------------------------- | -------------------------------------- | +| `fullName` | null \| string | The full name of the user. | +| `primaryEmailAddress` | null \| [EmailAddress](/docs/references/backend/types/backend-email-address) | The primary email address of the user. | +| `primaryPhoneNumber` | null \| [PhoneNumber](/docs/references/backend/types/backend-phone-number) | The primary phone number of the user. | +| `primaryWeb3Wallet` | null \| [Web3Wallet](/docs/references/backend/types/backend-web3-wallet) | The primary web3 wallet of the user. | diff --git a/.typedoc/docs/backend/verification.mdx b/.typedoc/docs/backend/verification.mdx new file mode 100644 index 00000000000..0abc5338e0e --- /dev/null +++ b/.typedoc/docs/backend/verification.mdx @@ -0,0 +1,13 @@ +The Backend `Verification` object describes the state of the verification process of a sign-in or sign-up attempt. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------------------------------------ | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `attempts` | null \| number | The number of attempts related to the verification. | +| `expireAt` | null \| number | The time the verification will expire at. | +| `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` | `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/.typedoc/docs/backend/verify-machine-auth-token.mdx b/.typedoc/docs/backend/verify-machine-auth-token.mdx new file mode 100644 index 00000000000..3c6cc9d35c7 --- /dev/null +++ b/.typedoc/docs/backend/verify-machine-auth-token.mdx @@ -0,0 +1,12 @@ +Verifies any type of machine token by detecting its type from the prefix. + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------- | ------------------------------------------------------------------------- | +| `token` | `string` | The token to verify (e.g. starts with "m2m*", "oauth*", "api*key*", etc.) | +| `options` | [`VerifyTokenOptions`](#verify-token-options) | Options including secretKey for BAPI authorization | + +## Returns + +`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"; \} \| \{ data: APIKey; errors?: undefined; tokenType: "api_key" \| "m2m_token" \| "oauth_token"; \}\> diff --git a/.typedoc/docs/backend/verify-token-options.mdx b/.typedoc/docs/backend/verify-token-options.mdx new file mode 100644 index 00000000000..e35c5fa20b3 --- /dev/null +++ b/.typedoc/docs/backend/verify-token-options.mdx @@ -0,0 +1,11 @@ +| Property | Type | Description | +| ----------------------------------------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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`. | +| ~~`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). | +| `secretKey?` | `string` | The Clerk Secret Key from the [**API keys**](https://dashboard.clerk.com/last-active?path=api-keys) page in the Clerk Dashboard. | +| `skipJwksCache?` | `boolean` | A flag to ignore the JWKS cache and always fetch JWKS before each JWT verification. | diff --git a/.typedoc/docs/backend/verify-token.mdx b/.typedoc/docs/backend/verify-token.mdx new file mode 100644 index 00000000000..5667b1e6842 --- /dev/null +++ b/.typedoc/docs/backend/verify-token.mdx @@ -0,0 +1,83 @@ +> [!WARNING] +> This is a lower-level method intended for more advanced use-cases. It's recommended to use [`authenticateRequest()`](/docs/references/backend/authenticate-request), which fully authenticates a token passed from the `request` object. + +```ts +function verifyToken(token, options): Promise>; +``` + +Verifies a Clerk-generated token signature. Networkless if the `jwtKey` is provided. Otherwise, performs a network call to retrieve the JWKS from the [Backend API](/docs/reference/backend-api/tag/JWKS#operation/GetJWKS){{ target: '_blank' }}. + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------- | -------------------------------- | +| `token` | `string` | The token to verify. | +| `options` | [`VerifyTokenOptions`](#verify-token-options) | Options for verifying the token. | + +### `VerifyTokenOptions` + +It is recommended to set these options as [environment variables](/docs/deployments/clerk-environment-variables#api-and-sdk-configuration) where possible, and then pass them to the function. For example, you can set the `secretKey` option using the `CLERK_SECRET_KEY` environment variable, and then pass it to the function like this: `createClerkClient({ secretKey: process.env.CLERK_SECRET_KEY })`. + +> [!WARNING] +> You must provide either `jwtKey` or `secretKey`. + + + +## Returns + +`Promise`\<`JwtReturnType`\<`JwtPayload`, `TokenVerificationError`\>\> + +## Example + +The following example demonstrates how to use the [JavaScript Backend SDK](/docs/references/backend/overview) to verify the token signature. + +In the following example: + +1. The **JWKS Public Key** from the Clerk Dashboard is set in the environment variable `CLERK_JWT_KEY`. +1. The session token is retrieved from the `__session` cookie or the Authorization header. +1. The token is verified in a networkless manner by passing the `jwtKey` prop. +1. The `authorizedParties` prop is passed to verify that the session token is generated from the expected frontend application. +1. If the token is valid, the response contains the verified token. + +```ts +import { verifyToken } from '@clerk/backend'; +import { cookies } from 'next/headers'; + +export async function GET(request: Request) { + const cookieStore = cookies(); + const sessToken = cookieStore.get('__session')?.value; + const bearerToken = request.headers.get('Authorization')?.replace('Bearer ', ''); + const token = sessToken || bearerToken; + + if (!token) { + return Response.json({ error: 'Token not found. User must sign in.' }, { status: 401 }); + } + + try { + const verifiedToken = await verifyToken(token, { + jwtKey: process.env.CLERK_JWT_KEY, + authorizedParties: ['http://localhost:3001', 'api.example.com'], // Replace with your authorized parties + }); + + return Response.json({ verifiedToken }); + } catch (error) { + return Response.json({ error: 'Token not verified.' }, { status: 401 }); + } +} +``` + +If the token is valid, the response will contain a JSON object that looks something like this: + +```json +{ + "verifiedToken": { + "azp": "http://localhost:3000", + "exp": 1687906422, + "iat": 1687906362, + "iss": "https://magical-marmoset-51.clerk.accounts.dev", + "nbf": 1687906352, + "sid": "sess_2Ro7e2IxrffdqBboq8KfB6eGbIy", + "sub": "user_2RfWKJREkjKbHZy0Wqa5qrHeAnb" + } +} +``` diff --git a/.typedoc/docs/backend/verify-webhook-options.mdx b/.typedoc/docs/backend/verify-webhook-options.mdx new file mode 100644 index 00000000000..c0bc04c4ae2 --- /dev/null +++ b/.typedoc/docs/backend/verify-webhook-options.mdx @@ -0,0 +1,7 @@ +> **VerifyWebhookOptions** = \{ signingSecret?: string; \} + +## Properties + +| Property | Type | Description | +| ------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `signingSecret?` | `string` | The signing secret for the webhook. It's recommended to use the [`CLERK_WEBHOOK_SIGNING_SECRET` environment variable](/docs/deployments/clerk-environment-variables#webhooks) instead. | diff --git a/.typedoc/docs/backend/verify-webhook.mdx b/.typedoc/docs/backend/verify-webhook.mdx new file mode 100644 index 00000000000..e16c0e4d51f --- /dev/null +++ b/.typedoc/docs/backend/verify-webhook.mdx @@ -0,0 +1,42 @@ +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; +``` + +## Parameters + +| Parameter | Type | Description | +| ------------------------ | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | `Request` | The request object. | +| `options` | \{ signingSecret?: string; \} | Optional configuration object. | +| `options.signingSecret?` | `string` | The signing secret for the webhook. It's recommended to use the [`CLERK_WEBHOOK_SIGNING_SECRET` environment variable](/docs/deployments/clerk-environment-variables#webhooks) instead. | + +## Returns + +`Promise`\<`WebhookEvent`\> + +## Example + +See the [guide on syncing data](/docs/webhooks/sync-data) for more comprehensive and framework-specific examples that you can copy and paste into your app. + +```ts +try { + const evt = await verifyWebhook(request); + + // Access the event data + const { id } = evt.data; + const eventType = evt.type; + + // Handle specific event types + if (evt.type === 'user.created') { + console.log('New user created:', evt.data.id); + // Handle user creation + } + + return new Response('Success', { status: 200 }); +} catch (err) { + console.error('Webhook verification failed:', err); + return new Response('Webhook verification failed', { status: 400 }); +} +``` diff --git a/.typedoc/docs/backend/web3-wallet.mdx b/.typedoc/docs/backend/web3-wallet.mdx new file mode 100644 index 00000000000..d0eeb11bfbf --- /dev/null +++ b/.typedoc/docs/backend/web3-wallet.mdx @@ -0,0 +1,11 @@ +The Backend `Web3Wallet` object describes a Web3 wallet address. The address can be used as a proof of identification for users. + +Web3 addresses must be verified to ensure that they can be assigned to their rightful owners. The verification is completed via Web3 wallet browser extensions, such as [Metamask](https://metamask.io/), [Coinbase Wallet](https://www.coinbase.com/wallet), and [OKX Wallet](https://www.okx.com/help/section/faq-web3-wallet). The `Web3Wallet3` object holds all the necessary state around the verification process. + +## Properties + +| Property | Type | Description | +| ---------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `id` | `string` | The unique ID for the Web3 wallet. | +| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of this Web3 wallet. | +| `web3Wallet` | `string` | The Web3 wallet address, made up of 0x + 40 hexadecimal characters. | diff --git a/.typedoc/docs/clerk-react/api-keys.mdx b/.typedoc/docs/clerk-react/api-keys.mdx new file mode 100644 index 00000000000..4147bc55f14 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/clerk-react/clerk-provider-props.mdx b/.typedoc/docs/clerk-react/clerk-provider-props.mdx new file mode 100644 index 00000000000..e157d089a4f --- /dev/null +++ b/.typedoc/docs/clerk-react/clerk-provider-props.mdx @@ -0,0 +1,43 @@ +## Properties + +| Property | Type | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `afterMultiSessionSingleSignOutUrl?` | null \| string | The full URL or path to navigate to after signing out the current user is complete. This option applies to [multi-session applications](/docs/authentication/configuration/session-options#multi-session-applications). | +| ~~`afterSignInUrl?`~~ | null \| string | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | +| `afterSignOutUrl?` | null \| string | Full URL or path to navigate to after successful sign out. | +| ~~`afterSignUpUrl?`~~ | null \| string | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | +| `allowedRedirectOrigins?` | (string \| RegExp)[] | An optional array of domains to validate user-provided redirect URLs against. If no match is made, the redirect is considered unsafe and the default redirect will be used with a warning logged in the console. | +| `allowedRedirectProtocols?` | string[] | An optional array of protocols to validate user-provided redirect URLs against. If no match is made, the redirect is considered unsafe and the default redirect will be used with a warning logged in the console. | +| `appearance?` | `Appearance` | Optional object to style your components. Will only affect [Clerk Components](/docs/components/overview) and not [Account Portal](/docs/account-portal/overview) pages. | +| `clerkJSUrl?` | `string` | The URL that `@clerk/clerk-js` should be hot-loaded from. | +| `clerkJSVariant?` | "" \| "headless" | If your web application only uses [Control Components](/docs/components/overview#control-components), you can set this value to `'headless'` and load a minimal ClerkJS bundle for optimal page performance. | +| `clerkJSVersion?` | `string` | The npm version for `@clerk/clerk-js`. | +| `domain?` | string \| (url) => string | **Required if your application is a satellite application**. Sets the domain of the satellite application. | +| `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?` | [`LocalizationResource`](/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. | +| `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`). | +| `publishableKey` | `string` | The Clerk Publishable Key for your instance. This can be found on the [API keys](https://dashboard.clerk.com/last-active?path=api-keys) page in the Clerk Dashboard. | +| ~~`redirectUrl?`~~ | null \| string | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | +| `routerPush?` | (to, metadata?) => unknown | A function which takes the destination path as an argument and performs a "push" navigation. | +| `routerReplace?` | (to, metadata?) => unknown | A function which takes the destination path as an argument and performs a "replace" navigation. | +| `sdkMetadata?` | \{ environment?: string; name: string; version: string; \} | Contains information about the SDK that the host application is using. You don't need to set this value yourself unless you're [developing an SDK](/docs/references/sdk/overview). | +| `sdkMetadata.environment?` | `string` | Typically this will be the `NODE_ENV` that the SDK is currently running in. | +| `sdkMetadata.name` | `string` | The npm package name of the SDK. | +| `sdkMetadata.version` | `string` | The npm package version of the SDK. | +| `selectInitialSession?` | (client) => null \| [SignedInSessionResource](/docs/references/javascript/session) | By default, the last signed-in session is used during client initialization. This option allows you to override that behavior, e.g. by selecting a specific session. | +| `signInFallbackRedirectUrl?` | null \| string | The fallback URL to redirect to after the user signs in, if there's no `redirect_url` in the path already. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. Defaults to `'/'`. | +| `signInForceRedirectUrl?` | null \| string | This URL will always be redirected to after the user signs in. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. | +| `signInUrl?` | `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. **It is required to 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. | +| `signUpFallbackRedirectUrl?` | null \| string | The fallback URL to redirect to after the user signs up, if there's no `redirect_url` in the path already. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. Defaults to `'/'`. | +| `signUpForceRedirectUrl?` | null \| string | This URL will always be redirected to after the user signs up. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. | +| `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. | +| `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/.typedoc/docs/clerk-react/protect.mdx b/.typedoc/docs/clerk-react/protect.mdx new file mode 100644 index 00000000000..4d3c56c30f0 --- /dev/null +++ b/.typedoc/docs/clerk-react/protect.mdx @@ -0,0 +1,21 @@ +Use `` in order to prevent unauthenticated or unauthorized users from accessing the children passed to the component. + +Examples: + +``` + + + has({permission:"a_permission_key"})} /> + has({role:"a_role_key"})} /> +Unauthorized

} /> +``` + +## Parameters + +| Parameter | Type | +| ------------------- | -------------- | +| `__namedParameters` | `ProtectProps` | + +## Returns + +`ReactNode` diff --git a/.typedoc/docs/clerk-react/redirect-to-create-organization.mdx b/.typedoc/docs/clerk-react/redirect-to-create-organization.mdx new file mode 100644 index 00000000000..002c69ba5c1 --- /dev/null +++ b/.typedoc/docs/clerk-react/redirect-to-create-organization.mdx @@ -0,0 +1,13 @@ +## Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------- | +| `props` | [`Without`](../types/without.mdx)\<`P`, `"clerk"`\> | + +## Returns + +null \| Element + +## Deprecated + +Use [`redirectToCreateOrganization()`](/docs/references/javascript/clerk#redirect-to-create-organization) instead. diff --git a/.typedoc/docs/clerk-react/redirect-to-organization-profile.mdx b/.typedoc/docs/clerk-react/redirect-to-organization-profile.mdx new file mode 100644 index 00000000000..1bb05bc69e5 --- /dev/null +++ b/.typedoc/docs/clerk-react/redirect-to-organization-profile.mdx @@ -0,0 +1,13 @@ +## Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------- | +| `props` | [`Without`](../types/without.mdx)\<`P`, `"clerk"`\> | + +## Returns + +null \| Element + +## Deprecated + +Use [`redirectToOrganizationProfile()`](/docs/references/javascript/clerk#redirect-to-organization-profile) instead. diff --git a/.typedoc/docs/clerk-react/redirect-to-user-profile.mdx b/.typedoc/docs/clerk-react/redirect-to-user-profile.mdx new file mode 100644 index 00000000000..f8e8364b5a6 --- /dev/null +++ b/.typedoc/docs/clerk-react/redirect-to-user-profile.mdx @@ -0,0 +1,13 @@ +## Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------- | +| `props` | [`Without`](../types/without.mdx)\<`P`, `"clerk"`\> | + +## Returns + +null \| Element + +## Deprecated + +Use [`redirectToUserProfile()`](/docs/references/javascript/clerk#redirect-to-user-profile) instead. diff --git a/.typedoc/docs/clerk-react/use-auth.mdx b/.typedoc/docs/clerk-react/use-auth.mdx new file mode 100644 index 00000000000..f905ad3d242 --- /dev/null +++ b/.typedoc/docs/clerk-react/use-auth.mdx @@ -0,0 +1,176 @@ +The `useAuth()` hook provides access to the current user's authentication state and methods to manage the active session. + +> [!NOTE] +> To access auth data server-side, see the [`Auth` object reference doc](/docs/references/backend/types/auth-object). + + +By default, Next.js opts all routes into static rendering. If you need to opt a route or routes into dynamic rendering because you need to access the authentication data at request time, you can create a boundary by passing the `dynamic` prop to ``. See the [guide on rendering modes](/docs/references/nextjs/rendering-modes) for more information, including code examples. + + +## Parameters + +| Parameter | Type | Description | +| ---------------------------- | -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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 + +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. + + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `actor` | `undefined` | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | +| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | +| `has` | `undefined` | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | +| `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. | +| `orgId` | `undefined` | The ID of the user's active organization. | +| `orgRole` | `undefined` | The current user's role in their active organization. | +| `orgSlug` | `undefined` | The URL-friendly identifier of the user's active organization. | +| `sessionClaims` | `undefined` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | +| `sessionId` | `undefined` | The ID for the current session. | +| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | +| `userId` | `undefined` | The ID of the current user. | + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `actor` | `null` | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | +| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | +| `has()` | (params) => false | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | +| `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. | +| `orgId` | `null` | The ID of the user's active organization. | +| `orgRole` | `null` | The current user's role in their active organization. | +| `orgSlug` | `null` | The URL-friendly identifier of the user's active organization. | +| `sessionClaims` | `null` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | +| `sessionId` | `null` | The ID for the current session. | +| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | +| `userId` | `null` | The ID of the current user. | + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `actor` | null \| \{ [x: string]: unknown; sub: string; \} | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | +| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | +| `has()` | (isAuthorizedParams) => boolean | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | +| `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. | +| `orgId` | `null` | The ID of the user's active organization. | +| `orgRole` | `null` | The current user's role in their active organization. | +| `orgSlug` | `null` | The URL-friendly identifier of the user's active organization. | +| `sessionClaims` | `JwtPayload` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | +| `sessionId` | `string` | The ID for the current session. | +| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | +| `userId` | `string` | The ID of the current user. | + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `actor` | null \| \{ [x: string]: unknown; sub: string; \} | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | +| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | +| `has()` | (isAuthorizedParams) => boolean | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | +| `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. | +| `orgId` | `string` | The ID of the user's active organization. | +| `orgRole` | `OrganizationCustomRoleKey` | The current user's role in their active organization. | +| `orgSlug` | null \| string | The URL-friendly identifier of the user's active organization. | +| `sessionClaims` | `JwtPayload` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | +| `sessionId` | `string` | The ID for the current session. | +| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | +| `userId` | `string` | The ID of the current user. | + + + +## Example + +The following example demonstrates how to use the `useAuth()` hook to access the current auth state, like whether the user is signed in or not. It also includes a basic example for using the `getToken()` method to retrieve a session token for fetching data from an external resource. + + + + +```tsx {{ filename: 'src/pages/ExternalDataPage.tsx' }} +import { useAuth } from '@clerk/clerk-react'; + +export default function ExternalDataPage() { + const { userId, sessionId, getToken, isLoaded, isSignedIn } = useAuth(); + + const fetchExternalData = async () => { + const token = await getToken(); + + // Fetch data from an external API + const response = await fetch('https://api.example.com/data', { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + + return response.json(); + }; + + if (!isLoaded) { + return
Loading...
; + } + + if (!isSignedIn) { + return
Sign in to view this page
; + } + + return ( +
+

+ Hello, {userId}! Your current active session is {sessionId}. +

+ +
+ ); +} +``` + +
+ + +```tsx {{ filename: 'app/external-data/page.tsx' }} +'use client'; + +import { useAuth } from '@clerk/nextjs'; + +export default function ExternalDataPage() { + const { userId, sessionId, getToken, isLoaded, isSignedIn } = useAuth(); + + const fetchExternalData = async () => { + const token = await getToken(); + + // Fetch data from an external API + const response = await fetch('https://api.example.com/data', { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + + return response.json(); + }; + + if (!isLoaded) { + return
Loading...
; + } + + if (!isSignedIn) { + return
Sign in to view this page
; + } + + return ( +
+

+ Hello, {userId}! Your current active session is {sessionId}. +

+ +
+ ); +} +``` + +
+
diff --git a/.typedoc/docs/clerk-react/use-clerk.mdx b/.typedoc/docs/clerk-react/use-clerk.mdx new file mode 100644 index 00000000000..130acc124c9 --- /dev/null +++ b/.typedoc/docs/clerk-react/use-clerk.mdx @@ -0,0 +1,43 @@ +> [!WARNING] +> This hook should only be used for advanced use cases, such as building a completely custom OAuth flow or as an escape hatch to access to the `Clerk` object. + +The `useClerk()` hook provides access to the [`Clerk`](/docs/references/javascript/clerk) object, allowing you to build alternatives to any Clerk Component. + +## Returns + +[Clerk](/docs/references/javascript/clerk) — The `useClerk()` hook returns the `Clerk` object, which includes all the methods and properties listed in the [`Clerk` reference](/docs/references/javascript/clerk). + +## Example + +The following example uses the `useClerk()` hook to access the `clerk` object. The `clerk` object is used to call the [`openSignIn()`](/docs/references/javascript/clerk#sign-in) method to open the sign-in modal. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useClerk } from '@clerk/clerk-react'; + +export default function Home() { + const clerk = useClerk(); + + return ; +} +``` + + + + +```tsx {{ filename: 'app/page.tsx' }} +'use client'; + +import { useClerk } from '@clerk/nextjs'; + +export default function HomePage() { + const clerk = useClerk(); + + return ; +} +``` + + + diff --git a/.typedoc/docs/clerk-react/use-organization-list.mdx b/.typedoc/docs/clerk-react/use-organization-list.mdx new file mode 100644 index 00000000000..3bce63714df --- /dev/null +++ b/.typedoc/docs/clerk-react/use-organization-list.mdx @@ -0,0 +1,146 @@ +The `useOrganizationList()` hook provides access to the current user's organization memberships, invitations, and suggestions. It also includes methods for creating new organizations and managing the active organization. + +## Parameters + +| Parameter | Type | +| --------- | ---- | +| `params?` | `T` | + +## Returns + +[`UseOrganizationListReturn`](../shared/use-organization-list-return.mdx)\<`T`\> + +## Examples + +### Expanding and paginating attributes + +To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. So by default, the `userMemberships`, `userInvitations`, and `userSuggestions` attributes are not populated. You must pass true or an object with the desired properties to fetch and paginate the data. + +```tsx +// userMemberships.data will never be populated +const { userMemberships } = useOrganizationList(); + +// Use default values to fetch userMemberships, such as initialPage = 1 and pageSize = 10 +const { userMemberships } = useOrganizationList({ + userMemberships: true, +}); + +// Pass your own values to fetch userMemberships +const { userMemberships } = useOrganizationList({ + userMemberships: { + pageSize: 20, + initialPage: 2, // skips the first page + }, +}); + +// Aggregate pages in order to render an infinite list +const { userMemberships } = useOrganizationList({ + userMemberships: { + infinite: true, + }, +}); +``` + +### Infinite pagination + +The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `userMemberships` attribute will be populated with the first page of the user's organization memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. + +```tsx {{ filename: 'src/components/JoinedOrganizations.tsx' }} +import { useOrganizationList } from '@clerk/clerk-react'; +import React from 'react'; + +const JoinedOrganizations = () => { + const { isLoaded, setActive, userMemberships } = useOrganizationList({ + userMemberships: { + infinite: true, + }, + }); + + if (!isLoaded) { + return <>Loading; + } + + return ( + <> +
    + {userMemberships.data?.map(mem => ( +
  • + {mem.organization.name} + +
  • + ))} +
+ + + + ); +}; + +export default JoinedOrganizations; +``` + +### Simple pagination + +The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `userInvitations` attribute will be populated with the first page of invitations. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of invitations. + +Notice the difference between this example's pagination and the infinite pagination example above. + +```tsx {{ filename: 'src/components/UserInvitationsTable.tsx' }} +import { useOrganizationList } from '@clerk/clerk-react'; +import React from 'react'; + +const UserInvitationsTable = () => { + const { isLoaded, userInvitations } = useOrganizationList({ + userInvitations: { + infinite: true, + keepPreviousData: true, + }, + }); + + if (!isLoaded || userInvitations.isLoading) { + return <>Loading; + } + + return ( + <> + + + + + + + + + + {userInvitations.data?.map(inv => ( + + + + + ))} + +
EmailOrg name
{inv.emailAddress}{inv.publicOrganizationData.name}
+ + + + + ); +}; + +export default UserInvitationsTable; +``` diff --git a/.typedoc/docs/clerk-react/use-organization.mdx b/.typedoc/docs/clerk-react/use-organization.mdx new file mode 100644 index 00000000000..d37be2324cb --- /dev/null +++ b/.typedoc/docs/clerk-react/use-organization.mdx @@ -0,0 +1,130 @@ +The `useOrganization()` hook retrieves attributes of the currently active organization. + +## Parameters + +| Parameter | Type | +| --------- | ---- | +| `params?` | `T` | + +## Returns + +[`UseOrganizationReturn`](../shared/use-organization-return.mdx)\<`T`\> + +## Examples + +### Expand and paginate attributes + +To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. By default, the `memberships`, `invitations`, `membershipRequests`, and `domains` attributes are not populated. You must pass `true` or an object with the desired properties to fetch and paginate the data. + +```tsx +// invitations.data will never be populated. +const { invitations } = useOrganization(); + +// Use default values to fetch invitations, such as initialPage = 1 and pageSize = 10 +const { invitations } = useOrganization({ + invitations: true, +}); + +// Pass your own values to fetch invitations +const { invitations } = useOrganization({ + invitations: { + pageSize: 20, + initialPage: 2, // skips the first page + }, +}); + +// Aggregate pages in order to render an infinite list +const { invitations } = useOrganization({ + invitations: { + infinite: true, + }, +}); +``` + +### Infinite pagination + +The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. + +```tsx +import { useOrganization } from '@clerk/clerk-react' + +export default function MemberList() { + const { memberships } = useOrganization({ + memberships: { + infinite: true, // Append new data to the existing list + keepPreviousData: true, // Persist the cached data until the new data has been fetched + }, + }) + + if (!memberships) { + // Handle loading state + return null + } + + return ( +
+

Organization members

+
    + {memberships.data?.map((membership) => ( +
  • + {membership.publicUserData.firstName} {membership.publicUserData.lastName} < + {membership.publicUserData.identifier}> :: {membership.role} +
  • + ))} +
+ + +
+ ) +} +``` + +### Simple pagination + +The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of memberships. + +Notice the difference between this example's pagination and the infinite pagination example above. + +```tsx +import { useOrganization } from '@clerk/clerk-react' + +export default function MemberList() { + const { memberships } = useOrganization({ + memberships: { + keepPreviousData: true, // Persist the cached data until the new data has been fetched + }, + }) + + if (!memberships) { + // Handle loading state + return null + } + + return ( +
+

Organization members

+
    + {memberships.data?.map((membership) => ( +
  • + {membership.publicUserData.firstName} {membership.publicUserData.lastName} < + {membership.publicUserData.identifier}> :: {membership.role} +
  • + ))} +
+ + + + +
+ ) +} +``` diff --git a/.typedoc/docs/clerk-react/use-reverification.mdx b/.typedoc/docs/clerk-react/use-reverification.mdx new file mode 100644 index 00000000000..a9dc76aff33 --- /dev/null +++ b/.typedoc/docs/clerk-react/use-reverification.mdx @@ -0,0 +1,54 @@ +> [!WARNING] +> +> Depending on the SDK you're using, this feature requires `@clerk/nextjs@6.12.7` or later, `@clerk/clerk-react@5.25.1` or later, and `@clerk/clerk-js@5.57.1` or later. + +The `useReverification()` hook is used to handle a session's reverification flow. If a request requires reverification, a modal will display, prompting the user to verify their credentials. Upon successful verification, the original request will automatically retry. + +## Parameters + +| Parameter | Type | +| ---------- | --------- | +| `fetcher` | `Fetcher` | +| `options?` | `Options` | + +## Returns + +`UseReverificationResult`\<`Fetcher`\> — The `useReverification()` hook returns an array with the "enhanced" fetcher. + +## Example + +### Handle cancellation of the reverification process + +The following example demonstrates how to handle scenarios where a user cancels the reverification flow, such as closing the modal, which might result in `myData` being `null`. + +In the following example, `myFetcher` would be a function in your backend that fetches data from the route that requires reverification. See the [guide on how to require reverification](/docs/guides/reverification) for more information. + +```tsx {{ filename: 'src/components/MyButton.tsx' }} +import { useReverification } from '@clerk/clerk-react'; +import { isReverificationCancelledError } from '@clerk/clerk-react/error'; + +type MyData = { + balance: number; +}; + +export function MyButton() { + const fetchMyData = () => fetch('/api/balance').then(res => res.json() as Promise); + const enhancedFetcher = useReverification(fetchMyData); + + const handleClick = async () => { + try { + const myData = await enhancedFetcher(); + // ^ is types as `MyData` + } catch (e) { + // Handle error returned from the fetcher here + + // You can also handle cancellation with the following + if (isReverificationCancelledError(err)) { + // Handle the cancellation error here + } + } + }; + + return ; +} +``` diff --git a/.typedoc/docs/clerk-react/use-session-list.mdx b/.typedoc/docs/clerk-react/use-session-list.mdx new file mode 100644 index 00000000000..778f89720ee --- /dev/null +++ b/.typedoc/docs/clerk-react/use-session-list.mdx @@ -0,0 +1,77 @@ +The `useSessionList()` hook returns an array of [`Session`](/docs/references/javascript/session) objects that have been registered on the client device. + +## 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. + + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `sessions` | `undefined` | A list of sessions that have been registered on the client device. | +| `setActive` | `undefined` | A function that sets the active session and/or organization. | + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `sessions` | [SessionResource](/docs/references/javascript/session)[] | A list of sessions that have been registered on the client device. | +| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session and/or organization. | + + + +## Example + +### Get a list of sessions + +The following example uses `useSessionList()` to get a list of sessions that have been registered on the client device. The `sessions` property is used to show the number of times the user has visited the page. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useSessionList } from '@clerk/clerk-react'; + +export default function Home() { + const { isLoaded, sessions } = useSessionList(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return ( +
+

Welcome back. You've been here {sessions.length} times before.

+
+ ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +'use client'; + +import { useSessionList } from '@clerk/nextjs'; + +export default function HomePage() { + const { isLoaded, sessions } = useSessionList(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return ( +
+

Welcome back. You've been here {sessions.length} times before.

+
+ ); +} +``` + +
+
diff --git a/.typedoc/docs/clerk-react/use-session.mdx b/.typedoc/docs/clerk-react/use-session.mdx new file mode 100644 index 00000000000..0ace96d5bc6 --- /dev/null +++ b/.typedoc/docs/clerk-react/use-session.mdx @@ -0,0 +1,89 @@ +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. + +## 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. + + + + | Name | Type | Description | | ------ | ------ | ------ | | `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 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 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` | `boolean` + | A boolean that indicates whether a user is currently signed in. | | `session` | + [`SignedInSessionResource`](/docs/references/javascript/session) | The current session for the user. | + + + +## Example + +### Access the `Session` object + +The following example uses the `useSession()` hook to access the `Session` object, which has the `lastActiveAt` property. The `lastActiveAt` property is a `Date` object used to show the time the session was last active. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useSession } from '@clerk/clerk-react'; + +export default function Home() { + const { isLoaded, session, isSignedIn } = useSession(); + + if (!isLoaded) { + // Handle loading state + return null; + } + if (!isSignedIn) { + // Handle signed out state + return null; + } + + return ( +
+

This session has been active since {session.lastActiveAt.toLocaleString()}

+
+ ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +'use client'; + +import { useSession } from '@clerk/nextjs'; + +export default function HomePage() { + const { isLoaded, session, isSignedIn } = useSession(); + + if (!isLoaded) { + // Handle loading state + return null; + } + if (!isSignedIn) { + // Handle signed out state + return null; + } + + return ( +
+

This session has been active since {session.lastActiveAt.toLocaleString()}

+
+ ); +} +``` + +
+
diff --git a/.typedoc/docs/clerk-react/use-sign-in.mdx b/.typedoc/docs/clerk-react/use-sign-in.mdx new file mode 100644 index 00000000000..1cdabc6daef --- /dev/null +++ b/.typedoc/docs/clerk-react/use-sign-in.mdx @@ -0,0 +1,73 @@ +The `useSignIn()` hook provides access to the [`SignIn`](/docs/references/javascript/sign-in) object, which allows you to check the current state of a sign-in attempt and manage the sign-in flow. You can use this to create a [custom sign-in flow](/docs/custom-flows/overview#sign-in-flow). + +## 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. + + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `setActive` | `undefined` | A function that sets the active session. | +| `signIn` | `undefined` | An object that contains the current sign-in attempt status and methods to create a new sign-in attempt. | + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session. | +| `signIn` | [SignInResource](/docs/references/javascript/sign-in) | An object that contains the current sign-in attempt status and methods to create a new sign-in attempt. | + + + +## Examples + +### Check the current state of a sign-in + +The following example uses the `useSignIn()` hook to access the [`SignIn`](/docs/references/javascript/sign-in) object, which contains the current sign-in attempt status and methods to create a new sign-in attempt. The `isLoaded` property is used to handle the loading state. + + + + +```tsx {{ filename: 'src/pages/SignInPage.tsx' }} +import { useSignIn } from '@clerk/clerk-react'; + +export default function SignInPage() { + const { isLoaded, signIn } = useSignIn(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return
The current sign-in attempt status is {signIn?.status}.
; +} +``` + +
+ + +```tsx {{ filename: 'app/sign-in/page.tsx' }} +'use client'; + +import { useSignIn } from '@clerk/nextjs'; + +export default function SignInPage() { + const { isLoaded, signIn } = useSignIn(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return
The current sign-in attempt status is {signIn?.status}.
; +} +``` + +
+
+ +### Create a custom sign-in flow with `useSignIn()` + +The `useSignIn()` hook can also be used to build fully custom sign-in flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-in flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignIn()` hook to create custom flows, see the [custom flow guides](/docs/custom-flows/overview). diff --git a/.typedoc/docs/clerk-react/use-sign-up.mdx b/.typedoc/docs/clerk-react/use-sign-up.mdx new file mode 100644 index 00000000000..4a0318c4059 --- /dev/null +++ b/.typedoc/docs/clerk-react/use-sign-up.mdx @@ -0,0 +1,73 @@ +The `useSignUp()` hook provides access to the [`SignUp`](/docs/references/javascript/sign-up) object, which allows you to check the current state of a sign-up attempt and manage the sign-up flow. You can use this to create a [custom sign-up flow](/docs/custom-flows/overview#sign-up-flow). + +## 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. + + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `setActive` | `undefined` | A function that sets the active session. | +| `signUp` | `undefined` | An object that contains the current sign-up attempt status and methods to create a new sign-up attempt. | + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session. | +| `signUp` | [`SignUpResource`](/docs/references/javascript/sign-up) | An object that contains the current sign-up attempt status and methods to create a new sign-up attempt. | + + + +## Examples + +### Check the current state of a sign-up + +The following example uses the `useSignUp()` hook to access the [`SignUp`](/docs/references/javascript/sign-up) object, which contains the current sign-up attempt status and methods to create a new sign-up attempt. The `isLoaded` property is used to handle the loading state. + + + + +```tsx {{ filename: 'src/pages/SignUpPage.tsx' }} +import { useSignUp } from '@clerk/clerk-react'; + +export default function SignUpPage() { + const { isLoaded, signUp } = useSignUp(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return
The current sign-up attempt status is {signUp?.status}.
; +} +``` + +
+ + +```tsx {{ filename: 'app/sign-up/page.tsx' }} +'use client'; + +import { useSignUp } from '@clerk/nextjs'; + +export default function SignUpPage() { + const { isLoaded, signUp } = useSignUp(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return
The current sign-up attempt status is {signUp?.status}.
; +} +``` + +
+
+ +### Create a custom sign-up flow with `useSignUp()` + +The `useSignUp()` hook can also be used to build fully custom sign-up flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-up flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignUp()` hook to create custom flows, see the [custom flow guides](/docs/custom-flows/overview). diff --git a/.typedoc/docs/clerk-react/use-user.mdx b/.typedoc/docs/clerk-react/use-user.mdx new file mode 100644 index 00000000000..d8d08b7ab26 --- /dev/null +++ b/.typedoc/docs/clerk-react/use-user.mdx @@ -0,0 +1,208 @@ +The `useUser()` hook provides access to the current user's [`User`](/docs/references/javascript/user) object, which contains all the data for a single user in your application and provides methods to manage their account. This hook also allows you to check if the user is signed in and if Clerk has loaded and initialized. + +## 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. + + + + | Name | Type | Description | | ------ | ------ | ------ | | `isLoaded` | `false` | A boolean that indicates whether + Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | | `isSignedIn` | + `undefined` | A boolean that returns `true` if the user is signed in. | | `user` | `undefined` | The `User` object + for the current 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 returns `true` if the user is signed in. | | `user` | `null` | The `User` object for the current + 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 returns `true` if the user is signed in. | | `user` | + [`UserResource`](/docs/references/javascript/user) | The `User` object for the current user. | + + + +## Examples + +### Get the current user + +The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which contains the current user's data such as their full name. The `isLoaded` and `isSignedIn` properties are used to handle the loading state and to check if the user is signed in, respectively. + +```tsx {{ filename: 'src/Example.tsx' }} +export default function Example() { + const { isSignedIn, user, isLoaded } = useUser(); + + if (!isLoaded) { + return
Loading...
; + } + + if (!isSignedIn) { + return
Sign in to view this page
; + } + + return
Hello {user.firstName}!
; +} +``` + +### Update user data + +The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`update()`](/docs/references/javascript/user#update) method to update the current user's information. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useUser } from '@clerk/clerk-react'; + +export default function Home() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + await user.update({ + firstName: 'John', + lastName: 'Doe', + }); + }; + + return ( + <> + +

user.firstName: {user?.firstName}

+

user.lastName: {user?.lastName}

+ + ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +'use client'; + +import { useUser } from '@clerk/nextjs'; + +export default function HomePage() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + await user.update({ + firstName: 'John', + lastName: 'Doe', + }); + }; + + return ( + <> + +

user.firstName: {user?.firstName}

+

user.lastName: {user?.lastName}

+ + ); +} +``` + +
+
+ +### Reload user data + +The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`reload()`](/docs/references/javascript/user#reload) method to get the latest user's information. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useUser } from '@clerk/clerk-react'; + +export default function Home() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + // Update data via an API endpoint + const updateMetadata = await fetch('/api/updateMetadata'); + + // Check if the update was successful + if (updateMetadata.message !== 'success') { + throw new Error('Error updating'); + } + + // If the update was successful, reload the user data + await user.reload(); + }; + + return ( + <> + +

user role: {user?.publicMetadata.role}

+ + ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +'use client'; + +import { useUser } from '@clerk/nextjs'; + +export default function HomePage() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + // Update data via an API endpoint + const updateMetadata = await fetch('/api/updateMetadata'); + + // Check if the update was successful + if (updateMetadata.message !== 'success') { + throw new Error('Error updating'); + } + + // If the update was successful, reload the user data + await user.reload(); + }; + + return ( + <> + +

user role: {user?.publicMetadata.role}

+ + ); +} +``` + +
+
diff --git a/.typedoc/docs/nextjs/auth.mdx b/.typedoc/docs/nextjs/auth.mdx new file mode 100644 index 00000000000..c19bd0e7c4a --- /dev/null +++ b/.typedoc/docs/nextjs/auth.mdx @@ -0,0 +1,5 @@ +The `auth()` helper returns the [`Auth`](/docs/references/backend/types/auth-object) object of the currently active user, as well as the [`redirectToSignIn()`](/docs/references/nextjs/auth#redirect-to-sign-in) method. + +- Only available for App Router. +- Only works on the server-side, such as in Server Components, Route Handlers, and Server Actions. +- Requires [`clerkMiddleware()`](/docs/references/nextjs/clerk-middleware) to be configured. diff --git a/.typedoc/docs/nextjs/build-clerk-props.mdx b/.typedoc/docs/nextjs/build-clerk-props.mdx new file mode 100644 index 00000000000..b8cc9f53e99 --- /dev/null +++ b/.typedoc/docs/nextjs/build-clerk-props.mdx @@ -0,0 +1,38 @@ +Clerk uses `buildClerkProps` to inform the client-side helpers of the authentication state of the user. This function is used SSR in the `getServerSideProps` function of your Next.js application. + +## Examples + +### Basic usage + +```tsx {{ filename: 'pages/myServerSidePage.tsx' }} +import { getAuth, buildClerkProps } from '@clerk/nextjs/server'; +import { GetServerSideProps } from 'next'; + +export const getServerSideProps: GetServerSideProps = async ctx => { + const { userId } = getAuth(ctx.req); + + if (!userId) { + // handle user is not signed in. + } + + // Load any data your application needs for the page using the userId + return { props: { ...buildClerkProps(ctx.req) } }; +}; +``` + +### Usage with `clerkClient` + +The `clerkClient` allows you to access the Clerk API. You can use this to retrieve or update data. + +```tsx {{ filename: 'pages/api/example.ts' }} +import { getAuth, buildClerkProps, clerkClient } from '@clerk/nextjs/server'; +import { GetServerSideProps } from 'next'; + +export const getServerSideProps: GetServerSideProps = async ctx => { + const { userId } = getAuth(ctx.req); + + const user = userId ? await clerkClient().users.getUser(userId) : undefined; + + return { props: { ...buildClerkProps(ctx.req, { user }) } }; +}; +``` diff --git a/.typedoc/docs/nextjs/clerk-middleware-auth-object.mdx b/.typedoc/docs/nextjs/clerk-middleware-auth-object.mdx new file mode 100644 index 00000000000..c66ae2fec8d --- /dev/null +++ b/.typedoc/docs/nextjs/clerk-middleware-auth-object.mdx @@ -0,0 +1,3 @@ +## Deprecated + +Use `ClerkMiddlewareSessionAuthObject` instead. diff --git a/.typedoc/docs/nextjs/clerk-middleware-options.mdx b/.typedoc/docs/nextjs/clerk-middleware-options.mdx new file mode 100644 index 00000000000..9514009e75d --- /dev/null +++ b/.typedoc/docs/nextjs/clerk-middleware-options.mdx @@ -0,0 +1,29 @@ +The `clerkMiddleware()` function accepts an optional object. The following options are available. + +## Properties + +| Property | Type | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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`. | +| `contentSecurityPolicy?` | `ContentSecurityPolicyOptions` | When set, automatically injects a Content-Security-Policy header(s) compatible with Clerk. | +| `debug?` | `boolean` | If true, additional debug information will be logged to the console. | +| `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/.typedoc/docs/nextjs/clerk-middleware.mdx b/.typedoc/docs/nextjs/clerk-middleware.mdx new file mode 100644 index 00000000000..a1913f86cd4 --- /dev/null +++ b/.typedoc/docs/nextjs/clerk-middleware.mdx @@ -0,0 +1 @@ +The `clerkMiddleware()` helper integrates Clerk authentication into your Next.js application through Middleware. `clerkMiddleware()` is compatible with both the App and Pages routers. diff --git a/.typedoc/docs/nextjs/create-async-get-auth.mdx b/.typedoc/docs/nextjs/create-async-get-auth.mdx new file mode 100644 index 00000000000..e598027e2ba --- /dev/null +++ b/.typedoc/docs/nextjs/create-async-get-auth.mdx @@ -0,0 +1,23 @@ +The async variant of our old `createGetAuth` allows for asynchronous code inside its callback. +Should be used with function like `auth()` that are already asynchronous. + +## Parameters + +| Parameter | Type | +| --------------------------------------- | ------------------------------------------------------------------------ | +| `__namedParameters` | \{ debugLoggerName: string; noAuthStatusMessage: string; \} | +| `__namedParameters.debugLoggerName` | `string` | +| `__namedParameters.noAuthStatusMessage` | `string` | + +## Returns + +### Parameters + +| 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 + +`Promise`\<[`AuthObject`](../backend/auth-object.mdx)\> diff --git a/.typedoc/docs/nextjs/create-sync-get-auth.mdx b/.typedoc/docs/nextjs/create-sync-get-auth.mdx new file mode 100644 index 00000000000..36f2647a57e --- /dev/null +++ b/.typedoc/docs/nextjs/create-sync-get-auth.mdx @@ -0,0 +1,24 @@ +Previous known as `createGetAuth`. We needed to create a sync and async variant in order to allow for improvements +that required dynamic imports (using `require` would not work). +It powers the synchronous top-level api `getAuth()`. + +## Parameters + +| Parameter | Type | +| --------------------------------------- | ------------------------------------------------------------------------ | +| `__namedParameters` | \{ debugLoggerName: string; noAuthStatusMessage: string; \} | +| `__namedParameters.debugLoggerName` | `string` | +| `__namedParameters.noAuthStatusMessage` | `string` | + +## Returns + +### Parameters + +| 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 + +SignedInAuthObject \| SignedOutAuthObject diff --git a/.typedoc/docs/nextjs/current-user.mdx b/.typedoc/docs/nextjs/current-user.mdx new file mode 100644 index 00000000000..14aea0c9d73 --- /dev/null +++ b/.typedoc/docs/nextjs/current-user.mdx @@ -0,0 +1,25 @@ +The `currentUser` helper returns the [Backend User](/docs/references/backend/types/backend-user) object of the currently active user. It can be used in Server Components, Route Handlers, and Server Actions. + +Under the hood, this helper: + +- calls `fetch()`, so it is automatically deduped per request. +- uses the [`GET /v1/users/{user_id}`](/docs/reference/backend-api/tag/Users#operation/GetUser) endpoint. +- counts towards the [Backend API request rate limit](/docs/backend-requests/resources/rate-limits). + +## Returns + +`Promise`\<null \| [User](../backend/user.mdx)\> + +## Example + +```tsx {{ filename: 'app/page.tsx' }} +import { currentUser } from '@clerk/nextjs/server'; + +export default async function Page() { + const user = await currentUser(); + + if (!user) return
Not signed in
; + + return
Hello {user?.firstName}
; +} +``` diff --git a/.typedoc/docs/nextjs/get-auth.mdx b/.typedoc/docs/nextjs/get-auth.mdx new file mode 100644 index 00000000000..ffbe591ae5f --- /dev/null +++ b/.typedoc/docs/nextjs/get-auth.mdx @@ -0,0 +1,78 @@ +The `getAuth()` helper retrieves authentication state from the request object. + +> [!NOTE] +> If you are using App Router, use the [`auth()` helper](/docs/references/nextjs/auth) instead. + +## Parameters + +| 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 + +SignedInAuthObject \| SignedOutAuthObject — The `Auth` object. See the [Auth +reference](/docs/references/backend/types/auth-object) for more information. + +## Examples + +### Protect API routes + +The following example demonstrates how to protect an API route by checking if the `userId` is present in the `getAuth()` response. + +```tsx {{ filename: 'app/api/example/route.ts' }} +import { getAuth } from '@clerk/nextjs/server'; +import type { NextApiRequest, NextApiResponse } from 'next'; + +export default async function handler(req: NextApiRequest, res: NextApiResponse) { + const { userId } = getAuth(req); + + if (!userId) { + return res.status(401).json({ error: 'Not authenticated' }); + } + + // Add logic that retrieves the data for the API route + + return res.status(200).json({ userId: userId }); +} +``` + +### Usage with `getToken()` + +`getAuth()` returns [`getToken()`](/docs/references/backend/types/auth-object#get-token), which is a method that returns the current user's session token or a custom JWT template. + +```tsx {{ filename: 'app/api/example/route.ts' }} +import { getAuth } from '@clerk/nextjs/server'; +import type { NextApiRequest, NextApiResponse } from 'next'; + +export default async function handler(req: NextApiRequest, res: NextApiResponse) { + const { getToken } = getAuth(req); + + const token = await getToken({ template: 'supabase' }); + + // Add logic that retrieves the data + // from your database using the token + + return res.status(200).json({}); +} +``` + +### Usage with `clerkClient` + +`clerkClient` is used to access the [Backend SDK](/docs/references/backend/overview), which exposes Clerk's Backend API resources. You can use `getAuth()` to pass authentication information that many of the Backend SDK methods require, like the user's ID. + +```tsx {{ filename: 'app/api/example/route.ts' }} +import { clerkClient, getAuth } from '@clerk/nextjs/server'; +import type { NextApiRequest, NextApiResponse } from 'next'; + +export default async function handler(req: NextApiRequest, res: NextApiResponse) { + const { userId } = getAuth(req); + + const client = await clerkClient(); + + const user = userId ? await client.users.getUser(userId) : null; + + return res.status(200).json({}); +} +``` diff --git a/.typedoc/docs/shared/api-url-from-publishable-key.mdx b/.typedoc/docs/shared/api-url-from-publishable-key.mdx new file mode 100644 index 00000000000..5ad7e89596c --- /dev/null +++ b/.typedoc/docs/shared/api-url-from-publishable-key.mdx @@ -0,0 +1,12 @@ +Get the correct API url based on the publishable key. + +## Parameters + +| Parameter | Type | Description | +| ---------------- | -------- | ----------------------------- | +| `publishableKey` | `string` | The publishable key to parse. | + +## Returns + +"https://api.lclclerk.com" \| "https://api.clerkstage.dev" \| "https://api.clerk.com" — One of Clerk's API +URLs. diff --git a/.typedoc/docs/shared/build-clerk-js-script-attributes.mdx b/.typedoc/docs/shared/build-clerk-js-script-attributes.mdx new file mode 100644 index 00000000000..eb0fbc9ae76 --- /dev/null +++ b/.typedoc/docs/shared/build-clerk-js-script-attributes.mdx @@ -0,0 +1,11 @@ +Builds an object of Clerk JS script attributes based on the provided options. + +## Parameters + +| Parameter | Type | Description | +| --------- | -------------------------- | -------------------------------------------------------- | +| `options` | `LoadClerkJsScriptOptions` | The options containing the values for script attributes. | + +## Returns + +`Record`\<`string`, `string`\> — An object containing data attributes to be applied to the script element. diff --git a/.typedoc/docs/shared/build-publishable-key.mdx b/.typedoc/docs/shared/build-publishable-key.mdx new file mode 100644 index 00000000000..2cd1ea56cbe --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/camel-to-snake.mdx b/.typedoc/docs/shared/camel-to-snake.mdx new file mode 100644 index 00000000000..8164e16a4df --- /dev/null +++ b/.typedoc/docs/shared/camel-to-snake.mdx @@ -0,0 +1,11 @@ +Converts a string from camelCase to snake_case. + +## Parameters + +| Parameter | Type | +| --------- | -------------------------------- | +| `str` | undefined \| string | + +## Returns + +`string` diff --git a/.typedoc/docs/shared/clerk-js-script-url.mdx b/.typedoc/docs/shared/clerk-js-script-url.mdx new file mode 100644 index 00000000000..d34c653bbef --- /dev/null +++ b/.typedoc/docs/shared/clerk-js-script-url.mdx @@ -0,0 +1,18 @@ +Generates a Clerk JS script URL based on the provided options. + +## Parameters + +| Parameter | Type | Description | +| --------- | -------------------------- | --------------------------------------------------------- | +| `opts` | `LoadClerkJsScriptOptions` | The options to use when building the Clerk JS script URL. | + +## Returns + +`string` — The complete URL to the Clerk JS script. + +## Example + +```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/.typedoc/docs/shared/clerk-runtime-error.mdx b/.typedoc/docs/shared/clerk-runtime-error.mdx new file mode 100644 index 00000000000..f87931bbc4f --- /dev/null +++ b/.typedoc/docs/shared/clerk-runtime-error.mdx @@ -0,0 +1,26 @@ +Custom error class for representing Clerk runtime errors. + +ClerkRuntimeError + +## Example + +```ts +throw new ClerkRuntimeError('An error occurred', { code: 'password_invalid' }); +``` + +## Properties + +| Property | Type | Description | Overrides | +| ------------------------------ | -------- | ------------------------------------------------------------------ | --------------- | +| `code` | `string` | A unique code identifying the error, can be used for localization. | - | +| `message` | `string` | The error message. | `Error.message` | + +## Methods + +### toString() + +Returns a string representation of the error. + +#### Returns + +`string` — A formatted string with the error name and message. diff --git a/.typedoc/docs/shared/create-dev-or-staging-url-cache.mdx b/.typedoc/docs/shared/create-dev-or-staging-url-cache.mdx new file mode 100644 index 00000000000..d0f1aeaeda3 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/create-path-matcher.mdx b/.typedoc/docs/shared/create-path-matcher.mdx new file mode 100644 index 00000000000..5fcfc7fed75 --- /dev/null +++ b/.typedoc/docs/shared/create-path-matcher.mdx @@ -0,0 +1,21 @@ +Creates a function that matches paths against a set of patterns. + +## Parameters + +| Parameter | Type | Description | +| ---------- | ------------------ | ------------------------------------------------------- | +| `patterns` | `PathMatcherParam` | A string, RegExp, or array of patterns to match against | + +## Returns + +A function that takes a pathname and returns true if it matches any of the patterns + +### Parameters + +| Parameter | Type | +| ---------- | -------- | +| `pathname` | `string` | + +### Returns + +`boolean` diff --git a/.typedoc/docs/shared/deep-camel-to-snake.mdx b/.typedoc/docs/shared/deep-camel-to-snake.mdx new file mode 100644 index 00000000000..08cd236e036 --- /dev/null +++ b/.typedoc/docs/shared/deep-camel-to-snake.mdx @@ -0,0 +1,13 @@ +Transforms camelCased objects/ arrays to snake_cased. +This function recursively traverses all objects and arrays of the passed value +camelCased keys are removed. + +## Parameters + +| Parameter | Type | +| --------- | ----- | +| `obj` | `any` | + +## Returns + +`any` diff --git a/.typedoc/docs/shared/deep-snake-to-camel.mdx b/.typedoc/docs/shared/deep-snake-to-camel.mdx new file mode 100644 index 00000000000..3ad646a85be --- /dev/null +++ b/.typedoc/docs/shared/deep-snake-to-camel.mdx @@ -0,0 +1,13 @@ +Transforms snake_cased objects/ arrays to camelCased. +This function recursively traverses all objects and arrays of the passed value +camelCased keys are removed. + +## Parameters + +| Parameter | Type | +| --------- | ----- | +| `obj` | `any` | + +## Returns + +`any` diff --git a/.typedoc/docs/shared/deprecated-object-property.mdx b/.typedoc/docs/shared/deprecated-object-property.mdx new file mode 100644 index 00000000000..611635bfb00 --- /dev/null +++ b/.typedoc/docs/shared/deprecated-object-property.mdx @@ -0,0 +1,21 @@ +Mark object property as deprecated. + +A console WARNING will be displayed when object property is being accessed. + +1. Deprecate object property + const obj = { something: 'aloha' }; + +deprecatedObjectProperty(obj, 'something', 'Use `somethingElse` instead.'); + +## Parameters + +| Parameter | Type | +| ---------- | --------------------------- | +| `obj` | `Record`\<`string`, `any`\> | +| `propName` | `string` | +| `warning` | `string` | +| `key?` | `string` | + +## Returns + +`void` diff --git a/.typedoc/docs/shared/derive-state.mdx b/.typedoc/docs/shared/derive-state.mdx new file mode 100644 index 00000000000..c5a89ed30bd --- /dev/null +++ b/.typedoc/docs/shared/derive-state.mdx @@ -0,0 +1,29 @@ +Derives authentication state based on the current rendering context (SSR or client-side). + +## Parameters + +| Parameter | Type | +| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `clerkOperational` | `boolean` | +| `state` | `Resources` | +| `initialState` | undefined \| 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; \}\> | + +## Returns + +\{ actor: undefined \| null \| \{ [x: string]: unknown; sub: string; \}; factorVerificationAge: null \| \[number, number\]; organization: undefined \| null \| [OrganizationResource](/docs/references/javascript/organization); orgId: undefined \| null \| string; orgPermissions: undefined \| null \| Autocomplete\[]; orgRole: undefined \| null \| string; orgSlug: undefined \| null \| string; session: undefined \| null \| [SignedInSessionResource](/docs/references/javascript/session); sessionClaims: undefined \| null \| JwtPayload; sessionId: undefined \| null \| string; sessionStatus: undefined \| "active" \| "pending"; user: undefined \| null \| [UserResource](/docs/references/javascript/user); userId: undefined \| null \| string; \} + +| Name | Type | +| ----------------------- | -------------------------------------------------------------------------------------------------- | +| `actor` | undefined \| null \| \{ [x: string]: unknown; sub: string; \} | +| `factorVerificationAge` | null \| \[number, number\] | +| `organization` | undefined \| null \| [OrganizationResource](/docs/references/javascript/organization) | +| `orgId` | undefined \| null \| string | +| `orgPermissions` | undefined \| null \| Autocomplete\[] | +| `orgRole` | undefined \| null \| string | +| `orgSlug` | undefined \| null \| string | +| `session` | undefined \| null \| [SignedInSessionResource](/docs/references/javascript/session) | +| `sessionClaims` | undefined \| null \| JwtPayload | +| `sessionId` | undefined \| null \| string | +| `sessionStatus` | undefined \| "active" \| "pending" | +| `user` | undefined \| null \| [UserResource](/docs/references/javascript/user) | +| `userId` | undefined \| null \| string | diff --git a/.typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx b/.typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx new file mode 100644 index 00000000000..3f8f20906e7 --- /dev/null +++ b/.typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx @@ -0,0 +1,13 @@ +Gets the **clerk_db_jwt JWT from either the hash or the search +Side effect: +Removes **clerk_db_jwt JWT from the URL (hash and searchParams) and updates the browser history + +## Parameters + +| Parameter | Type | +| --------- | ----- | +| `url` | `URL` | + +## Returns + +`string` diff --git a/.typedoc/docs/shared/fast-deep-merge-and-replace.mdx b/.typedoc/docs/shared/fast-deep-merge-and-replace.mdx new file mode 100644 index 00000000000..b07891dbf5c --- /dev/null +++ b/.typedoc/docs/shared/fast-deep-merge-and-replace.mdx @@ -0,0 +1,14 @@ +Merges 2 objects without creating new object references +The merged props will appear on the `target` object +If `target` already has a value for a given key it will not be overwritten + +## Parameters + +| Parameter | Type | +| --------- | ---------------------------------------------------- | +| `source` | undefined \| null \| Record\ | +| `target` | undefined \| null \| Record\ | + +## Returns + +`void` diff --git a/.typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx b/.typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx new file mode 100644 index 00000000000..4c846eea8c0 --- /dev/null +++ b/.typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx @@ -0,0 +1,14 @@ +Retrieve the clerk-js major tag using the major version from the pkgVersion +param or use the frontendApi to determine if the canary tag should be used. +The default tag is `latest`. + +## Parameters + +| Parameter | Type | +| ------------- | -------- | +| `frontendApi` | `string` | +| `version?` | `string` | + +## Returns + +`string` diff --git a/.typedoc/docs/shared/get-cookie-suffix.mdx b/.typedoc/docs/shared/get-cookie-suffix.mdx new file mode 100644 index 00000000000..ac115fcc8b1 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/get-env-variable.mdx b/.typedoc/docs/shared/get-env-variable.mdx new file mode 100644 index 00000000000..a60f14161bd --- /dev/null +++ b/.typedoc/docs/shared/get-env-variable.mdx @@ -0,0 +1,12 @@ +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. | + +## Returns + +`string` — The environment variable value or empty string if not found. diff --git a/.typedoc/docs/shared/get-non-undefined-values.mdx b/.typedoc/docs/shared/get-non-undefined-values.mdx new file mode 100644 index 00000000000..0d051136c43 --- /dev/null +++ b/.typedoc/docs/shared/get-non-undefined-values.mdx @@ -0,0 +1,11 @@ +Get all non-undefined values from an object. + +## Parameters + +| Parameter | Type | +| --------- | ---- | +| `obj` | `T` | + +## Returns + +`Partial`\<`T`\> diff --git a/.typedoc/docs/shared/get-script-url.mdx b/.typedoc/docs/shared/get-script-url.mdx new file mode 100644 index 00000000000..66218a1414c --- /dev/null +++ b/.typedoc/docs/shared/get-script-url.mdx @@ -0,0 +1,14 @@ +Retrieve the clerk-js script url from the frontendApi and the major tag +using the [getClerkJsMajorVersionOrTag](get-clerk-js-major-version-or-tag.mdx) or a provided clerkJSVersion tag. + +## Parameters + +| Parameter | Type | +| ----------------------------------- | ------------------------------------------- | +| `frontendApi` | `string` | +| `__namedParameters` | \{ clerkJSVersion?: string; \} | +| `__namedParameters.clerkJSVersion?` | `string` | + +## Returns + +`string` diff --git a/.typedoc/docs/shared/get-suffixed-cookie-name.mdx b/.typedoc/docs/shared/get-suffixed-cookie-name.mdx new file mode 100644 index 00000000000..f4f707d155e --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/icon-image-url.mdx b/.typedoc/docs/shared/icon-image-url.mdx new file mode 100644 index 00000000000..e0e3fbde62d --- /dev/null +++ b/.typedoc/docs/shared/icon-image-url.mdx @@ -0,0 +1,13 @@ +Returns the URL for a static image +using the new img.clerk.com service + +## Parameters + +| Parameter | Type | +| --------- | ---------------------------- | +| `id` | `string` | +| `format` | "svg" \| "jpeg" | + +## Returns + +`string` diff --git a/.typedoc/docs/shared/in-browser.mdx b/.typedoc/docs/shared/in-browser.mdx new file mode 100644 index 00000000000..e08842d7935 --- /dev/null +++ b/.typedoc/docs/shared/in-browser.mdx @@ -0,0 +1,5 @@ +Checks if the window object is defined. You can also use this to check if something is happening on the client side. + +## Returns + +`boolean` diff --git a/.typedoc/docs/shared/is-browser-online.mdx b/.typedoc/docs/shared/is-browser-online.mdx new file mode 100644 index 00000000000..a4f7d95040f --- /dev/null +++ b/.typedoc/docs/shared/is-browser-online.mdx @@ -0,0 +1,5 @@ +Checks if the current environment is a browser and if the navigator is online. + +## Returns + +`boolean` diff --git a/.typedoc/docs/shared/is-clerk-runtime-error.mdx b/.typedoc/docs/shared/is-clerk-runtime-error.mdx new file mode 100644 index 00000000000..6faae627914 --- /dev/null +++ b/.typedoc/docs/shared/is-clerk-runtime-error.mdx @@ -0,0 +1,24 @@ +Checks if the provided error object is an instance of ClerkRuntimeError. + +## Parameters + +| Parameter | Type | Description | +| --------- | ----- | -------------------------- | +| `err` | `any` | The error object to check. | + +## Returns + +`err is ClerkRuntimeError` — True if the error is a ClerkRuntimeError, false otherwise. + +## Example + +```ts +const error = new ClerkRuntimeError('An error occurred'); +if (isClerkRuntimeError(error)) { + // Handle ClerkRuntimeError + console.error('ClerkRuntimeError:', error.message); +} else { + // Handle other errors + console.error('Other error:', error.message); +} +``` diff --git a/.typedoc/docs/shared/is-development-from-publishable-key.mdx b/.typedoc/docs/shared/is-development-from-publishable-key.mdx new file mode 100644 index 00000000000..6d17f30a7d4 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/is-development-from-secret-key.mdx b/.typedoc/docs/shared/is-development-from-secret-key.mdx new file mode 100644 index 00000000000..6d2785217a4 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/is-ipv4-address.mdx b/.typedoc/docs/shared/is-ipv4-address.mdx new file mode 100644 index 00000000000..ae9f7620269 --- /dev/null +++ b/.typedoc/docs/shared/is-ipv4-address.mdx @@ -0,0 +1,11 @@ +Checks if a string is a valid IPv4 address. + +## Parameters + +| Parameter | Type | +| --------- | ---------------------------------------- | +| `str` | undefined \| null \| string | + +## Returns + +`boolean` — True if the string is a valid IPv4 address, false otherwise. diff --git a/.typedoc/docs/shared/is-production-from-publishable-key.mdx b/.typedoc/docs/shared/is-production-from-publishable-key.mdx new file mode 100644 index 00000000000..8aa8847074c --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/is-production-from-secret-key.mdx b/.typedoc/docs/shared/is-production-from-secret-key.mdx new file mode 100644 index 00000000000..289067ce0df --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/is-publishable-key.mdx b/.typedoc/docs/shared/is-publishable-key.mdx new file mode 100644 index 00000000000..b45694915b5 --- /dev/null +++ b/.typedoc/docs/shared/is-publishable-key.mdx @@ -0,0 +1,11 @@ +Checks if the provided key is a valid publishable key. + +## Parameters + +| Parameter | Type | Description | +| --------- | -------- | ------------------------------------------------------------------- | +| `key` | `string` | The key to be checked. Defaults to an empty string if not provided. | + +## Returns + +`boolean` — `true` if 'key' is a valid publishable key, `false` otherwise. diff --git a/.typedoc/docs/shared/is-staging.mdx b/.typedoc/docs/shared/is-staging.mdx new file mode 100644 index 00000000000..1491f1c9705 --- /dev/null +++ b/.typedoc/docs/shared/is-staging.mdx @@ -0,0 +1,11 @@ +Check if the frontendApi ends with a staging domain + +## Parameters + +| Parameter | Type | +| ------------- | -------- | +| `frontendApi` | `string` | + +## Returns + +`boolean` diff --git a/.typedoc/docs/shared/is-truthy.mdx b/.typedoc/docs/shared/is-truthy.mdx new file mode 100644 index 00000000000..9c9ea5413ba --- /dev/null +++ b/.typedoc/docs/shared/is-truthy.mdx @@ -0,0 +1,11 @@ +A function to determine if a value is truthy. + +## Parameters + +| Parameter | Type | +| --------- | --------- | +| `value` | `unknown` | + +## Returns + +`boolean` — True for `true`, true, positive numbers. False for `false`, false, 0, negative integers and anything else. diff --git a/.typedoc/docs/shared/is-valid-browser-online.mdx b/.typedoc/docs/shared/is-valid-browser-online.mdx new file mode 100644 index 00000000000..cbc8b340524 --- /dev/null +++ b/.typedoc/docs/shared/is-valid-browser-online.mdx @@ -0,0 +1,5 @@ +Runs `isBrowserOnline` and `isValidBrowser` to check if the current environment is a valid browser and if the navigator is online. + +## Returns + +`boolean` diff --git a/.typedoc/docs/shared/is-valid-browser.mdx b/.typedoc/docs/shared/is-valid-browser.mdx new file mode 100644 index 00000000000..5d89b5b376c --- /dev/null +++ b/.typedoc/docs/shared/is-valid-browser.mdx @@ -0,0 +1,5 @@ +Checks if the current environment is a browser and the user agent is not a bot. + +## Returns + +`boolean` diff --git a/.typedoc/docs/shared/isomorphic-atob.mdx b/.typedoc/docs/shared/isomorphic-atob.mdx new file mode 100644 index 00000000000..ed412ce6632 --- /dev/null +++ b/.typedoc/docs/shared/isomorphic-atob.mdx @@ -0,0 +1,12 @@ +A function that decodes a string of data which has been encoded using base-64 encoding. +Uses `atob` if available, otherwise uses `Buffer` from `global`. If neither are available, returns the data as-is. + +## Parameters + +| Parameter | Type | +| --------- | -------- | +| `data` | `string` | + +## Returns + +`string` diff --git a/.typedoc/docs/shared/load-clerk-js-script.mdx b/.typedoc/docs/shared/load-clerk-js-script.mdx new file mode 100644 index 00000000000..7719e2d7433 --- /dev/null +++ b/.typedoc/docs/shared/load-clerk-js-script.mdx @@ -0,0 +1,26 @@ +Hotloads the Clerk JS script with robust failure detection. + +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 + +| Parameter | Type | Description | +| --------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `opts?` | `LoadClerkJsScriptOptions` | The options used to build the Clerk JS script URL and load the script. Must include a `publishableKey` if no existing script is found. | + +## Returns + +`Promise`\<null \| HTMLScriptElement\> — Promise that resolves with null if Clerk loads successfully, or rejects with an error. + +## Example + +```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/.typedoc/docs/shared/pages-or-infinite-options.mdx b/.typedoc/docs/shared/pages-or-infinite-options.mdx new file mode 100644 index 00000000000..c2a7ab7b9c4 --- /dev/null +++ b/.typedoc/docs/shared/pages-or-infinite-options.mdx @@ -0,0 +1,4 @@ +| 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`. | diff --git a/.typedoc/docs/shared/paginated-hook-config.mdx b/.typedoc/docs/shared/paginated-hook-config.mdx new file mode 100644 index 00000000000..99f8acfd945 --- /dev/null +++ b/.typedoc/docs/shared/paginated-hook-config.mdx @@ -0,0 +1,4 @@ +| Name | Type | Description | +| ------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `infinite?` | `boolean` | If `true`, newly fetched data will be appended to the existing list rather than replacing it. Useful for implementing infinite scroll functionality. Defaults to `false`. | +| `keepPreviousData?` | `boolean` | If `true`, the previous data will be kept in the cache until new data is fetched. Defaults to `false`. | diff --git a/.typedoc/docs/shared/paginated-resources.mdx b/.typedoc/docs/shared/paginated-resources.mdx new file mode 100644 index 00000000000..a6608f7e55f --- /dev/null +++ b/.typedoc/docs/shared/paginated-resources.mdx @@ -0,0 +1,17 @@ +| Property | Type | Description | +| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `count` | `number` | The total count of data that exist remotely. | +| `data` | T[] | An array that contains the fetched data. For example, for the `memberships` attribute, data will be an array of [`OrganizationMembership`](/docs/references/javascript/types/organization-membership) objects. | +| `error` | null \| ClerkAPIResponseError | Clerk's API response error object. | +| `fetchNext` | () => void | A function that triggers the next page to be loaded. This is the same as `fetchPage(page => Math.min(pageCount, page + 1))`. | +| `fetchPage` | `ValueOrSetter`\<`number`\> | A function that triggers a specific page to be loaded. | +| `fetchPrevious` | () => void | A function that triggers the previous page to be loaded. This is the same as `fetchPage(page => Math.max(0, page - 1))`. | +| `hasNextPage` | `boolean` | A boolean that indicates if there are available pages to be fetched. | +| `hasPreviousPage` | `boolean` | A boolean that indicates if there are available pages to be fetched. | +| `isError` | `boolean` | A boolean that indicates the request failed. | +| `isFetching` | `boolean` | A boolean that is `true` if there is an ongoing request or a revalidation. | +| `isLoading` | `boolean` | A boolean that is `true` if there is an ongoing request and there is no fetched data. | +| `page` | `number` | The current page. | +| `pageCount` | `number` | The total amount of pages. It is calculated based on `count`, `initialPage`, and `pageSize`. | +| `revalidate` | () => Promise\ | A function that triggers a revalidation of the current page. | +| `setData` | `Infinite` _extends_ `true` ? `CacheSetter`\<(undefined \| [ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\)[]\> : `CacheSetter`\<undefined \| [ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\\> | A function that allows you to set the data manually. | diff --git a/.typedoc/docs/shared/parse-publishable-key.mdx b/.typedoc/docs/shared/parse-publishable-key.mdx new file mode 100644 index 00000000000..2c9e088ff79 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/read-json-file.mdx b/.typedoc/docs/shared/read-json-file.mdx new file mode 100644 index 00000000000..1c1c1061146 --- /dev/null +++ b/.typedoc/docs/shared/read-json-file.mdx @@ -0,0 +1,15 @@ +Read an expected JSON type File. + +Probably paired with: + + + +## Parameters + +| Parameter | Type | +| --------- | ------ | +| `file` | `File` | + +## Returns + +`Promise`\<`unknown`\> diff --git a/.typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx b/.typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx new file mode 100644 index 00000000000..765e4d63c97 --- /dev/null +++ b/.typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx @@ -0,0 +1,17 @@ +Sets the package name for error messages during ClerkJS script loading. + +## Parameters + +| Parameter | Type | Description | +| ------------- | -------- | ------------------------------------------------------------------------------ | +| `packageName` | `string` | The name of the package to use in error messages (e.g., '@clerk/clerk-react'). | + +## Returns + +`void` + +## Example + +```typescript +setClerkJsLoadingErrorPackageName('@clerk/clerk-react'); +``` diff --git a/.typedoc/docs/shared/snake-to-camel.mdx b/.typedoc/docs/shared/snake-to-camel.mdx new file mode 100644 index 00000000000..b860d97abee --- /dev/null +++ b/.typedoc/docs/shared/snake-to-camel.mdx @@ -0,0 +1,11 @@ +Converts a string from snake_case to camelCase. + +## Parameters + +| Parameter | Type | +| --------- | -------------------------------- | +| `str` | undefined \| string | + +## Returns + +`string` diff --git a/.typedoc/docs/shared/titleize.mdx b/.typedoc/docs/shared/titleize.mdx new file mode 100644 index 00000000000..9442d0c0c1c --- /dev/null +++ b/.typedoc/docs/shared/titleize.mdx @@ -0,0 +1,17 @@ +Converts the first character of a string to uppercase. + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------- | --------------------------- | +| `str` | undefined \| null \| string | The string to be converted. | + +## Returns + +`string` — The modified string with the rest of the string unchanged. + +## Example + +```ts +titleize('hello world'); // 'Hello world' +``` diff --git a/.typedoc/docs/shared/to-sentence.mdx b/.typedoc/docs/shared/to-sentence.mdx new file mode 100644 index 00000000000..ad4d413ed9d --- /dev/null +++ b/.typedoc/docs/shared/to-sentence.mdx @@ -0,0 +1,11 @@ +Convert words to a sentence. + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------- | ------------------------------- | +| `items` | string[] | An array of words to be joined. | + +## Returns + +`string` — A string with the items joined by a comma and the last item joined by ", or". diff --git a/.typedoc/docs/shared/use-clerk.mdx b/.typedoc/docs/shared/use-clerk.mdx new file mode 100644 index 00000000000..130acc124c9 --- /dev/null +++ b/.typedoc/docs/shared/use-clerk.mdx @@ -0,0 +1,43 @@ +> [!WARNING] +> This hook should only be used for advanced use cases, such as building a completely custom OAuth flow or as an escape hatch to access to the `Clerk` object. + +The `useClerk()` hook provides access to the [`Clerk`](/docs/references/javascript/clerk) object, allowing you to build alternatives to any Clerk Component. + +## Returns + +[Clerk](/docs/references/javascript/clerk) — The `useClerk()` hook returns the `Clerk` object, which includes all the methods and properties listed in the [`Clerk` reference](/docs/references/javascript/clerk). + +## Example + +The following example uses the `useClerk()` hook to access the `clerk` object. The `clerk` object is used to call the [`openSignIn()`](/docs/references/javascript/clerk#sign-in) method to open the sign-in modal. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useClerk } from '@clerk/clerk-react'; + +export default function Home() { + const clerk = useClerk(); + + return ; +} +``` + + + + +```tsx {{ filename: 'app/page.tsx' }} +'use client'; + +import { useClerk } from '@clerk/nextjs'; + +export default function HomePage() { + const clerk = useClerk(); + + return ; +} +``` + + + diff --git a/.typedoc/docs/shared/use-organization-list-params.mdx b/.typedoc/docs/shared/use-organization-list-params.mdx new file mode 100644 index 00000000000..592db3abc4f --- /dev/null +++ b/.typedoc/docs/shared/use-organization-list-params.mdx @@ -0,0 +1,5 @@ +| Property | Type | Description | +| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `userInvitations?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: "expired" \| "revoked" \| "pending" \| "accepted"; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the invitations by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| +| `userMemberships?` | true \| \{ initialPage?: number; pageSize?: number; \} & object & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • Any of the properties described in [Shared properties](#shared-properties).
| +| `userSuggestions?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: "pending" \| "accepted" \| ("pending" \| "accepted")[]; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the suggestions by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| diff --git a/.typedoc/docs/shared/use-organization-list-return.mdx b/.typedoc/docs/shared/use-organization-list-return.mdx new file mode 100644 index 00000000000..a6d6a3dc742 --- /dev/null +++ b/.typedoc/docs/shared/use-organization-list-return.mdx @@ -0,0 +1,8 @@ +| Property | Type | Description | +| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `createOrganization` | undefined \| ([CreateOrganizationParams](#create-organization-params)) => Promise\<[OrganizationResource](/docs/references/javascript/organization)\> | A function that returns a `Promise` which resolves to the newly created `Organization`. | +| `isLoaded` | `boolean` | A boolean that indicates whether Clerk has completed initialization and there is an authenticated user. Initially `false`, becomes `true` once Clerk loads with a user. | +| `setActive` | undefined \| ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session and/or organization. | +| `userInvitations` | PaginatedResourcesWithDefault\<[UserOrganizationInvitationResource](/docs/references/javascript/types/user-organization-invitation)\> \| [PaginatedResources](#paginated-resources)\<[UserOrganizationInvitationResource](/docs/references/javascript/types/user-organization-invitation), T\["userInvitations"\] _extends_ \{ infinite: true; \} ? true : false\> | Returns `PaginatedResources` which includes a list of the user's organization invitations. | +| `userMemberships` | PaginatedResourcesWithDefault\<[OrganizationMembershipResource](/docs/references/javascript/types/organization-membership)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationMembershipResource](/docs/references/javascript/types/organization-membership), T\["userMemberships"\] _extends_ \{ infinite: true; \} ? true : false\> | Returns `PaginatedResources` which includes a list of the user's organization memberships. | +| `userSuggestions` | PaginatedResourcesWithDefault\<[OrganizationSuggestionResource](/docs/references/javascript/types/organization-suggestion)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationSuggestionResource](/docs/references/javascript/types/organization-suggestion), T\["userSuggestions"\] _extends_ \{ infinite: true; \} ? true : false\> | Returns `PaginatedResources` which includes a list of suggestions for organizations that the user can join. | diff --git a/.typedoc/docs/shared/use-organization-list.mdx b/.typedoc/docs/shared/use-organization-list.mdx new file mode 100644 index 00000000000..d894fd4adcd --- /dev/null +++ b/.typedoc/docs/shared/use-organization-list.mdx @@ -0,0 +1,146 @@ +The `useOrganizationList()` hook provides access to the current user's organization memberships, invitations, and suggestions. It also includes methods for creating new organizations and managing the active organization. + +## Parameters + +| Parameter | Type | +| --------- | ---- | +| `params?` | `T` | + +## Returns + +[`UseOrganizationListReturn`](use-organization-list-return.mdx)\<`T`\> + +## Examples + +### Expanding and paginating attributes + +To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. So by default, the `userMemberships`, `userInvitations`, and `userSuggestions` attributes are not populated. You must pass true or an object with the desired properties to fetch and paginate the data. + +```tsx +// userMemberships.data will never be populated +const { userMemberships } = useOrganizationList(); + +// Use default values to fetch userMemberships, such as initialPage = 1 and pageSize = 10 +const { userMemberships } = useOrganizationList({ + userMemberships: true, +}); + +// Pass your own values to fetch userMemberships +const { userMemberships } = useOrganizationList({ + userMemberships: { + pageSize: 20, + initialPage: 2, // skips the first page + }, +}); + +// Aggregate pages in order to render an infinite list +const { userMemberships } = useOrganizationList({ + userMemberships: { + infinite: true, + }, +}); +``` + +### Infinite pagination + +The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `userMemberships` attribute will be populated with the first page of the user's organization memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. + +```tsx {{ filename: 'src/components/JoinedOrganizations.tsx' }} +import { useOrganizationList } from '@clerk/clerk-react'; +import React from 'react'; + +const JoinedOrganizations = () => { + const { isLoaded, setActive, userMemberships } = useOrganizationList({ + userMemberships: { + infinite: true, + }, + }); + + if (!isLoaded) { + return <>Loading; + } + + return ( + <> +
    + {userMemberships.data?.map(mem => ( +
  • + {mem.organization.name} + +
  • + ))} +
+ + + + ); +}; + +export default JoinedOrganizations; +``` + +### Simple pagination + +The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `userInvitations` attribute will be populated with the first page of invitations. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of invitations. + +Notice the difference between this example's pagination and the infinite pagination example above. + +```tsx {{ filename: 'src/components/UserInvitationsTable.tsx' }} +import { useOrganizationList } from '@clerk/clerk-react'; +import React from 'react'; + +const UserInvitationsTable = () => { + const { isLoaded, userInvitations } = useOrganizationList({ + userInvitations: { + infinite: true, + keepPreviousData: true, + }, + }); + + if (!isLoaded || userInvitations.isLoading) { + return <>Loading; + } + + return ( + <> + + + + + + + + + + {userInvitations.data?.map(inv => ( + + + + + ))} + +
EmailOrg name
{inv.emailAddress}{inv.publicOrganizationData.name}
+ + + + + ); +}; + +export default UserInvitationsTable; +``` diff --git a/.typedoc/docs/shared/use-organization-params.mdx b/.typedoc/docs/shared/use-organization-params.mdx new file mode 100644 index 00000000000..cfbb1bca26d --- /dev/null +++ b/.typedoc/docs/shared/use-organization-params.mdx @@ -0,0 +1,7 @@ +| Property | Type | Description | +| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `domains?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ enrollmentMode?: "manual_invitation" \| "automatic_invitation" \| "automatic_suggestion"; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `enrollmentMode`: A string that filters the domains by the provided [enrollment mode](/docs/organizations/verified-domains#enrollment-mode).
  • Any of the properties described in [Shared properties](#shared-properties).
| +| `invitations?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: ("expired" \| "revoked" \| "pending" \| "accepted")[]; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the invitations by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| +| `membershipRequests?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: "expired" \| "revoked" \| "pending" \| "accepted"; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the membership requests by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| +| `memberships?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ query?: string; role?: string[]; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `role`: An array of [`OrganizationCustomRoleKey`](/docs/references/javascript/types/organization-custom-role-key).
  • `query`: A string that filters the memberships by the provided string.
  • Any of the properties described in [Shared properties](#shared-properties).
| +| `subscriptions?` | true \| \{ initialPage?: number; pageSize?: number; \} & object & \{ orgId?: string; \} & \{ infinite?: boolean; keepPreviousData?: 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. If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `orgId`: A string that filters the subscriptions by the provided organization ID.
  • Any of the properties described in [Shared properties](#shared-properties).
| diff --git a/.typedoc/docs/shared/use-organization-return.mdx b/.typedoc/docs/shared/use-organization-return.mdx new file mode 100644 index 00000000000..db16c2a130b --- /dev/null +++ b/.typedoc/docs/shared/use-organization-return.mdx @@ -0,0 +1,10 @@ +| Property | Type | Description | +| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `domains` | null \| PaginatedResourcesWithDefault\<[OrganizationDomainResource](/docs/references/javascript/types/organization-domain)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationDomainResource](/docs/references/javascript/types/organization-domain), T\["membershipRequests"\] _extends_ \{ infinite: true; \} ? true : false\> | Includes a paginated list of the organization's domains. | +| `invitations` | null \| PaginatedResourcesWithDefault\<[OrganizationInvitationResource](/docs/references/javascript/types/organization-invitation)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationInvitationResource](/docs/references/javascript/types/organization-invitation), T\["invitations"\] _extends_ \{ infinite: true; \} ? true : false\> | Includes a paginated list of the organization's invitations. | +| `isLoaded` | `boolean` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `membership` | undefined \| null \| [OrganizationMembershipResource](/docs/references/javascript/types/organization-membership) | The current organization membership. | +| `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\<[CommerceSubscriptionItemResource](/docs/references/javascript/types/commerce-subscription-item-resource)\> \| [PaginatedResources](#paginated-resources)\<[CommerceSubscriptionItemResource](/docs/references/javascript/types/commerce-subscription-item-resource), 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/.typedoc/docs/shared/use-organization.mdx b/.typedoc/docs/shared/use-organization.mdx new file mode 100644 index 00000000000..bb92bf55245 --- /dev/null +++ b/.typedoc/docs/shared/use-organization.mdx @@ -0,0 +1,130 @@ +The `useOrganization()` hook retrieves attributes of the currently active organization. + +## Parameters + +| Parameter | Type | +| --------- | ---- | +| `params?` | `T` | + +## Returns + +[`UseOrganizationReturn`](use-organization-return.mdx)\<`T`\> + +## Examples + +### Expand and paginate attributes + +To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. By default, the `memberships`, `invitations`, `membershipRequests`, and `domains` attributes are not populated. You must pass `true` or an object with the desired properties to fetch and paginate the data. + +```tsx +// invitations.data will never be populated. +const { invitations } = useOrganization(); + +// Use default values to fetch invitations, such as initialPage = 1 and pageSize = 10 +const { invitations } = useOrganization({ + invitations: true, +}); + +// Pass your own values to fetch invitations +const { invitations } = useOrganization({ + invitations: { + pageSize: 20, + initialPage: 2, // skips the first page + }, +}); + +// Aggregate pages in order to render an infinite list +const { invitations } = useOrganization({ + invitations: { + infinite: true, + }, +}); +``` + +### Infinite pagination + +The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. + +```tsx +import { useOrganization } from '@clerk/clerk-react' + +export default function MemberList() { + const { memberships } = useOrganization({ + memberships: { + infinite: true, // Append new data to the existing list + keepPreviousData: true, // Persist the cached data until the new data has been fetched + }, + }) + + if (!memberships) { + // Handle loading state + return null + } + + return ( +
+

Organization members

+
    + {memberships.data?.map((membership) => ( +
  • + {membership.publicUserData.firstName} {membership.publicUserData.lastName} < + {membership.publicUserData.identifier}> :: {membership.role} +
  • + ))} +
+ + +
+ ) +} +``` + +### Simple pagination + +The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of memberships. + +Notice the difference between this example's pagination and the infinite pagination example above. + +```tsx +import { useOrganization } from '@clerk/clerk-react' + +export default function MemberList() { + const { memberships } = useOrganization({ + memberships: { + keepPreviousData: true, // Persist the cached data until the new data has been fetched + }, + }) + + if (!memberships) { + // Handle loading state + return null + } + + return ( +
+

Organization members

+
    + {memberships.data?.map((membership) => ( +
  • + {membership.publicUserData.firstName} {membership.publicUserData.lastName} < + {membership.publicUserData.identifier}> :: {membership.role} +
  • + ))} +
+ + + + +
+ ) +} +``` diff --git a/.typedoc/docs/shared/use-reverification.mdx b/.typedoc/docs/shared/use-reverification.mdx new file mode 100644 index 00000000000..a9dc76aff33 --- /dev/null +++ b/.typedoc/docs/shared/use-reverification.mdx @@ -0,0 +1,54 @@ +> [!WARNING] +> +> Depending on the SDK you're using, this feature requires `@clerk/nextjs@6.12.7` or later, `@clerk/clerk-react@5.25.1` or later, and `@clerk/clerk-js@5.57.1` or later. + +The `useReverification()` hook is used to handle a session's reverification flow. If a request requires reverification, a modal will display, prompting the user to verify their credentials. Upon successful verification, the original request will automatically retry. + +## Parameters + +| Parameter | Type | +| ---------- | --------- | +| `fetcher` | `Fetcher` | +| `options?` | `Options` | + +## Returns + +`UseReverificationResult`\<`Fetcher`\> — The `useReverification()` hook returns an array with the "enhanced" fetcher. + +## Example + +### Handle cancellation of the reverification process + +The following example demonstrates how to handle scenarios where a user cancels the reverification flow, such as closing the modal, which might result in `myData` being `null`. + +In the following example, `myFetcher` would be a function in your backend that fetches data from the route that requires reverification. See the [guide on how to require reverification](/docs/guides/reverification) for more information. + +```tsx {{ filename: 'src/components/MyButton.tsx' }} +import { useReverification } from '@clerk/clerk-react'; +import { isReverificationCancelledError } from '@clerk/clerk-react/error'; + +type MyData = { + balance: number; +}; + +export function MyButton() { + const fetchMyData = () => fetch('/api/balance').then(res => res.json() as Promise); + const enhancedFetcher = useReverification(fetchMyData); + + const handleClick = async () => { + try { + const myData = await enhancedFetcher(); + // ^ is types as `MyData` + } catch (e) { + // Handle error returned from the fetcher here + + // You can also handle cancellation with the following + if (isReverificationCancelledError(err)) { + // Handle the cancellation error here + } + } + }; + + return ; +} +``` diff --git a/.typedoc/docs/shared/use-session-list.mdx b/.typedoc/docs/shared/use-session-list.mdx new file mode 100644 index 00000000000..778f89720ee --- /dev/null +++ b/.typedoc/docs/shared/use-session-list.mdx @@ -0,0 +1,77 @@ +The `useSessionList()` hook returns an array of [`Session`](/docs/references/javascript/session) objects that have been registered on the client device. + +## 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. + + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `sessions` | `undefined` | A list of sessions that have been registered on the client device. | +| `setActive` | `undefined` | A function that sets the active session and/or organization. | + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `sessions` | [SessionResource](/docs/references/javascript/session)[] | A list of sessions that have been registered on the client device. | +| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session and/or organization. | + + + +## Example + +### Get a list of sessions + +The following example uses `useSessionList()` to get a list of sessions that have been registered on the client device. The `sessions` property is used to show the number of times the user has visited the page. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useSessionList } from '@clerk/clerk-react'; + +export default function Home() { + const { isLoaded, sessions } = useSessionList(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return ( +
+

Welcome back. You've been here {sessions.length} times before.

+
+ ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +'use client'; + +import { useSessionList } from '@clerk/nextjs'; + +export default function HomePage() { + const { isLoaded, sessions } = useSessionList(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return ( +
+

Welcome back. You've been here {sessions.length} times before.

+
+ ); +} +``` + +
+
diff --git a/.typedoc/docs/shared/use-session.mdx b/.typedoc/docs/shared/use-session.mdx new file mode 100644 index 00000000000..0ace96d5bc6 --- /dev/null +++ b/.typedoc/docs/shared/use-session.mdx @@ -0,0 +1,89 @@ +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. + +## 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. + + + + | Name | Type | Description | | ------ | ------ | ------ | | `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 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 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` | `boolean` + | A boolean that indicates whether a user is currently signed in. | | `session` | + [`SignedInSessionResource`](/docs/references/javascript/session) | The current session for the user. | + + + +## Example + +### Access the `Session` object + +The following example uses the `useSession()` hook to access the `Session` object, which has the `lastActiveAt` property. The `lastActiveAt` property is a `Date` object used to show the time the session was last active. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useSession } from '@clerk/clerk-react'; + +export default function Home() { + const { isLoaded, session, isSignedIn } = useSession(); + + if (!isLoaded) { + // Handle loading state + return null; + } + if (!isSignedIn) { + // Handle signed out state + return null; + } + + return ( +
+

This session has been active since {session.lastActiveAt.toLocaleString()}

+
+ ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +'use client'; + +import { useSession } from '@clerk/nextjs'; + +export default function HomePage() { + const { isLoaded, session, isSignedIn } = useSession(); + + if (!isLoaded) { + // Handle loading state + return null; + } + if (!isSignedIn) { + // Handle signed out state + return null; + } + + return ( +
+

This session has been active since {session.lastActiveAt.toLocaleString()}

+
+ ); +} +``` + +
+
diff --git a/.typedoc/docs/shared/use-user.mdx b/.typedoc/docs/shared/use-user.mdx new file mode 100644 index 00000000000..d8d08b7ab26 --- /dev/null +++ b/.typedoc/docs/shared/use-user.mdx @@ -0,0 +1,208 @@ +The `useUser()` hook provides access to the current user's [`User`](/docs/references/javascript/user) object, which contains all the data for a single user in your application and provides methods to manage their account. This hook also allows you to check if the user is signed in and if Clerk has loaded and initialized. + +## 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. + + + + | Name | Type | Description | | ------ | ------ | ------ | | `isLoaded` | `false` | A boolean that indicates whether + Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | | `isSignedIn` | + `undefined` | A boolean that returns `true` if the user is signed in. | | `user` | `undefined` | The `User` object + for the current 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 returns `true` if the user is signed in. | | `user` | `null` | The `User` object for the current + 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 returns `true` if the user is signed in. | | `user` | + [`UserResource`](/docs/references/javascript/user) | The `User` object for the current user. | + + + +## Examples + +### Get the current user + +The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which contains the current user's data such as their full name. The `isLoaded` and `isSignedIn` properties are used to handle the loading state and to check if the user is signed in, respectively. + +```tsx {{ filename: 'src/Example.tsx' }} +export default function Example() { + const { isSignedIn, user, isLoaded } = useUser(); + + if (!isLoaded) { + return
Loading...
; + } + + if (!isSignedIn) { + return
Sign in to view this page
; + } + + return
Hello {user.firstName}!
; +} +``` + +### Update user data + +The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`update()`](/docs/references/javascript/user#update) method to update the current user's information. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useUser } from '@clerk/clerk-react'; + +export default function Home() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + await user.update({ + firstName: 'John', + lastName: 'Doe', + }); + }; + + return ( + <> + +

user.firstName: {user?.firstName}

+

user.lastName: {user?.lastName}

+ + ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +'use client'; + +import { useUser } from '@clerk/nextjs'; + +export default function HomePage() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + await user.update({ + firstName: 'John', + lastName: 'Doe', + }); + }; + + return ( + <> + +

user.firstName: {user?.firstName}

+

user.lastName: {user?.lastName}

+ + ); +} +``` + +
+
+ +### Reload user data + +The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`reload()`](/docs/references/javascript/user#reload) method to get the latest user's information. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useUser } from '@clerk/clerk-react'; + +export default function Home() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + // Update data via an API endpoint + const updateMetadata = await fetch('/api/updateMetadata'); + + // Check if the update was successful + if (updateMetadata.message !== 'success') { + throw new Error('Error updating'); + } + + // If the update was successful, reload the user data + await user.reload(); + }; + + return ( + <> + +

user role: {user?.publicMetadata.role}

+ + ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +'use client'; + +import { useUser } from '@clerk/nextjs'; + +export default function HomePage() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + // Update data via an API endpoint + const updateMetadata = await fetch('/api/updateMetadata'); + + // Check if the update was successful + if (updateMetadata.message !== 'success') { + throw new Error('Error updating'); + } + + // If the update was successful, reload the user data + await user.reload(); + }; + + return ( + <> + +

user role: {user?.publicMetadata.role}

+ + ); +} +``` + +
+
diff --git a/.typedoc/docs/shared/user-agent-is-robot.mdx b/.typedoc/docs/shared/user-agent-is-robot.mdx new file mode 100644 index 00000000000..fada624f70e --- /dev/null +++ b/.typedoc/docs/shared/user-agent-is-robot.mdx @@ -0,0 +1,11 @@ +Checks if the user agent is a bot. + +## Parameters + +| Parameter | Type | Description | +| ----------- | -------- | --------------------- | +| `userAgent` | `string` | Any user agent string | + +## Returns + +`boolean` diff --git a/.typedoc/docs/shared/version-selector.mdx b/.typedoc/docs/shared/version-selector.mdx new file mode 100644 index 00000000000..f40c7058ab1 --- /dev/null +++ b/.typedoc/docs/shared/version-selector.mdx @@ -0,0 +1,17 @@ +This version selector is a bit complicated, so here is the flow: + +1. Use the clerkJSVersion prop on the provider +2. Use the exact `@clerk/clerk-js` version if it is a `@snapshot` prerelease +3. Use the prerelease tag of `@clerk/clerk-js` or the packageVersion provided +4. Fallback to the major version of `@clerk/clerk-js` or the packageVersion provided + +## Parameters + +| Parameter | Type | Description | +| ---------------- | -------------------------------- | ----------------------------------------------------------------------------------------- | +| `clerkJSVersion` | undefined \| string | The optional clerkJSVersion prop on the provider | +| `packageVersion` | `string` | The version of `@clerk/clerk-js` that will be used if an explicit version is not provided | + +## Returns + +`string` — The npm tag, version or major version to use diff --git a/.typedoc/docs/types/act-claim.mdx b/.typedoc/docs/types/act-claim.mdx new file mode 100644 index 00000000000..3de8a4c99a4 --- /dev/null +++ b/.typedoc/docs/types/act-claim.mdx @@ -0,0 +1 @@ +JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). diff --git a/.typedoc/docs/types/act-jwt-claim.mdx b/.typedoc/docs/types/act-jwt-claim.mdx new file mode 100644 index 00000000000..33ad615eb64 --- /dev/null +++ b/.typedoc/docs/types/act-jwt-claim.mdx @@ -0,0 +1,5 @@ +JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). + +## Deprecated + +Use `ActClaim` instead. diff --git a/.typedoc/docs/types/active-session-resource.mdx b/.typedoc/docs/types/active-session-resource.mdx new file mode 100644 index 00000000000..ea2985b809f --- /dev/null +++ b/.typedoc/docs/types/active-session-resource.mdx @@ -0,0 +1,33 @@ +Represents a session resource that has completed all pending tasks +and authentication factors + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `end` | () => Promise\<[SessionResource](/docs/references/javascript/session)\> | Marks the session as ended. The session will no longer be active for this `Client` and its status will become **ended**. | - | +| `factorVerificationAge` | null \| \[number, number\] | An array where each item represents the number of minutes since the last verification of a first or second factor: `[firstFactorAge, secondFactorAge]`. | - | +| `id` | `string` | The unique identifier for the session. | - | +| `pathRoot` | `string` | The root path of the resource. | - | +| `status` | `"active"` | The current state of the session. | [`SessionResource`](/docs/references/javascript/session).[`status`](/docs/references/javascript/session#status) | +| `user` | [`UserResource`](/docs/references/javascript/user) | The user associated with the session. | [`SessionResource`](/docs/references/javascript/session).[`user`](/docs/references/javascript/session#user) | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`ActiveSessionResource`\> + +#### Inherited from + +[`SessionResource`](/docs/references/javascript/session).[`reload`](/docs/references/javascript/session#reload) diff --git a/.typedoc/docs/types/add-payment-source-params.mdx b/.typedoc/docs/types/add-payment-source-params.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/cancel-subscription-params.mdx b/.typedoc/docs/types/cancel-subscription-params.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/check-authorization-fn.mdx b/.typedoc/docs/types/check-authorization-fn.mdx new file mode 100644 index 00000000000..cbec4ba71ef --- /dev/null +++ b/.typedoc/docs/types/check-authorization-fn.mdx @@ -0,0 +1,9 @@ +## Parameters + +| Parameter | Type | +| -------------------- | -------- | +| `isAuthorizedParams` | `Params` | + +## Returns + +`boolean` diff --git a/.typedoc/docs/types/check-authorization-from-session-claims.mdx b/.typedoc/docs/types/check-authorization-from-session-claims.mdx new file mode 100644 index 00000000000..f7357cd71cb --- /dev/null +++ b/.typedoc/docs/types/check-authorization-from-session-claims.mdx @@ -0,0 +1,13 @@ +Type guard for server-side authorization checks using session claims. +System permissions are not allowed since they are not included +in session claims and cannot be verified on the server side. + +## Parameters + +| Parameter | Type | +| -------------------- | -------------------------------------------------------------------------------------------------------- | +| `isAuthorizedParams` | [`CheckAuthorizationParamsFromSessionClaims`](check-authorization-params-from-session-claims.mdx)\<`P`\> | + +## Returns + +`boolean` diff --git a/.typedoc/docs/types/check-authorization-params-from-session-claims.mdx b/.typedoc/docs/types/check-authorization-params-from-session-claims.mdx new file mode 100644 index 00000000000..5299e174317 --- /dev/null +++ b/.typedoc/docs/types/check-authorization-params-from-session-claims.mdx @@ -0,0 +1,9 @@ +## Properties + +| Property | Type | Description | +| --------------------------------------------- | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `feature?` | `Autocomplete`\< user:${string} \| org:${string} \> | The [feature](/docs/billing/overview) to check for. | +| `permission?` | `DisallowSystemPermissions`\<`P`\> | The [permission](/docs/organizations/roles-permissions) to check for. | +| `plan?` | `Autocomplete`\< user:${string} \| org:${string} \> | The [plan](/docs/billing/overview) to check for. | +| `reverification?` | [`ReverificationConfig`](reverification-config.mdx) | The reverification configuration to check for. This feature is currently in public beta. **It is not recommended for production use.** | +| `role?` | `string` | The [role](/docs/organizations/roles-permissions) to check for. | diff --git a/.typedoc/docs/types/check-authorization-with-custom-permissions.mdx b/.typedoc/docs/types/check-authorization-with-custom-permissions.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/clerk-api-error.mdx b/.typedoc/docs/types/clerk-api-error.mdx new file mode 100644 index 00000000000..63a5b74ea7b --- /dev/null +++ b/.typedoc/docs/types/clerk-api-error.mdx @@ -0,0 +1,24 @@ +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[]; 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/.typedoc/docs/types/clerk-api-response-error.mdx b/.typedoc/docs/types/clerk-api-response-error.mdx new file mode 100644 index 00000000000..b2f65c266de --- /dev/null +++ b/.typedoc/docs/types/clerk-api-response-error.mdx @@ -0,0 +1 @@ +Interface representing a Clerk API Response Error. diff --git a/.typedoc/docs/types/clerk-host-router.mdx b/.typedoc/docs/types/clerk-host-router.mdx new file mode 100644 index 00000000000..c94fdb43453 --- /dev/null +++ b/.typedoc/docs/types/clerk-host-router.mdx @@ -0,0 +1 @@ +This type represents a generic router interface that Clerk relies on to interact with the host router. diff --git a/.typedoc/docs/types/clerk-jwt-claims.mdx b/.typedoc/docs/types/clerk-jwt-claims.mdx new file mode 100644 index 00000000000..4aab45ad6c6 --- /dev/null +++ b/.typedoc/docs/types/clerk-jwt-claims.mdx @@ -0,0 +1,28 @@ +Clerk-issued JWT payload + +## Deprecated + +Use `JwtPayload` instead. + +## Indexable + +\[`propName`: `string`\]: `unknown` + +Any other JWT Claim Set member. + +## Properties + +| Property | Type | Description | +| ------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| ~~`act?`~~ | \{ [x: string]: unknown; sub: string; \} | JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). | +| `act.sub` | `string` | - | +| ~~`azp?`~~ | `string` | JWT Authorized party - [RFC7800#section-3](https://tools.ietf.org/html/rfc7800#section-3). | +| ~~`exp`~~ | `number` | JWT Expiration Time - [RFC7519#section-4.1.4](https://tools.ietf.org/html/rfc7519#section-4.1.4). | +| ~~`iat`~~ | `number` | JWT Issued At - [RFC7519#section-4.1.6](https://tools.ietf.org/html/rfc7519#section-4.1.6). | +| ~~`iss`~~ | `string` | JWT Issuer - [RFC7519#section-4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1). | +| ~~`nbf`~~ | `number` | JWT Not Before - [RFC7519#section-4.1.5](https://tools.ietf.org/html/rfc7519#section-4.1.5). | +| ~~`org_id?`~~ | `string` | Active organization ID. | +| ~~`org_role?`~~ | `string` | Active organization role. | +| ~~`org_slug?`~~ | `string` | Active organization slug. | +| ~~`sid`~~ | `string` | Session ID | +| ~~`sub`~~ | `string` | JWT Subject - [RFC7519#section-4.1.2](https://tools.ietf.org/html/rfc7519#section-4.1.2). | diff --git a/.typedoc/docs/types/clerk-paginated-response.mdx b/.typedoc/docs/types/clerk-paginated-response.mdx new file mode 100644 index 00000000000..bd31a7df330 --- /dev/null +++ b/.typedoc/docs/types/clerk-paginated-response.mdx @@ -0,0 +1,11 @@ +An interface that describes the response of a method that returns a paginated list of resources. + +> [!TIP] +> Clerk's SDKs always use `Promise>`. If the promise resolves, you will get back the properties. If the promise is rejected, you will receive a `ClerkAPIResponseError` or network error. + +## Properties + +| Property | Type | Description | +| -------------------------------------- | ---------------- | -------------------------------------------- | +| `data` | T[] | An array that contains the fetched data. | +| `total_count` | `number` | The total count of data that exist remotely. | diff --git a/.typedoc/docs/types/clerk-pagination-params.mdx b/.typedoc/docs/types/clerk-pagination-params.mdx new file mode 100644 index 00000000000..70057fdc8c9 --- /dev/null +++ b/.typedoc/docs/types/clerk-pagination-params.mdx @@ -0,0 +1,6 @@ +## Properties + +| 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`. | diff --git a/.typedoc/docs/types/clerk-pagination-request.mdx b/.typedoc/docs/types/clerk-pagination-request.mdx new file mode 100644 index 00000000000..e7b59556cc0 --- /dev/null +++ b/.typedoc/docs/types/clerk-pagination-request.mdx @@ -0,0 +1,8 @@ +Pagination params in request + +## Type declaration + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------- | +| `limit?` | `number` | Maximum number of items returned per request. | +| `offset?` | `number` | This is the starting point for your fetched results. | diff --git a/.typedoc/docs/types/clerk-resource.mdx b/.typedoc/docs/types/clerk-resource.mdx new file mode 100644 index 00000000000..639c609d8c0 --- /dev/null +++ b/.typedoc/docs/types/clerk-resource.mdx @@ -0,0 +1,24 @@ +Defines common properties and methods that all Clerk resources must implement. + +## Properties + +| Property | Type | Description | +| -------------------------------- | -------- | -------------------------------------- | +| `id?` | `string` | The unique identifier of the resource. | +| `pathRoot` | `string` | The root path of the resource. | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`ClerkResource`\> diff --git a/.typedoc/docs/types/clerk-status.mdx b/.typedoc/docs/types/clerk-status.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/clerk.mdx b/.typedoc/docs/types/clerk.mdx new file mode 100644 index 00000000000..fff118bd1d0 --- /dev/null +++ b/.typedoc/docs/types/clerk.mdx @@ -0,0 +1,332 @@ +Main Clerk SDK object. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `__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_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` | `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`](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. | +| `closeOrganizationProfile` | () => void | Closes the Clerk OrganizationProfile modal. | +| `closeSignIn` | () => void | Closes the Clerk SignIn modal. | +| `closeSignUp` | () => void | Closes the Clerk SignUp modal. | +| `closeUserProfile` | () => void | Closes the Clerk UserProfile modal. | +| `closeWaitlist` | () => void | Closes the Clerk Waitlist modal. | +| `createOrganization` | (params) => Promise\<[OrganizationResource](/docs/references/javascript/organization)\> | Creates an organization, adding the current user as admin. | +| `domain` | `string` | Clerk Satellite Frontend API string. | +| `getOrganization` | (organizationId) => Promise\<[OrganizationResource](/docs/references/javascript/organization)\> | Retrieves a single organization by id. | +| `handleEmailLinkVerification` | (params, customNavigate?) => Promise\ | Completes a Email Link flow started by Clerk.client.signIn.createEmailLinkFlow or Clerk.client.signUp.createEmailLinkFlow | +| `handleGoogleOneTapCallback` | (signInOrUp, params, customNavigate?) => Promise\ | Completes a Google One Tap redirection flow started by [Clerk.authenticateWithGoogleOneTap](#authenticatewithgoogleonetap) | +| `handleRedirectCallback` | (params, customNavigate?) => Promise\ | Completes an OAuth or SAML redirection flow started by Clerk.client.signIn.authenticateWithRedirect or Clerk.client.signUp.authenticateWithRedirect | +| `handleUnauthenticated` | () => Promise\ | Handles a 401 response from Frontend API by refreshing the client and session object accordingly | +| `instanceType` | undefined \| InstanceType | Clerk Instance type is defined from the Publishable key | +| `isSatellite` | `boolean` | Clerk Flag for satellite apps. | +| `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. | +| `mountOrganizationSwitcher` | (targetNode, props?) => void | Mount an organization switcher component at the target element. | +| `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. | +| `navigate` | `CustomNavigation` | Function used to commit a navigation after certain steps in the Clerk processes. | +| `off` | `OffEventListener` | Removes an event handler for a specific Clerk event. **Param** The event name to unsubscribe from **Param** The callback function to remove | +| `on` | `OnEventListener` | Registers an event handler for a specific Clerk event. **Param** The event name to subscribe to **Param** The callback function to execute when the event is dispatched **Param** Optional configuration object **Param** If true and the event was previously dispatched, handler will be called immediately with the latest payload | +| `openCreateOrganization` | (props?) => void | Opens the Clerk CreateOrganization modal. | +| `openGoogleOneTap` | (props?) => void | Opens the Google One Tap component. | +| `openOrganizationProfile` | (props?) => void | Opens the Clerk OrganizationProfile modal. | +| `openSignIn` | (props?) => void | Opens the Clerk SignIn component in a modal. | +| `openSignUp` | (props?) => void | Opens the Clerk SignUp component in a modal. | +| `openUserProfile` | (props?) => void | Opens the Clerk UserProfile modal. | +| `openWaitlist` | (props?) => void | Opens the Clerk Waitlist modal. | +| `organization` | undefined \| null \| [OrganizationResource](/docs/references/javascript/organization) | Active Organization | +| `proxyUrl` | undefined \| string | Clerk Proxy url string. | +| `publishableKey` | `string` | Clerk Publishable Key string. | +| `redirectToAfterSignIn` | () => void | Redirects to the configured afterSignIn URL. | +| `redirectToAfterSignOut` | () => void | Redirects to the configured afterSignOut URL. | +| `redirectToAfterSignUp` | () => void | Redirects to the configured afterSignUp URL. | +| `redirectToCreateOrganization` | () => Promise\ | Redirects to the configured URL where `` is mounted. | +| `redirectToOrganizationProfile` | () => Promise\ | Redirects to the configured URL where `` is mounted. | +| `redirectToUserProfile` | () => Promise\ | Redirects to the configured URL where `` is mounted. | +| `redirectToWaitlist` | () => void | Redirects to the configured URL where `` is mounted. | +| `sdkMetadata` | undefined \| \{ environment?: string; name: string; version: string; \} | If present, contains information about the SDK that the host application is using. For example, if Clerk is loaded through `@clerk/nextjs`, this would be `{ name: '@clerk/nextjs', version: '1.0.0' }` | +| `session` | undefined \| null \| [SignedInSessionResource](/docs/references/javascript/session) | Current Session. | +| `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. | +| `unmountOrganizationSwitcher` | (targetNode) => void | Unmount the organization profile component from the target node.\* | +| `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. | +| `user` | undefined \| null \| [UserResource](/docs/references/javascript/user) | Current User. | +| `version` | undefined \| string | Clerk SDK version number. | + +## Methods + +### buildAfterMultiSessionSingleSignOutUrl() + +Returns the configured afterMultiSessionSingleSignOutUrl of the instance. + +#### Returns + +`string` + +--- + +### buildAfterSignInUrl() + +Returns the configured afterSignInUrl of the instance. + +#### Parameters + +| Parameter | Type | +| --------------------------- | -------------------------------------------- | +| `__namedParameters?` | \{ params?: URLSearchParams; \} | +| `__namedParameters.params?` | `URLSearchParams` | + +#### Returns + +`string` + +--- + +### buildAfterSignOutUrl() + +Returns the configured afterSignOutUrl of the instance. + +#### Returns + +`string` + +--- + +### buildAfterSignUpUrl() + +Returns the configured afterSignInUrl of the instance. + +#### Parameters + +| Parameter | Type | +| --------------------------- | -------------------------------------------- | +| `__namedParameters?` | \{ params?: URLSearchParams; \} | +| `__namedParameters.params?` | `URLSearchParams` | + +#### Returns + +`string` + +--- + +### buildCreateOrganizationUrl() + +Returns the configured url where `` is mounted or a custom create-organization page is rendered. + +#### Returns + +`string` + +--- + +### buildNewSubscriptionRedirectUrl() + +Returns the configured newSubscriptionRedirectUrl of the instance. + +#### Returns + +`string` + +--- + +### buildOrganizationProfileUrl() + +Returns the configured url where `` is mounted or a custom organization-profile page is rendered. + +#### Returns + +`string` + +--- + +### buildSignInUrl() + +Returns the configured url where `` is mounted or a custom sign-in page is rendered. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ----------------------------------------- | ------------------------------------------------ | +| `opts?` | [`RedirectOptions`](redirect-options.mdx) | A [RedirectOptions](redirect-options.mdx) object | + +#### Returns + +`string` + +--- + +### buildSignUpUrl() + +Returns the configured url where `` is mounted or a custom sign-up page is rendered. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ----------------------------------------- | ------------------------------------------------ | +| `opts?` | [`RedirectOptions`](redirect-options.mdx) | A [RedirectOptions](redirect-options.mdx) object | + +#### Returns + +`string` + +--- + +### buildTasksUrl() + +Returns the configured url where tasks are mounted. + +#### Returns + +`string` + +--- + +### buildUrlWithAuth() + +Decorates the provided url with the auth token for development instances. + +#### Parameters + +| Parameter | Type | +| --------- | -------- | +| `to` | `string` | + +#### Returns + +`string` + +--- + +### buildUserProfileUrl() + +Returns the url where `` is mounted or a custom user-profile page is rendered. + +#### Returns + +`string` + +--- + +### buildWaitlistUrl() + +Returns the configured url where `` is mounted or a custom waitlist page is rendered. + +#### Parameters + +| Parameter | Type | +| --------------------- | ------------------------------------------------------------ | +| `opts?` | \{ initialValues?: Record\; \} | +| `opts.initialValues?` | `Record`\<`string`, `string`\> | + +#### Returns + +`string` + +--- + +### redirectToSignIn() + +Redirects to the configured URL where `` is mounted. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ----------------------- | ------------------------------------------------ | +| `opts?` | `SignInRedirectOptions` | A [RedirectOptions](redirect-options.mdx) object | + +#### Returns + +`Promise`\<`unknown`\> + +--- + +### redirectToSignUp() + +Redirects to the configured URL where `` is mounted. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ----------------------- | ------------------------------------------------ | +| `opts?` | `SignUpRedirectOptions` | A [RedirectOptions](redirect-options.mdx) object | + +#### Returns + +`Promise`\<`unknown`\> + +--- + +### redirectToTasks() + +Redirects to the configured URL where tasks are mounted. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ---------------------- | ------------------------------------------------ | +| `opts?` | `TasksRedirectOptions` | A [RedirectOptions](redirect-options.mdx) object | + +#### Returns + +`Promise`\<`unknown`\> + +--- + +### redirectWithAuth() + +Redirects to the provided url after decorating it with the auth token for development instances. + +#### Parameters + +| Parameter | Type | +| --------- | -------- | +| `to` | `string` | + +#### Returns + +`Promise`\<`unknown`\> diff --git a/.typedoc/docs/types/commerce-billing-namespace.mdx b/.typedoc/docs/types/commerce-billing-namespace.mdx new file mode 100644 index 00000000000..29e5563cda1 --- /dev/null +++ b/.typedoc/docs/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](/docs/references/javascript/types/commerce-subscription-item-resource)\>\> | **`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/.typedoc/docs/types/commerce-checkout-json.mdx b/.typedoc/docs/types/commerce-checkout-json.mdx new file mode 100644 index 00000000000..0bc32fe21d2 --- /dev/null +++ b/.typedoc/docs/types/commerce-checkout-json.mdx @@ -0,0 +1,27 @@ +**`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`** | - | +| `free_trial_ends_at?` | null \| number | **`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/.typedoc/docs/types/commerce-checkout-resource.mdx b/.typedoc/docs/types/commerce-checkout-resource.mdx new file mode 100644 index 00000000000..c37d75bb3a6 --- /dev/null +++ b/.typedoc/docs/types/commerce-checkout-resource.mdx @@ -0,0 +1,48 @@ +**`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: ``. | - | +| `freeTrialEndsAt` | 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: ``. | - | +| `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/.typedoc/docs/types/commerce-checkout-totals-json.mdx b/.typedoc/docs/types/commerce-checkout-totals-json.mdx new file mode 100644 index 00000000000..de2958cec5f --- /dev/null +++ b/.typedoc/docs/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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | +| `grand_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | +| `subtotal` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | +| `tax_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | +| `total_due_now` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | diff --git a/.typedoc/docs/types/commerce-checkout-totals.mdx b/.typedoc/docs/types/commerce-checkout-totals.mdx new file mode 100644 index 00000000000..c07e0c2fa44 --- /dev/null +++ b/.typedoc/docs/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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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/.typedoc/docs/types/commerce-feature-json.mdx b/.typedoc/docs/types/commerce-feature-json.mdx new file mode 100644 index 00000000000..63af4c9a40f --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-feature-resource.mdx b/.typedoc/docs/types/commerce-feature-resource.mdx new file mode 100644 index 00000000000..668ddfc40c3 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-initialized-payment-source-json.mdx b/.typedoc/docs/types/commerce-initialized-payment-source-json.mdx new file mode 100644 index 00000000000..ccac7ad70db --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-initialized-payment-source-resource.mdx b/.typedoc/docs/types/commerce-initialized-payment-source-resource.mdx new file mode 100644 index 00000000000..4bf9397e718 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-money-amount-json.mdx b/.typedoc/docs/types/commerce-money-amount-json.mdx new file mode 100644 index 00000000000..f077ceca22c --- /dev/null +++ b/.typedoc/docs/types/commerce-money-amount-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/.typedoc/docs/types/commerce-money-amount.mdx b/.typedoc/docs/types/commerce-money-amount.mdx new file mode 100644 index 00000000000..42f29879978 --- /dev/null +++ b/.typedoc/docs/types/commerce-money-amount.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/.typedoc/docs/types/commerce-payer-resource-type.mdx b/.typedoc/docs/types/commerce-payer-resource-type.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-payment-charge-type.mdx b/.typedoc/docs/types/commerce-payment-charge-type.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-payment-json.mdx b/.typedoc/docs/types/commerce-payment-json.mdx new file mode 100644 index 00000000000..7925118f659 --- /dev/null +++ b/.typedoc/docs/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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-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/.typedoc/docs/types/commerce-payment-resource.mdx b/.typedoc/docs/types/commerce-payment-resource.mdx new file mode 100644 index 00000000000..4c1610cb0ca --- /dev/null +++ b/.typedoc/docs/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` | [`CommerceMoneyAmount`](commerce-money-amount.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`](/docs/references/javascript/types/commerce-subscription-item-resource) | **`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`](/docs/references/javascript/types/commerce-subscription-item-resource) | **`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/.typedoc/docs/types/commerce-payment-source-json.mdx b/.typedoc/docs/types/commerce-payment-source-json.mdx new file mode 100644 index 00000000000..ac44b63fa07 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-payment-source-methods.mdx b/.typedoc/docs/types/commerce-payment-source-methods.mdx new file mode 100644 index 00000000000..362a61fe25b --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-payment-source-resource.mdx b/.typedoc/docs/types/commerce-payment-source-resource.mdx new file mode 100644 index 00000000000..e4b52eb2fa7 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-payment-source-status.mdx b/.typedoc/docs/types/commerce-payment-source-status.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-payment-status.mdx b/.typedoc/docs/types/commerce-payment-status.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-plan-json.mdx b/.typedoc/docs/types/commerce-plan-json.mdx new file mode 100644 index 00000000000..86b5f126ca1 --- /dev/null +++ b/.typedoc/docs/types/commerce-plan-json.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 | Overrides | +| ------------------------------------------------------------------------------ | --------------------------------------------------------------- | ------------------ | -------------------------- | +| `amount` | `number` | **`Experimental`** | - | +| `amount_formatted` | `string` | **`Experimental`** | - | +| `annual_amount` | `number` | **`Experimental`** | - | +| `annual_amount_formatted` | `string` | **`Experimental`** | - | +| `annual_fee` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | +| `annual_monthly_amount` | `number` | **`Experimental`** | - | +| `annual_monthly_amount_formatted` | `string` | **`Experimental`** | - | +| `annual_monthly_fee` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | +| `avatar_url` | `string` | **`Experimental`** | - | +| `currency` | `string` | **`Experimental`** | - | +| `currency_symbol` | `string` | **`Experimental`** | - | +| `description` | `string` | **`Experimental`** | - | +| `features` | [CommerceFeatureJSON](commerce-feature-json.mdx)[] | **`Experimental`** | - | +| `fee` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | +| `for_payer_type` | [`CommercePayerResourceType`](commerce-payer-resource-type.mdx) | **`Experimental`** | - | +| `free_trial_days?` | null \| number | **`Experimental`** | - | +| `free_trial_enabled?` | `boolean` | **`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/.typedoc/docs/types/commerce-plan-resource.mdx b/.typedoc/docs/types/commerce-plan-resource.mdx new file mode 100644 index 00000000000..a5423beca19 --- /dev/null +++ b/.typedoc/docs/types/commerce-plan-resource.mdx @@ -0,0 +1,52 @@ +**`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 | +| ------------------------------------------------ | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `annualFee` | [`CommerceMoneyAmount`](commerce-money-amount.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: ``. | - | +| `annualMonthlyFee` | [`CommerceMoneyAmount`](commerce-money-amount.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: ``. | - | +| `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: ``. | - | +| `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: ``. | - | +| `fee` | [`CommerceMoneyAmount`](commerce-money-amount.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. | - | +| `freeTrialDays` | null \| 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: ``. | - | +| `freeTrialEnabled` | `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: ``. | - | +| `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/.typedoc/docs/types/commerce-product-json.mdx b/.typedoc/docs/types/commerce-product-json.mdx new file mode 100644 index 00000000000..4d26dd18ff6 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-product-resource.mdx b/.typedoc/docs/types/commerce-product-resource.mdx new file mode 100644 index 00000000000..99ccb9cc2f1 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-statement-group-json.mdx b/.typedoc/docs/types/commerce-statement-group-json.mdx new file mode 100644 index 00000000000..1b5c4f9da7d --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-statement-group.mdx b/.typedoc/docs/types/commerce-statement-group.mdx new file mode 100644 index 00000000000..6b7532d42cc --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-statement-json.mdx b/.typedoc/docs/types/commerce-statement-json.mdx new file mode 100644 index 00000000000..e5126f13ed8 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-statement-resource.mdx b/.typedoc/docs/types/commerce-statement-resource.mdx new file mode 100644 index 00000000000..e711fb72de8 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-statement-status.mdx b/.typedoc/docs/types/commerce-statement-status.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-statement-totals-json.mdx b/.typedoc/docs/types/commerce-statement-totals-json.mdx new file mode 100644 index 00000000000..b196fc009f9 --- /dev/null +++ b/.typedoc/docs/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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | +| `grand_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | +| `subtotal` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | +| `tax_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | diff --git a/.typedoc/docs/types/commerce-statement-totals.mdx b/.typedoc/docs/types/commerce-statement-totals.mdx new file mode 100644 index 00000000000..0056b3e8b60 --- /dev/null +++ b/.typedoc/docs/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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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/.typedoc/docs/types/commerce-subscription-item-json.mdx b/.typedoc/docs/types/commerce-subscription-item-json.mdx new file mode 100644 index 00000000000..94b0ec074fc --- /dev/null +++ b/.typedoc/docs/types/commerce-subscription-item-json.mdx @@ -0,0 +1,30 @@ +**`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?` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | +| `canceled_at` | null \| number | **`Experimental`** | - | +| `created_at` | `number` | **`Experimental`** | - | +| `credit?` | \{ amount: [CommerceMoneyAmountJSON](commerce-money-amount-json.mdx); \} | **`Experimental`** | - | +| `credit.amount` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | - | - | +| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | +| `is_free_trial?` | `boolean` | **`Experimental`** | - | +| `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/.typedoc/docs/types/commerce-subscription-item-resource.mdx b/.typedoc/docs/types/commerce-subscription-item-resource.mdx new file mode 100644 index 00000000000..07480ffc649 --- /dev/null +++ b/.typedoc/docs/types/commerce-subscription-item-resource.mdx @@ -0,0 +1,51 @@ +**`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?` | [`CommerceMoneyAmount`](commerce-money-amount.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: [CommerceMoneyAmount](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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) | +| `isFreeTrial` | `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: ``. | - | +| `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/.typedoc/docs/types/commerce-subscription-json.mdx b/.typedoc/docs/types/commerce-subscription-json.mdx new file mode 100644 index 00000000000..374736a1674 --- /dev/null +++ b/.typedoc/docs/types/commerce-subscription-json.mdx @@ -0,0 +1,27 @@ +**`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`** | - | +| `eligible_for_free_trial?` | `boolean` | **`Experimental`** | - | +| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | +| `next_payment?` | \{ amount: [CommerceMoneyAmountJSON](commerce-money-amount-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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-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/.typedoc/docs/types/commerce-subscription-plan-period.mdx b/.typedoc/docs/types/commerce-subscription-plan-period.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-subscription-resource.mdx b/.typedoc/docs/types/commerce-subscription-resource.mdx new file mode 100644 index 00000000000..d0b7eac1df6 --- /dev/null +++ b/.typedoc/docs/types/commerce-subscription-resource.mdx @@ -0,0 +1,45 @@ +**`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: ``. | - | +| `eligibleForFreeTrial?` | `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` | **`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: [CommerceMoneyAmount](commerce-money-amount.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](/docs/references/javascript/types/commerce-subscription-item-resource)[] | **`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/.typedoc/docs/types/commerce-subscription-status.mdx b/.typedoc/docs/types/commerce-subscription-status.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/confirm-checkout-params.mdx b/.typedoc/docs/types/confirm-checkout-params.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/create-checkout-params.mdx b/.typedoc/docs/types/create-checkout-params.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/create-organization-params.mdx b/.typedoc/docs/types/create-organization-params.mdx new file mode 100644 index 00000000000..77db98c5974 --- /dev/null +++ b/.typedoc/docs/types/create-organization-params.mdx @@ -0,0 +1,4 @@ +| Property | Type | Description | +| ------------------------- | -------- | ----------------------------- | +| `name` | `string` | The name of the organization. | +| `slug?` | `string` | The slug of the organization. | diff --git a/.typedoc/docs/types/element-object-key.mdx b/.typedoc/docs/types/element-object-key.mdx new file mode 100644 index 00000000000..f5fec844683 --- /dev/null +++ b/.typedoc/docs/types/element-object-key.mdx @@ -0,0 +1 @@ +Convert a kebab-cased key from ElementsConfig into a camelCased Elements key diff --git a/.typedoc/docs/types/elements-config.mdx b/.typedoc/docs/types/elements-config.mdx new file mode 100644 index 00000000000..603ae040f48 --- /dev/null +++ b/.typedoc/docs/types/elements-config.mdx @@ -0,0 +1,3 @@ +A map that describes the possible combinations we need to generate +for each unique base element +Kebab-case is used to differentiate between the container and child elements diff --git a/.typedoc/docs/types/experimental_checkout-button-props.mdx b/.typedoc/docs/types/experimental_checkout-button-props.mdx new file mode 100644 index 00000000000..acc34fcef18 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/experimental_plan-details-button-props.mdx b/.typedoc/docs/types/experimental_plan-details-button-props.mdx new file mode 100644 index 00000000000..96bd18fad08 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/experimental_subscription-details-button-props.mdx b/.typedoc/docs/types/experimental_subscription-details-button-props.mdx new file mode 100644 index 00000000000..8256b10c77f --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/for-payer-type.mdx b/.typedoc/docs/types/for-payer-type.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/get-payment-attempts-params.mdx b/.typedoc/docs/types/get-payment-attempts-params.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/get-payment-sources-params.mdx b/.typedoc/docs/types/get-payment-sources-params.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/get-plans-params.mdx b/.typedoc/docs/types/get-plans-params.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/get-statements-params.mdx b/.typedoc/docs/types/get-statements-params.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/get-subscription-params.mdx b/.typedoc/docs/types/get-subscription-params.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/get-subscriptions-params.mdx b/.typedoc/docs/types/get-subscriptions-params.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/get-token.mdx b/.typedoc/docs/types/get-token.mdx new file mode 100644 index 00000000000..60dbf10f036 --- /dev/null +++ b/.typedoc/docs/types/get-token.mdx @@ -0,0 +1,9 @@ +## Parameters + +| Parameter | Type | +| ---------- | ----------------- | +| `options?` | `GetTokenOptions` | + +## Returns + +`Promise`\<string \| null\> diff --git a/.typedoc/docs/types/id-selectors.mdx b/.typedoc/docs/types/id-selectors.mdx new file mode 100644 index 00000000000..29c20772b88 --- /dev/null +++ b/.typedoc/docs/types/id-selectors.mdx @@ -0,0 +1 @@ +Create a type union consisting of the base element with all valid ids appended diff --git a/.typedoc/docs/types/initialize-payment-source-params.mdx b/.typedoc/docs/types/initialize-payment-source-params.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/internal_checkout-props.mdx b/.typedoc/docs/types/internal_checkout-props.mdx new file mode 100644 index 00000000000..1c492a6f2d6 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/internal_plan-details-props.mdx b/.typedoc/docs/types/internal_plan-details-props.mdx new file mode 100644 index 00000000000..58fb56c481b --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/internal_subscription-details-props.mdx b/.typedoc/docs/types/internal_subscription-details-props.mdx new file mode 100644 index 00000000000..1ed9c591f0c --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/jwt-claims.mdx b/.typedoc/docs/types/jwt-claims.mdx new file mode 100644 index 00000000000..16182c24357 --- /dev/null +++ b/.typedoc/docs/types/jwt-claims.mdx @@ -0,0 +1,27 @@ +## Deprecated + +Use `JwtPayload` instead. + +## Indexable + +\[`propName`: `string`\]: `unknown` + +Any other JWT Claim Set member. + +## Properties + +| Property | Type | Description | +| ------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| ~~`__raw`~~ | `string` | Encoded token supporting the `getRawString` method. | +| ~~`act?`~~ | \{ [x: string]: unknown; sub: string; \} | JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). | +| `act.sub` | `string` | - | +| ~~`azp?`~~ | `string` | JWT Authorized party - [RFC7800#section-3](https://tools.ietf.org/html/rfc7800#section-3). | +| ~~`exp`~~ | `number` | JWT Expiration Time - [RFC7519#section-4.1.4](https://tools.ietf.org/html/rfc7519#section-4.1.4). | +| ~~`iat`~~ | `number` | JWT Issued At - [RFC7519#section-4.1.6](https://tools.ietf.org/html/rfc7519#section-4.1.6). | +| ~~`iss`~~ | `string` | JWT Issuer - [RFC7519#section-4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1). | +| ~~`nbf`~~ | `number` | JWT Not Before - [RFC7519#section-4.1.5](https://tools.ietf.org/html/rfc7519#section-4.1.5). | +| ~~`org_id?`~~ | `string` | Active organization ID. | +| ~~`org_role?`~~ | `string` | Active organization role. | +| ~~`org_slug?`~~ | `string` | Active organization slug. | +| ~~`sid`~~ | `string` | Session ID | +| ~~`sub`~~ | `string` | JWT Subject - [RFC7519#section-4.1.2](https://tools.ietf.org/html/rfc7519#section-4.1.2). | diff --git a/.typedoc/docs/types/jwt-header.mdx b/.typedoc/docs/types/jwt-header.mdx new file mode 100644 index 00000000000..ad47ca006c3 --- /dev/null +++ b/.typedoc/docs/types/jwt-header.mdx @@ -0,0 +1,3 @@ +## Deprecated + +Use `JwtHeader` instead. diff --git a/.typedoc/docs/types/legacy-redirect-props.mdx b/.typedoc/docs/types/legacy-redirect-props.mdx new file mode 100644 index 00000000000..62b50d20394 --- /dev/null +++ b/.typedoc/docs/types/legacy-redirect-props.mdx @@ -0,0 +1,13 @@ +> **LegacyRedirectProps** = \{ afterSignInUrl?: string \| null; afterSignUpUrl?: string \| null; redirectUrl?: string \| null; \} + +## Deprecated + +This will be removed in a future release. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------ | +| ~~`afterSignInUrl?`~~ | string \| null | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | +| ~~`afterSignUpUrl?`~~ | string \| null | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | +| ~~`redirectUrl?`~~ | string \| null | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | diff --git a/.typedoc/docs/types/localization-resource.mdx b/.typedoc/docs/types/localization-resource.mdx new file mode 100644 index 00000000000..0c2b7715347 --- /dev/null +++ b/.typedoc/docs/types/localization-resource.mdx @@ -0,0 +1,13 @@ +A type containing all the possible localization keys the prebuilt Clerk components support. +Users aiming to customize a few strings can also peak at the `data-localization-key` attribute by inspecting +the DOM and updating the corresponding key. +Users aiming to completely localize the components by providing a complete translation can use +the default english resource object from [Clerk's open source repo](https://github.com/clerk/javascript) +as a starting point. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `roles?` | `DeepPartial`\<`DeepLocalizationWithoutObjects`\<\{ [r: string]: string; \}\>\> | **`Experimental`** Add role keys and their localized values, e.g. `roles: { 'org:teacher': 'Teacher'}`. | +| `socialButtonsBlockButtonManyInView?` | `DeepPartial`\<\`$\{string\}\{\{provider\|titleize\}\}$\{string\}\` & \{ \_\_params: UnionToRecordWithPrimitives\; \}\> | It should be used to provide a shorter variation of `socialButtonsBlockButton`. It is explicitly typed, in order to avoid contributions that use LLM tools to generate translations that misinterpret the correct usage of this property. | diff --git a/.typedoc/docs/types/make-default-payment-source-params.mdx b/.typedoc/docs/types/make-default-payment-source-params.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/multi-domain-and-or-proxy.mdx b/.typedoc/docs/types/multi-domain-and-or-proxy.mdx new file mode 100644 index 00000000000..fceea3d28db --- /dev/null +++ b/.typedoc/docs/types/multi-domain-and-or-proxy.mdx @@ -0,0 +1,26 @@ +You can configure proxy and satellite domains in a few ways: + +1. none of them are set +2. only `proxyUrl` is set +3. `isSatellite` and `proxyUrl` are set +4. `isSatellite` and `domain` are set + +## Type declaration + +| Name | Type | Description | +| -------------- | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `domain?` | `never` | **Required if your application is a satellite application**. Sets the domain of the satellite application. | +| `isSatellite?` | `never` | A boolean that indicates whether the application is a satellite application. | +| `proxyUrl?` | never \| 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`). | + +| Name | Type | +| ------------- | ----------------------------------------------------------- | +| `domain` | string \| (url) => string | +| `isSatellite` | `Exclude`\<`ClerkOptions`\[`"isSatellite"`\], `undefined`\> | +| `proxyUrl?` | `never` | + +| Name | Type | +| ------------- | ----------------------------------------------------------- | +| `domain?` | `never` | +| `isSatellite` | `Exclude`\<`ClerkOptions`\[`"isSatellite"`\], `undefined`\> | +| `proxyUrl` | string \| (url) => string | diff --git a/.typedoc/docs/types/organization-custom-role-key.mdx b/.typedoc/docs/types/organization-custom-role-key.mdx new file mode 100644 index 00000000000..d3729132f8f --- /dev/null +++ b/.typedoc/docs/types/organization-custom-role-key.mdx @@ -0,0 +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/roles-permissions#custom-roles) as well. diff --git a/.typedoc/docs/types/organization-domain-resource.mdx b/.typedoc/docs/types/organization-domain-resource.mdx new file mode 100644 index 00000000000..7e8db7659d8 --- /dev/null +++ b/.typedoc/docs/types/organization-domain-resource.mdx @@ -0,0 +1,28 @@ +The `OrganizationDomain` object is the model around an organization domain. + +## 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. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`OrganizationDomainResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-domain-verification-status.mdx b/.typedoc/docs/types/organization-domain-verification-status.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/organization-enrollment-mode.mdx b/.typedoc/docs/types/organization-enrollment-mode.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/organization-invitation-resource.mdx b/.typedoc/docs/types/organization-invitation-resource.mdx new file mode 100644 index 00000000000..514156fa13d --- /dev/null +++ b/.typedoc/docs/types/organization-invitation-resource.mdx @@ -0,0 +1,28 @@ +The `OrganizationInvitation` object is the model around an organization invitation. + +## 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. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`OrganizationInvitationResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-invitation-status.mdx b/.typedoc/docs/types/organization-invitation-status.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/organization-membership-request-resource.mdx b/.typedoc/docs/types/organization-membership-request-resource.mdx new file mode 100644 index 00000000000..bdd6dfe997d --- /dev/null +++ b/.typedoc/docs/types/organization-membership-request-resource.mdx @@ -0,0 +1,28 @@ +The `OrganizationMembershipRequest` object is the model that describes the request of a user to join an organization. + +## 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. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`OrganizationMembershipRequestResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-membership-resource.mdx b/.typedoc/docs/types/organization-membership-resource.mdx new file mode 100644 index 00000000000..b4dc4fa94e1 --- /dev/null +++ b/.typedoc/docs/types/organization-membership-resource.mdx @@ -0,0 +1,28 @@ +The `OrganizationMembership` object is the model around an organization membership entity and describes the relationship between users and organizations. + +## 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. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`OrganizationMembershipResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-permission-key.mdx b/.typedoc/docs/types/organization-permission-key.mdx new file mode 100644 index 00000000000..32332de64d2 --- /dev/null +++ b/.typedoc/docs/types/organization-permission-key.mdx @@ -0,0 +1,2 @@ +OrganizationPermissionKey is a combination of system and custom permissions. +System permissions are only accessible from FAPI and client-side operations/utils diff --git a/.typedoc/docs/types/organization-resource.mdx b/.typedoc/docs/types/organization-resource.mdx new file mode 100644 index 00000000000..ffdffff3e9f --- /dev/null +++ b/.typedoc/docs/types/organization-resource.mdx @@ -0,0 +1,34 @@ +The `Organization` object holds information about an organization, as well as methods for managing it. + +To use these methods, you must have the **Organizations** feature [enabled in your app's settings in the Clerk Dashboard](/docs/organizations/overview#enable-organizations-in-your-application). + +## Properties + +| 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](/docs/references/javascript/types/commerce-subscription-item-resource)\>\> | **`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 + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`OrganizationResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-suggestion-resource.mdx b/.typedoc/docs/types/organization-suggestion-resource.mdx new file mode 100644 index 00000000000..9ab3fff17b3 --- /dev/null +++ b/.typedoc/docs/types/organization-suggestion-resource.mdx @@ -0,0 +1,28 @@ +An interface representing an organization suggestion. + +## 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. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`OrganizationSuggestionResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-suggestion-status.mdx b/.typedoc/docs/types/organization-suggestion-status.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/organizations-jwt-claim.mdx b/.typedoc/docs/types/organizations-jwt-claim.mdx new file mode 100644 index 00000000000..cd60c4db281 --- /dev/null +++ b/.typedoc/docs/types/organizations-jwt-claim.mdx @@ -0,0 +1,3 @@ +## Deprecated + +This type will be removed in the next major version. diff --git a/.typedoc/docs/types/override.mdx b/.typedoc/docs/types/override.mdx new file mode 100644 index 00000000000..6aec62ed955 --- /dev/null +++ b/.typedoc/docs/types/override.mdx @@ -0,0 +1,4 @@ +Overrides the type of existing properties +const obj = { a: string, b: number } as const; +type Value = Override +Value contains: { a:string, b: string } diff --git a/.typedoc/docs/types/path-value.mdx b/.typedoc/docs/types/path-value.mdx new file mode 100644 index 00000000000..6b636990561 --- /dev/null +++ b/.typedoc/docs/types/path-value.mdx @@ -0,0 +1,4 @@ +Used to read the value of a string path inside an object defined as const +const obj = { a: { b: 'hello' }} as const; +type Value = PathValue +Value is now a union set containing a single type: 'hello' diff --git a/.typedoc/docs/types/payment-gateway.mdx b/.typedoc/docs/types/payment-gateway.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/pending-session-options.mdx b/.typedoc/docs/types/pending-session-options.mdx new file mode 100644 index 00000000000..3b210e465f2 --- /dev/null +++ b/.typedoc/docs/types/pending-session-options.mdx @@ -0,0 +1,7 @@ +> **PendingSessionOptions** = \{ treatPendingAsSignedOut?: boolean; \} + +## Properties + +| Property | Type | Description | +| --------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------- | +| `treatPendingAsSignedOut?` | `boolean` | A boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`. | diff --git a/.typedoc/docs/types/pending-session-resource.mdx b/.typedoc/docs/types/pending-session-resource.mdx new file mode 100644 index 00000000000..44fa113497e --- /dev/null +++ b/.typedoc/docs/types/pending-session-resource.mdx @@ -0,0 +1,32 @@ +Represents a session resource that has completed sign-in but has pending tasks + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `end` | () => Promise\<[SessionResource](/docs/references/javascript/session)\> | Marks the session as ended. The session will no longer be active for this `Client` and its status will become **ended**. | - | +| `factorVerificationAge` | null \| \[number, number\] | An array where each item represents the number of minutes since the last verification of a first or second factor: `[firstFactorAge, secondFactorAge]`. | - | +| `id` | `string` | The unique identifier for the session. | - | +| `pathRoot` | `string` | The root path of the resource. | - | +| `status` | `"pending"` | The current state of the session. | [`SessionResource`](/docs/references/javascript/session).[`status`](/docs/references/javascript/session#status) | +| `user` | [`UserResource`](/docs/references/javascript/user) | The user associated with the session. | [`SessionResource`](/docs/references/javascript/session).[`user`](/docs/references/javascript/session#user) | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`PendingSessionResource`\> + +#### Inherited from + +[`SessionResource`](/docs/references/javascript/session).[`reload`](/docs/references/javascript/session#reload) diff --git a/.typedoc/docs/types/protect-props.mdx b/.typedoc/docs/types/protect-props.mdx new file mode 100644 index 00000000000..caa5998e83e --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/record-to-path.mdx b/.typedoc/docs/types/record-to-path.mdx new file mode 100644 index 00000000000..d89089101d1 --- /dev/null +++ b/.typedoc/docs/types/record-to-path.mdx @@ -0,0 +1,4 @@ +Used to construct a type union containing all the keys (even if nested) of an object defined as const +const obj = { a: { b: '' }, c: '' } as const; +type Paths = RecordToPath +Paths contains: 'a' | 'a.b' | 'c' diff --git a/.typedoc/docs/types/redirect-options.mdx b/.typedoc/docs/types/redirect-options.mdx new file mode 100644 index 00000000000..b505ddb60ce --- /dev/null +++ b/.typedoc/docs/types/redirect-options.mdx @@ -0,0 +1,2 @@ +Redirect URLs for different actions. +Mainly used to be used to type internal Clerk functions. diff --git a/.typedoc/docs/types/remove-payment-source-params.mdx b/.typedoc/docs/types/remove-payment-source-params.mdx new file mode 100644 index 00000000000..62a2c1cba23 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/reverification-config.mdx b/.typedoc/docs/types/reverification-config.mdx new file mode 100644 index 00000000000..7ca39c1bd5a --- /dev/null +++ b/.typedoc/docs/types/reverification-config.mdx @@ -0,0 +1,10 @@ +The `ReverificationConfig` type has the following properties: + +## Type declaration + +"strict" \| "strict_mfa" \| "moderate" \| "lax" + +| Name | Type | Description | +| -------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `afterMinutes` | `SessionVerificationAfterMinutes` | The age of the factor level to check for. Value should be greater than or equal to 1 and less than 99,999. | +| `level` | "first_factor" \| "second_factor" \| "multi_factor" | The reverification level of credentials to check for. | diff --git a/.typedoc/docs/types/saml-strategy.mdx b/.typedoc/docs/types/saml-strategy.mdx new file mode 100644 index 00000000000..a8f26d96d35 --- /dev/null +++ b/.typedoc/docs/types/saml-strategy.mdx @@ -0,0 +1,3 @@ +## Deprecated + +Use `EnterpriseSSOStrategy` instead. diff --git a/.typedoc/docs/types/sdk-metadata.mdx b/.typedoc/docs/types/sdk-metadata.mdx new file mode 100644 index 00000000000..42ddd4d54c3 --- /dev/null +++ b/.typedoc/docs/types/sdk-metadata.mdx @@ -0,0 +1,9 @@ +> **SDKMetadata** = \{ environment?: string; name: string; version: string; \} + +## Properties + +| Property | Type | Description | +| --------------------------------------- | -------- | --------------------------------------------------------------------------- | +| `environment?` | `string` | Typically this will be the `NODE_ENV` that the SDK is currently running in. | +| `name` | `string` | The npm package name of the SDK. | +| `version` | `string` | The npm package version of the SDK. | diff --git a/.typedoc/docs/types/server-get-token-options.mdx b/.typedoc/docs/types/server-get-token-options.mdx new file mode 100644 index 00000000000..a63b221731b --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/server-get-token.mdx b/.typedoc/docs/types/server-get-token.mdx new file mode 100644 index 00000000000..b0e14e560a8 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/session-resource.mdx b/.typedoc/docs/types/session-resource.mdx new file mode 100644 index 00000000000..2651cffa85b --- /dev/null +++ b/.typedoc/docs/types/session-resource.mdx @@ -0,0 +1,43 @@ +The `Session` object is an abstraction over an HTTP session. It models the period of information exchange between a user and the server. + +The `Session` object includes methods for recording session activity and ending the session client-side. For security reasons, sessions can also expire server-side. + +As soon as a [`User`](/docs/references/javascript/user) signs in, Clerk creates a `Session` for the current [`Client`](/docs/references/javascript/client). Clients can have more than one sessions at any point in time, but only one of those sessions will be **active**. + +In certain scenarios, a session might be replaced by another one. This is often the case with [multi-session applications](/docs/authentication/configuration/session-options#multi-session-applications). + +All sessions that are **expired**, **removed**, **replaced**, **ended** or **abandoned** are not considered valid. + +> [!NOTE] +> For more information regarding the different session states, see the [guide on session management](/docs/authentication/configuration/session-options). + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `end` | () => Promise\ | Marks the session as ended. The session will no longer be active for this `Client` and its status will become **ended**. | - | +| `factorVerificationAge` | null \| \[number, number\] | An array where each item represents the number of minutes since the last verification of a first or second factor: `[firstFactorAge, secondFactorAge]`. | - | +| `id` | `string` | The unique identifier for the session. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | +| `pathRoot` | `string` | The root path of the resource. | - | +| `status` | `SessionStatus` | The current state of the session. | - | +| `user` | null \| [UserResource](/docs/references/javascript/user) | The user associated with the session. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`SessionResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/session-status-claim.mdx b/.typedoc/docs/types/session-status-claim.mdx new file mode 100644 index 00000000000..de597535472 --- /dev/null +++ b/.typedoc/docs/types/session-status-claim.mdx @@ -0,0 +1 @@ +The current state of the session which can only be `active` or `pending`. diff --git a/.typedoc/docs/types/session-task.mdx b/.typedoc/docs/types/session-task.mdx new file mode 100644 index 00000000000..12c0552a25e --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/session-verification-level.mdx b/.typedoc/docs/types/session-verification-level.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/session-verification-types.mdx b/.typedoc/docs/types/session-verification-types.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/set-active-params.mdx b/.typedoc/docs/types/set-active-params.mdx new file mode 100644 index 00000000000..4bd93404d67 --- /dev/null +++ b/.typedoc/docs/types/set-active-params.mdx @@ -0,0 +1,11 @@ +The parameters for the `setActive()` method. + +## Properties + +| Property | Type | Description | +| ----------------------------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ~~`beforeEmit?`~~ | `BeforeEmitCallback` | **Deprecated.** Use `redirectUrl` instead. Callback run just before the active session and/or organization is set to the passed object. Can be used to set up for pre-navigation actions. | +| `navigate?` | `SetActiveNavigate` | A custom navigation function to be called just before the session and/or organization is set. When provided, it takes precedence over the `redirectUrl` parameter for navigation. Example: `await clerk.setActive({ session, navigate: async ({ session }) => { const currentTask = session.currentTask; if (currentTask) { await router.push(`./onboarding/${currentTask.key}`) return } router.push('/dashboard'); } });` | +| `organization?` | null \| string \| [OrganizationResource](/docs/references/javascript/organization) | The organization resource or organization ID/slug (string version) to be set as active in the current session. If `null`, the currently active organization is removed as active. | +| `redirectUrl?` | `string` | The full URL or path to redirect to just before the session and/or organization is set. | +| `session?` | null \| string \| [SignedInSessionResource](/docs/references/javascript/session) | The session resource or session ID (string version) to be set as active. If `null`, the current session is deleted. | diff --git a/.typedoc/docs/types/set-active.mdx b/.typedoc/docs/types/set-active.mdx new file mode 100644 index 00000000000..ab8cbd7d5c5 --- /dev/null +++ b/.typedoc/docs/types/set-active.mdx @@ -0,0 +1,9 @@ +## Parameters + +| Parameter | Type | +| ----------------- | ------------------------------------------ | +| `setActiveParams` | [`SetActiveParams`](set-active-params.mdx) | + +## Returns + +`Promise`\<`void`\> diff --git a/.typedoc/docs/types/sign-in-resource.mdx b/.typedoc/docs/types/sign-in-resource.mdx new file mode 100644 index 00000000000..e6aa39d2aa5 --- /dev/null +++ b/.typedoc/docs/types/sign-in-resource.mdx @@ -0,0 +1,30 @@ +The `SignIn` object holds the state of the current sign-in and provides helper methods to navigate and complete the sign-in process. It is used to manage the sign-in lifecycle, including the first and second factor verification, and the creation of a new session. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------------------ | --------------------------------- | ------------------------------------------------------------------------- | +| `id?` | `string` | The unique identifier of the resource. | +| `pathRoot` | `string` | The root path of the resource. | +| `status` | null \| SignInStatus | The current status of the sign-in. | +| ~~`supportedIdentifiers`~~ | SignInIdentifier[] | **Deprecated.** This attribute will be removed in the next major version. | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`SignInResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/sign-out.mdx b/.typedoc/docs/types/sign-out.mdx new file mode 100644 index 00000000000..2ec222553cb --- /dev/null +++ b/.typedoc/docs/types/sign-out.mdx @@ -0,0 +1,24 @@ +## Call Signature + +### Parameters + +| Parameter | Type | +| ---------- | ---------------- | +| `options?` | `SignOutOptions` | + +### Returns + +`Promise`\<`void`\> + +## Call Signature + +### Parameters + +| Parameter | Type | +| ------------------ | ----------------- | +| `signOutCallback?` | `SignOutCallback` | +| `options?` | `SignOutOptions` | + +### Returns + +`Promise`\<`void`\> diff --git a/.typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx b/.typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx new file mode 100644 index 00000000000..2ad5ab70fe0 --- /dev/null +++ b/.typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx @@ -0,0 +1,3 @@ +## Deprecated + +Use `SignUpAuthenticateWithWeb3Params` instead. diff --git a/.typedoc/docs/types/sign-up-resource.mdx b/.typedoc/docs/types/sign-up-resource.mdx new file mode 100644 index 00000000000..46d56bca3dc --- /dev/null +++ b/.typedoc/docs/types/sign-up-resource.mdx @@ -0,0 +1,29 @@ +The `SignUp` object holds the state of the current sign-up and provides helper methods to navigate and complete the sign-up process. Once a sign-up is complete, a new user is created. + +## Properties + +| Property | Type | Description | +| -------------------------------- | --------------------------------- | -------------------------------------- | +| `id?` | `string` | The unique identifier of the resource. | +| `pathRoot` | `string` | The root path of the resource. | +| `status` | null \| SignUpStatus | The current status of the sign-up. | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`SignUpResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/signed-in-session-resource.mdx b/.typedoc/docs/types/signed-in-session-resource.mdx new file mode 100644 index 00000000000..a682dc8b4d8 --- /dev/null +++ b/.typedoc/docs/types/signed-in-session-resource.mdx @@ -0,0 +1,2 @@ +Represents session resources for users who have completed +the full sign-in flow diff --git a/.typedoc/docs/types/state-selectors.mdx b/.typedoc/docs/types/state-selectors.mdx new file mode 100644 index 00000000000..cecc110aacf --- /dev/null +++ b/.typedoc/docs/types/state-selectors.mdx @@ -0,0 +1 @@ +Create a type union of all state + id combinations diff --git a/.typedoc/docs/types/telemetry-log-entry.mdx b/.typedoc/docs/types/telemetry-log-entry.mdx new file mode 100644 index 00000000000..4b91f4af44f --- /dev/null +++ b/.typedoc/docs/types/telemetry-log-entry.mdx @@ -0,0 +1 @@ +Debug log entry interface for telemetry collector diff --git a/.typedoc/docs/types/use-auth-return.mdx b/.typedoc/docs/types/use-auth-return.mdx new file mode 100644 index 00000000000..10bb56dd987 --- /dev/null +++ b/.typedoc/docs/types/use-auth-return.mdx @@ -0,0 +1,61 @@ +## Type declaration + +| Name | Type | Description | +| --------------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `actor` | `undefined` | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | +| `getToken` | [`GetToken`](get-token.mdx) | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | +| `has` | \{ \} | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | +| `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. | +| `orgId` | `undefined` | The ID of the user's active organization. | +| `orgRole` | `undefined` | The current user's role in their active organization. | +| `orgSlug` | `undefined` | The URL-friendly identifier of the user's active organization. | +| `sessionClaims` | `undefined` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | +| `sessionId` | `undefined` | The ID for the current session. | +| `signOut` | [`SignOut`](sign-out.mdx) | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | +| `userId` | `undefined` | The ID of the current user. | + +| Name | Type | +| --------------- | ------------------------------ | +| `actor` | `null` | +| `getToken` | [`GetToken`](get-token.mdx) | +| `has()` | (params) => false | +| `isLoaded` | `true` | +| `isSignedIn` | `false` | +| `orgId` | `null` | +| `orgRole` | `null` | +| `orgSlug` | `null` | +| `sessionClaims` | `null` | +| `sessionId` | `null` | +| `signOut` | [`SignOut`](sign-out.mdx) | +| `userId` | `null` | + +| Name | Type | +| --------------- | -------------------------------------------------------------------------------------------- | +| `actor` | [ActClaim](act-claim.mdx) \| null | +| `getToken` | [`GetToken`](get-token.mdx) | +| `has` | [`CheckAuthorizationWithCustomPermissions`](check-authorization-with-custom-permissions.mdx) | +| `isLoaded` | `true` | +| `isSignedIn` | `true` | +| `orgId` | `null` | +| `orgRole` | `null` | +| `orgSlug` | `null` | +| `sessionClaims` | `JwtPayload` | +| `sessionId` | `string` | +| `signOut` | [`SignOut`](sign-out.mdx) | +| `userId` | `string` | + +| Name | Type | +| --------------- | -------------------------------------------------------------------------------------------- | +| `actor` | [ActClaim](act-claim.mdx) \| null | +| `getToken` | [`GetToken`](get-token.mdx) | +| `has` | [`CheckAuthorizationWithCustomPermissions`](check-authorization-with-custom-permissions.mdx) | +| `isLoaded` | `true` | +| `isSignedIn` | `true` | +| `orgId` | `string` | +| `orgRole` | [`OrganizationCustomRoleKey`](organization-custom-role-key.mdx) | +| `orgSlug` | string \| null | +| `sessionClaims` | `JwtPayload` | +| `sessionId` | `string` | +| `signOut` | [`SignOut`](sign-out.mdx) | +| `userId` | `string` | diff --git a/.typedoc/docs/types/use-session-list-return.mdx b/.typedoc/docs/types/use-session-list-return.mdx new file mode 100644 index 00000000000..d5e0943a356 --- /dev/null +++ b/.typedoc/docs/types/use-session-list-return.mdx @@ -0,0 +1,13 @@ +## Type declaration + +| Name | Type | Description | +| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `sessions` | `undefined` | A list of sessions that have been registered on the client device. | +| `setActive` | `undefined` | A function that sets the active session and/or organization. | + +| Name | Type | +| ----------- | --------------------------------------------------------------------- | +| `isLoaded` | `true` | +| `sessions` | [SessionResource](/docs/references/javascript/session)[] | +| `setActive` | [`SetActive`](set-active.mdx) | diff --git a/.typedoc/docs/types/use-session-return.mdx b/.typedoc/docs/types/use-session-return.mdx new file mode 100644 index 00000000000..58f615aad81 --- /dev/null +++ b/.typedoc/docs/types/use-session-return.mdx @@ -0,0 +1,19 @@ +## Type declaration + +| Name | Type | Description | +| ------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------ | +| `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 session for the user. | + +| Name | Type | +| ------------ | ------- | +| `isLoaded` | `true` | +| `isSignedIn` | `false` | +| `session` | `null` | + +| Name | Type | +| ------------ | ---------------------------------------------------------------- | +| `isLoaded` | `true` | +| `isSignedIn` | `boolean` | +| `session` | [`SignedInSessionResource`](/docs/references/javascript/session) | diff --git a/.typedoc/docs/types/use-sign-in-return.mdx b/.typedoc/docs/types/use-sign-in-return.mdx new file mode 100644 index 00000000000..5da1828dd90 --- /dev/null +++ b/.typedoc/docs/types/use-sign-in-return.mdx @@ -0,0 +1,13 @@ +## Type declaration + +| Name | Type | Description | +| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `setActive` | `undefined` | A function that sets the active session. | +| `signIn` | `undefined` | An object that contains the current sign-in attempt status and methods to create a new sign-in attempt. | + +| Name | Type | +| ----------- | ---------------------------------------- | +| `isLoaded` | `true` | +| `setActive` | [`SetActive`](set-active.mdx) | +| `signIn` | [`SignInResource`](sign-in-resource.mdx) | diff --git a/.typedoc/docs/types/use-sign-up-return.mdx b/.typedoc/docs/types/use-sign-up-return.mdx new file mode 100644 index 00000000000..df2caffca81 --- /dev/null +++ b/.typedoc/docs/types/use-sign-up-return.mdx @@ -0,0 +1,13 @@ +## Type declaration + +| Name | Type | Description | +| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `setActive` | `undefined` | A function that sets the active session. | +| `signUp` | `undefined` | An object that contains the current sign-up attempt status and methods to create a new sign-up attempt. | + +| Name | Type | +| ----------- | ------------------------------------------------------- | +| `isLoaded` | `true` | +| `setActive` | [`SetActive`](set-active.mdx) | +| `signUp` | [`SignUpResource`](/docs/references/javascript/sign-up) | diff --git a/.typedoc/docs/types/use-user-return.mdx b/.typedoc/docs/types/use-user-return.mdx new file mode 100644 index 00000000000..960725f16ab --- /dev/null +++ b/.typedoc/docs/types/use-user-return.mdx @@ -0,0 +1,19 @@ +## Type declaration + +| Name | Type | Description | +| ------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `isSignedIn` | `undefined` | A boolean that returns `true` if the user is signed in. | +| `user` | `undefined` | The `User` object for the current user. | + +| Name | Type | +| ------------ | ------- | +| `isLoaded` | `true` | +| `isSignedIn` | `false` | +| `user` | `null` | + +| Name | Type | +| ------------ | -------------------------------------------------- | +| `isLoaded` | `true` | +| `isSignedIn` | `true` | +| `user` | [`UserResource`](/docs/references/javascript/user) | diff --git a/.typedoc/docs/types/user-organization-invitation-resource.mdx b/.typedoc/docs/types/user-organization-invitation-resource.mdx new file mode 100644 index 00000000000..78976cef403 --- /dev/null +++ b/.typedoc/docs/types/user-organization-invitation-resource.mdx @@ -0,0 +1,28 @@ +The `OrganizationInvitation` object is the model around an organization invitation. + +## 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. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`UserOrganizationInvitationResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/user-resource.mdx b/.typedoc/docs/types/user-resource.mdx new file mode 100644 index 00000000000..385cf6b9539 --- /dev/null +++ b/.typedoc/docs/types/user-resource.mdx @@ -0,0 +1,38 @@ +The `User` object holds all of the information for a single user of your application and provides a set of methods to manage their account. Each `User` has at least one authentication [identifier](/docs/authentication/configuration/sign-up-sign-in-options#identifiers), which might be their email address, phone number, or a username. + +A user can be contacted at their primary email address or primary phone number. They can have more than one registered email address, but only one of them will be their primary email address. This goes for phone numbers as well; a user can have more than one, but only one phone number will be their primary. At the same time, a user can also have one or more external accounts by connecting to [social providers](/docs/authentication/social-connections/oauth) such as Google, Apple, Facebook, and many more. + +Finally, a `User` object holds profile data like the user's name, profile picture, and a set of [metadata](/docs/users/metadata) that can be used internally to store arbitrary information. The metadata are split into `publicMetadata` and `privateMetadata`. Both types are set from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}, but public metadata can also be accessed from the [Frontend API](/docs/reference/frontend-api){{ target: '_blank' }}. + +The ClerkJS SDK provides some helper [methods](#methods) on the `User` object to help retrieve and update user information and authentication status. + +## Properties + +| 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 + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`UserResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/without.mdx b/.typedoc/docs/types/without.mdx new file mode 100644 index 00000000000..a4185e8e647 --- /dev/null +++ b/.typedoc/docs/types/without.mdx @@ -0,0 +1 @@ +Omit without union flattening From 347a4881ef7d17ab5e9b22a223e906430dfa47a0 Mon Sep 17 00:00:00 2001 From: panteliselef Date: Wed, 27 Aug 2025 22:27:35 +0300 Subject: [PATCH 02/22] wip changes --- .typedoc/custom-plugin.mjs | 6 ++++++ .typedoc/custom-theme.mjs | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.typedoc/custom-plugin.mjs b/.typedoc/custom-plugin.mjs index ee584a16964..13746882cd3 100644 --- a/.typedoc/custom-plugin.mjs +++ b/.typedoc/custom-plugin.mjs @@ -135,6 +135,12 @@ function getCatchAllReplacements() { pattern: /\*\*Deprecated\*\*/g, replace: '**Deprecated.**', }, + // Remove the standard experimental API notice block (with or without leading/trailing whitespace or newlines) + { + pattern: + /(?:\r?\n)?\*\*`Experimental`\*\*\r?\n\r?\nThis is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change\.\r?\nIt is advised to pin the SDK version to avoid breaking changes\.\r?\n?/g, + replace: '', + }, { /** * By default, `@default` is output with "**Default** `value`". We want to capture the value and place it inside "Defaults to `value`." diff --git a/.typedoc/custom-theme.mjs b/.typedoc/custom-theme.mjs index 6310f6a3d0a..0e81e6d89f5 100644 --- a/.typedoc/custom-theme.mjs +++ b/.typedoc/custom-theme.mjs @@ -220,11 +220,31 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { // Extract the Accessors group (if any) and prevent default rendering for it const originalGroups = customizedModel.groups; + + const experimentalGroups = originalGroups?.find(g => + g?.owningReflection?.comment?.modifierTags.has('@experimental'), + ); + + if (experimentalGroups) { + const groupsWithoutMethods = originalGroups?.filter(g => g.title === 'Properties'); + + customizedModel.groups = groupsWithoutMethods; + const nonAccessorOutput = superPartials.memberWithGroups(customizedModel, options); + customizedModel.groups = originalGroups; + + return nonAccessorOutput; + } + const accessorsGroup = originalGroups?.find(g => g.title === 'Accessors'); const groupsWithoutAccessors = originalGroups?.filter(g => g.title !== 'Accessors'); customizedModel.groups = groupsWithoutAccessors; const nonAccessorOutput = superPartials.memberWithGroups(customizedModel, options); + + if (experimentalGroups) { + return nonAccessorOutput; + } + customizedModel.groups = originalGroups; /** @type {string[]} */ From 4d6561bd1e538a5ef0fff2ad7fdb8ecd29c0925a Mon Sep 17 00:00:00 2001 From: panteliselef Date: Wed, 27 Aug 2025 22:27:51 +0300 Subject: [PATCH 03/22] wip stash changes --- package.json | 3 +- .../resources/__tests__/README-snapshots.md | 108 ++++++++++++++++++ 2 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 packages/clerk-js/src/core/resources/__tests__/README-snapshots.md diff --git a/package.json b/package.json index 4390a3e067f..bcc11d4aeb1 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "test:integration:ap-flows": "pnpm test:integration:base --grep @ap-flows", "test:integration:astro": "E2E_APP_ID=astro.* pnpm test:integration:base --grep @astro", "test:integration:base": "pnpm playwright test --config integration/playwright.config.ts", - "test:integration:billing": "E2E_APP_ID=withBilling.* pnpm test:integration:base --grep @billing", + "test:integration:billing": "E2E_APP_ID=withBilling.next.appRouter pnpm test:integration:base --grep @billing", "test:integration:cleanup": "pnpm playwright test --config integration/playwright.cleanup.config.ts", "test:integration:deployment:nextjs": "pnpm playwright test --config integration/playwright.deployments.config.ts", "test:integration:elements": "E2E_APP_ID=elements.* pnpm test:integration:base --grep @elements", @@ -52,6 +52,7 @@ "test:integration:tanstack-react-start": "E2E_APP_ID=tanstack.react-start pnpm test:integration:base --grep @tanstack-react-start", "test:integration:vue": "E2E_APP_ID=vue.vite pnpm test:integration:base --grep @vue", "test:typedoc": "pnpm typedoc:generate && cd ./.typedoc && vitest run", + "test:typedoc:update": "pnpm typedoc:generate && cd ./.typedoc && vitest --u", "turbo:clean": "turbo daemon clean", "typedoc:generate": "pnpm build:declarations && pnpm typedoc:generate:skip-build", "typedoc:generate:skip-build": "typedoc --tsconfig tsconfig.typedoc.json && rm -rf .typedoc/docs && mv .typedoc/temp-docs .typedoc/docs", diff --git a/packages/clerk-js/src/core/resources/__tests__/README-snapshots.md b/packages/clerk-js/src/core/resources/__tests__/README-snapshots.md new file mode 100644 index 00000000000..c610f201d23 --- /dev/null +++ b/packages/clerk-js/src/core/resources/__tests__/README-snapshots.md @@ -0,0 +1,108 @@ +# Snapshot Testing for Clerk Resources + +This directory contains snapshot tests for Clerk resource classes using Vitest. Snapshot tests help ensure that the structure and serialization of resource objects remain consistent over time. + +## What are Snapshot Tests? + +Snapshot tests capture the output of a function or object and store it as a "snapshot" file. When the test runs again, the current output is compared against the stored snapshot. If they differ, the test fails, alerting you to potential breaking changes. + +## How to Add Snapshot Tests + +### Basic Pattern + +```typescript +describe('ResourceName Snapshots', () => { + it('should match snapshot for resource instance structure', () => { + const resource = new ResourceName({ + // Provide test data that represents a typical resource + id: 'test_123', + name: 'Test Resource', + // ... other properties + }); + + const snapshot = { + id: resource.id, + name: resource.name, + // Include relevant public properties + }; + + expect(snapshot).toMatchSnapshot(); + }); +}); +``` + +### Testing Different States + +```typescript +it('should match snapshot for empty/null state', () => { + const resource = new ResourceName({ + id: 'empty_test', + name: null, + // ... other properties with null/empty values + } as any); // Use 'as any' if TypeScript complains about null values + + expect({ + id: resource.id, + name: resource.name, + }).toMatchSnapshot(); +}); +``` + +### Testing Serialization Methods + +For resources with `__internal_toSnapshot()` methods: + +```typescript +it('should match snapshot for __internal_toSnapshot method', () => { + const resource = new ResourceName(testData); + expect(resource.__internal_toSnapshot()).toMatchSnapshot(); +}); +``` + +## Best Practices + +1. **Use Fixed Dates**: Use `vi.useFakeTimers()` and `vi.setSystemTime()` to ensure consistent timestamps in snapshots. + +2. **Include Relevant Properties**: Focus on public API properties that consumers rely on, not internal implementation details. + +3. **Test Edge Cases**: Include tests for null values, empty states, and different configurations. + +4. **Keep Snapshots Small**: Focus on the essential structure rather than including every property. + +5. **Update When Intentional**: When you intentionally change a resource's structure, update the snapshots using `npm test -- --update-snapshots`. + +## Running Snapshot Tests + +```bash +# Run all resource tests +npm test -- src/core/resources/__tests__/*.spec.ts + +# Run specific test file +npm test -- src/core/resources/__tests__/Client.spec.ts + +# Update snapshots when structure changes intentionally +npm test -- --update-snapshots +``` + +## Examples + +See the following files for examples: + +- `Client.spec.ts` - Complex resource with nested objects +- `Environment.spec.ts` - Resource with configuration objects +- `Image.spec.ts` - Simple resource with basic properties + +## When Snapshots Fail + +When a snapshot test fails: + +1. **Review the diff** to understand what changed +2. **Determine if the change is intentional**: + - If yes: Update the snapshot with `--update-snapshots` + - If no: Fix the code to maintain backward compatibility +3. **Consider the impact** on API consumers +4. **Update documentation** if the public API changed + +## Snapshot Files + +Snapshot files are stored in `__snapshots__/` directories and should be committed to version control. They serve as documentation of your resource structures and help catch unintended changes. From 0d3c98cc98dfb20e891327c59efcc29658685fe1 Mon Sep 17 00:00:00 2001 From: panteliselef Date: Wed, 27 Aug 2025 22:28:28 +0300 Subject: [PATCH 04/22] Revert "wip changes" This reverts commit 659a1bb60c3a4cf18e3bad1b04c544e144b49a75. --- .typedoc/custom-plugin.mjs | 6 ------ .typedoc/custom-theme.mjs | 20 -------------------- 2 files changed, 26 deletions(-) diff --git a/.typedoc/custom-plugin.mjs b/.typedoc/custom-plugin.mjs index 13746882cd3..ee584a16964 100644 --- a/.typedoc/custom-plugin.mjs +++ b/.typedoc/custom-plugin.mjs @@ -135,12 +135,6 @@ function getCatchAllReplacements() { pattern: /\*\*Deprecated\*\*/g, replace: '**Deprecated.**', }, - // Remove the standard experimental API notice block (with or without leading/trailing whitespace or newlines) - { - pattern: - /(?:\r?\n)?\*\*`Experimental`\*\*\r?\n\r?\nThis is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change\.\r?\nIt is advised to pin the SDK version to avoid breaking changes\.\r?\n?/g, - replace: '', - }, { /** * By default, `@default` is output with "**Default** `value`". We want to capture the value and place it inside "Defaults to `value`." diff --git a/.typedoc/custom-theme.mjs b/.typedoc/custom-theme.mjs index 0e81e6d89f5..6310f6a3d0a 100644 --- a/.typedoc/custom-theme.mjs +++ b/.typedoc/custom-theme.mjs @@ -220,31 +220,11 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { // Extract the Accessors group (if any) and prevent default rendering for it const originalGroups = customizedModel.groups; - - const experimentalGroups = originalGroups?.find(g => - g?.owningReflection?.comment?.modifierTags.has('@experimental'), - ); - - if (experimentalGroups) { - const groupsWithoutMethods = originalGroups?.filter(g => g.title === 'Properties'); - - customizedModel.groups = groupsWithoutMethods; - const nonAccessorOutput = superPartials.memberWithGroups(customizedModel, options); - customizedModel.groups = originalGroups; - - return nonAccessorOutput; - } - const accessorsGroup = originalGroups?.find(g => g.title === 'Accessors'); const groupsWithoutAccessors = originalGroups?.filter(g => g.title !== 'Accessors'); customizedModel.groups = groupsWithoutAccessors; const nonAccessorOutput = superPartials.memberWithGroups(customizedModel, options); - - if (experimentalGroups) { - return nonAccessorOutput; - } - customizedModel.groups = originalGroups; /** @type {string[]} */ From a627eb874a39240a8db280327f56e611fe03833b Mon Sep 17 00:00:00 2001 From: panteliselef Date: Wed, 27 Aug 2025 22:29:31 +0300 Subject: [PATCH 05/22] Revert "wip typedocs files" This reverts commit a36bdf7df3c42a47829139af3da330d7369c5890. --- .gitignore | 2 +- .../docs/backend/allowlist-identifier.mdx | 13 - .typedoc/docs/backend/auth-object.mdx | 8 - .../backend/authenticate-request-options.mdx | 24 -- .typedoc/docs/backend/client.mdx | 14 - ...rce-payment-attempt-webhook-event-json.mdx | 8 - .typedoc/docs/backend/commerce-plan-json.mdx | 24 -- .typedoc/docs/backend/commerce-plan.mdx | 68 ---- .../commerce-subscription-item-json.mdx | 27 -- ...e-subscription-item-webhook-event-json.mdx | 8 - .../backend/commerce-subscription-item.mdx | 74 ---- ...mmerce-subscription-webhook-event-json.mdx | 8 - .../docs/backend/commerce-subscription.mdx | 60 ---- .typedoc/docs/backend/email-address.mdx | 14 - .typedoc/docs/backend/external-account.mdx | 22 -- .typedoc/docs/backend/get-auth-fn.mdx | 101 ------ .typedoc/docs/backend/identification-link.mdx | 8 - .../infer-auth-object-from-token-array.mdx | 5 - .../backend/infer-auth-object-from-token.mdx | 2 - .typedoc/docs/backend/invitation-status.mdx | 0 .typedoc/docs/backend/invitation.mdx | 14 - .typedoc/docs/backend/o-auth-application.mdx | 26 -- .../organization-invitation-status.mdx | 0 .../docs/backend/organization-invitation.mdx | 19 - ...ganization-membership-public-user-data.mdx | 8 - .../docs/backend/organization-membership.mdx | 15 - .../backend/organization-sync-options.mdx | 8 - .../docs/backend/organization-sync-target.mdx | 2 - .typedoc/docs/backend/organization.mdx | 19 - .../backend/paginated-resource-response.mdx | 14 - .typedoc/docs/backend/phone-number.mdx | 16 - .../backend/public-organization-data-json.mdx | 8 - .typedoc/docs/backend/redirect-url.mdx | 12 - .typedoc/docs/backend/saml-account.mdx | 15 - .typedoc/docs/backend/saml-connection.mdx | 27 -- .typedoc/docs/backend/session-activity.mdx | 14 - .typedoc/docs/backend/session.mdx | 18 - .typedoc/docs/backend/user.mdx | 47 --- .typedoc/docs/backend/verification.mdx | 13 - .../backend/verify-machine-auth-token.mdx | 12 - .../docs/backend/verify-token-options.mdx | 11 - .typedoc/docs/backend/verify-token.mdx | 83 ----- .../docs/backend/verify-webhook-options.mdx | 7 - .typedoc/docs/backend/verify-webhook.mdx | 42 --- .typedoc/docs/backend/web3-wallet.mdx | 11 - .typedoc/docs/clerk-react/api-keys.mdx | 19 - .../docs/clerk-react/clerk-provider-props.mdx | 43 --- .typedoc/docs/clerk-react/protect.mdx | 21 -- .../redirect-to-create-organization.mdx | 13 - .../redirect-to-organization-profile.mdx | 13 - .../clerk-react/redirect-to-user-profile.mdx | 13 - .typedoc/docs/clerk-react/use-auth.mdx | 176 ---------- .typedoc/docs/clerk-react/use-clerk.mdx | 43 --- .../clerk-react/use-organization-list.mdx | 146 -------- .../docs/clerk-react/use-organization.mdx | 130 ------- .../docs/clerk-react/use-reverification.mdx | 54 --- .../docs/clerk-react/use-session-list.mdx | 77 ---- .typedoc/docs/clerk-react/use-session.mdx | 89 ----- .typedoc/docs/clerk-react/use-sign-in.mdx | 73 ---- .typedoc/docs/clerk-react/use-sign-up.mdx | 73 ---- .typedoc/docs/clerk-react/use-user.mdx | 208 ----------- .typedoc/docs/nextjs/auth.mdx | 5 - .typedoc/docs/nextjs/build-clerk-props.mdx | 38 -- .../nextjs/clerk-middleware-auth-object.mdx | 3 - .../docs/nextjs/clerk-middleware-options.mdx | 29 -- .typedoc/docs/nextjs/clerk-middleware.mdx | 1 - .../docs/nextjs/create-async-get-auth.mdx | 23 -- .typedoc/docs/nextjs/create-sync-get-auth.mdx | 24 -- .typedoc/docs/nextjs/current-user.mdx | 25 -- .typedoc/docs/nextjs/get-auth.mdx | 78 ---- .../shared/api-url-from-publishable-key.mdx | 12 - .../build-clerk-js-script-attributes.mdx | 11 - .../docs/shared/build-publishable-key.mdx | 11 - .typedoc/docs/shared/camel-to-snake.mdx | 11 - .typedoc/docs/shared/clerk-js-script-url.mdx | 18 - .typedoc/docs/shared/clerk-runtime-error.mdx | 26 -- .../create-dev-or-staging-url-cache.mdx | 10 - .typedoc/docs/shared/create-path-matcher.mdx | 21 -- .typedoc/docs/shared/deep-camel-to-snake.mdx | 13 - .typedoc/docs/shared/deep-snake-to-camel.mdx | 13 - .../shared/deprecated-object-property.mdx | 21 -- .typedoc/docs/shared/derive-state.mdx | 29 -- .../extract-dev-browser-jwt-from-url.mdx | 13 - .../shared/fast-deep-merge-and-replace.mdx | 14 - .../get-clerk-js-major-version-or-tag.mdx | 14 - .typedoc/docs/shared/get-cookie-suffix.mdx | 13 - .typedoc/docs/shared/get-env-variable.mdx | 12 - .../docs/shared/get-non-undefined-values.mdx | 11 - .typedoc/docs/shared/get-script-url.mdx | 14 - .../docs/shared/get-suffixed-cookie-name.mdx | 13 - .typedoc/docs/shared/icon-image-url.mdx | 13 - .typedoc/docs/shared/in-browser.mdx | 5 - .typedoc/docs/shared/is-browser-online.mdx | 5 - .../docs/shared/is-clerk-runtime-error.mdx | 24 -- .../is-development-from-publishable-key.mdx | 12 - .../shared/is-development-from-secret-key.mdx | 12 - .typedoc/docs/shared/is-ipv4-address.mdx | 11 - .../is-production-from-publishable-key.mdx | 12 - .../shared/is-production-from-secret-key.mdx | 12 - .typedoc/docs/shared/is-publishable-key.mdx | 11 - .typedoc/docs/shared/is-staging.mdx | 11 - .typedoc/docs/shared/is-truthy.mdx | 11 - .../docs/shared/is-valid-browser-online.mdx | 5 - .typedoc/docs/shared/is-valid-browser.mdx | 5 - .typedoc/docs/shared/isomorphic-atob.mdx | 12 - .typedoc/docs/shared/load-clerk-js-script.mdx | 26 -- .../docs/shared/pages-or-infinite-options.mdx | 4 - .../docs/shared/paginated-hook-config.mdx | 4 - .typedoc/docs/shared/paginated-resources.mdx | 17 - .../docs/shared/parse-publishable-key.mdx | 47 --- .typedoc/docs/shared/read-json-file.mdx | 15 - ...et-clerk-js-loading-error-package-name.mdx | 17 - .typedoc/docs/shared/snake-to-camel.mdx | 11 - .typedoc/docs/shared/titleize.mdx | 17 - .typedoc/docs/shared/to-sentence.mdx | 11 - .typedoc/docs/shared/use-clerk.mdx | 43 --- .../shared/use-organization-list-params.mdx | 5 - .../shared/use-organization-list-return.mdx | 8 - .../docs/shared/use-organization-list.mdx | 146 -------- .../docs/shared/use-organization-params.mdx | 7 - .../docs/shared/use-organization-return.mdx | 10 - .typedoc/docs/shared/use-organization.mdx | 130 ------- .typedoc/docs/shared/use-reverification.mdx | 54 --- .typedoc/docs/shared/use-session-list.mdx | 77 ---- .typedoc/docs/shared/use-session.mdx | 89 ----- .typedoc/docs/shared/use-user.mdx | 208 ----------- .typedoc/docs/shared/user-agent-is-robot.mdx | 11 - .typedoc/docs/shared/version-selector.mdx | 17 - .typedoc/docs/types/act-claim.mdx | 1 - .typedoc/docs/types/act-jwt-claim.mdx | 5 - .../docs/types/active-session-resource.mdx | 33 -- .../docs/types/add-payment-source-params.mdx | 10 - .../docs/types/cancel-subscription-params.mdx | 10 - .../docs/types/check-authorization-fn.mdx | 9 - ...heck-authorization-from-session-claims.mdx | 13 - ...thorization-params-from-session-claims.mdx | 9 - ...-authorization-with-custom-permissions.mdx | 0 .typedoc/docs/types/clerk-api-error.mdx | 24 -- .../docs/types/clerk-api-response-error.mdx | 1 - .typedoc/docs/types/clerk-host-router.mdx | 1 - .typedoc/docs/types/clerk-jwt-claims.mdx | 28 -- .../docs/types/clerk-paginated-response.mdx | 11 - .../docs/types/clerk-pagination-params.mdx | 6 - .../docs/types/clerk-pagination-request.mdx | 8 - .typedoc/docs/types/clerk-resource.mdx | 24 -- .typedoc/docs/types/clerk-status.mdx | 0 .typedoc/docs/types/clerk.mdx | 332 ------------------ .../docs/types/commerce-billing-namespace.mdx | 24 -- .../docs/types/commerce-checkout-json.mdx | 27 -- .../docs/types/commerce-checkout-resource.mdx | 48 --- .../types/commerce-checkout-totals-json.mdx | 20 -- .../docs/types/commerce-checkout-totals.mdx | 21 -- .typedoc/docs/types/commerce-feature-json.mdx | 21 -- .../docs/types/commerce-feature-resource.mdx | 42 --- ...mmerce-initialized-payment-source-json.mdx | 20 -- ...ce-initialized-payment-source-resource.mdx | 40 --- .../docs/types/commerce-money-amount-json.mdx | 19 - .typedoc/docs/types/commerce-money-amount.mdx | 19 - .../types/commerce-payer-resource-type.mdx | 10 - .../types/commerce-payment-charge-type.mdx | 10 - .typedoc/docs/types/commerce-payment-json.mdx | 26 -- .../docs/types/commerce-payment-resource.mdx | 46 --- .../types/commerce-payment-source-json.mdx | 24 -- .../types/commerce-payment-source-methods.mdx | 18 - .../commerce-payment-source-resource.mdx | 46 --- .../types/commerce-payment-source-status.mdx | 10 - .../docs/types/commerce-payment-status.mdx | 10 - .typedoc/docs/types/commerce-plan-json.mdx | 40 --- .../docs/types/commerce-plan-resource.mdx | 52 --- .typedoc/docs/types/commerce-product-json.mdx | 21 -- .../docs/types/commerce-product-resource.mdx | 41 --- .../types/commerce-statement-group-json.mdx | 19 - .../docs/types/commerce-statement-group.mdx | 17 - .../docs/types/commerce-statement-json.mdx | 21 -- .../types/commerce-statement-resource.mdx | 41 --- .../docs/types/commerce-statement-status.mdx | 10 - .../types/commerce-statement-totals-json.mdx | 19 - .../docs/types/commerce-statement-totals.mdx | 20 -- .../types/commerce-subscription-item-json.mdx | 30 -- .../commerce-subscription-item-resource.mdx | 51 --- .../docs/types/commerce-subscription-json.mdx | 27 -- .../commerce-subscription-plan-period.mdx | 10 - .../types/commerce-subscription-resource.mdx | 45 --- .../types/commerce-subscription-status.mdx | 10 - .../docs/types/confirm-checkout-params.mdx | 10 - .../docs/types/create-checkout-params.mdx | 10 - .../docs/types/create-organization-params.mdx | 4 - .typedoc/docs/types/element-object-key.mdx | 1 - .typedoc/docs/types/elements-config.mdx | 3 - .../experimental_checkout-button-props.mdx | 23 -- ...experimental_plan-details-button-props.mdx | 22 -- ...ntal_subscription-details-button-props.mdx | 23 -- .typedoc/docs/types/for-payer-type.mdx | 10 - .../types/get-payment-attempts-params.mdx | 10 - .../docs/types/get-payment-sources-params.mdx | 10 - .typedoc/docs/types/get-plans-params.mdx | 10 - .typedoc/docs/types/get-statements-params.mdx | 10 - .../docs/types/get-subscription-params.mdx | 10 - .../docs/types/get-subscriptions-params.mdx | 10 - .typedoc/docs/types/get-token.mdx | 9 - .typedoc/docs/types/id-selectors.mdx | 1 - .../initialize-payment-source-params.mdx | 10 - .../docs/types/internal_checkout-props.mdx | 23 -- .../types/internal_plan-details-props.mdx | 24 -- .../internal_subscription-details-props.mdx | 23 -- .typedoc/docs/types/jwt-claims.mdx | 27 -- .typedoc/docs/types/jwt-header.mdx | 3 - .typedoc/docs/types/legacy-redirect-props.mdx | 13 - .typedoc/docs/types/localization-resource.mdx | 13 - .../make-default-payment-source-params.mdx | 10 - .../docs/types/multi-domain-and-or-proxy.mdx | 26 -- .../types/organization-custom-role-key.mdx | 3 - .../types/organization-domain-resource.mdx | 28 -- ...rganization-domain-verification-status.mdx | 0 .../types/organization-enrollment-mode.mdx | 0 .../organization-invitation-resource.mdx | 28 -- .../types/organization-invitation-status.mdx | 0 ...ganization-membership-request-resource.mdx | 28 -- .../organization-membership-resource.mdx | 28 -- .../types/organization-permission-key.mdx | 2 - .typedoc/docs/types/organization-resource.mdx | 34 -- .../organization-suggestion-resource.mdx | 28 -- .../types/organization-suggestion-status.mdx | 0 .../docs/types/organizations-jwt-claim.mdx | 3 - .typedoc/docs/types/override.mdx | 4 - .typedoc/docs/types/path-value.mdx | 4 - .typedoc/docs/types/payment-gateway.mdx | 10 - .../docs/types/pending-session-options.mdx | 7 - .../docs/types/pending-session-resource.mdx | 32 -- .typedoc/docs/types/protect-props.mdx | 22 -- .typedoc/docs/types/record-to-path.mdx | 4 - .typedoc/docs/types/redirect-options.mdx | 2 - .../types/remove-payment-source-params.mdx | 10 - .typedoc/docs/types/reverification-config.mdx | 10 - .typedoc/docs/types/saml-strategy.mdx | 3 - .typedoc/docs/types/sdk-metadata.mdx | 9 - .../docs/types/server-get-token-options.mdx | 10 - .typedoc/docs/types/server-get-token.mdx | 11 - .typedoc/docs/types/session-resource.mdx | 43 --- .typedoc/docs/types/session-status-claim.mdx | 1 - .typedoc/docs/types/session-task.mdx | 7 - .../docs/types/session-verification-level.mdx | 0 .../docs/types/session-verification-types.mdx | 0 .typedoc/docs/types/set-active-params.mdx | 11 - .typedoc/docs/types/set-active.mdx | 9 - .typedoc/docs/types/sign-in-resource.mdx | 30 -- .typedoc/docs/types/sign-out.mdx | 24 -- ...n-up-authenticate-with-metamask-params.mdx | 3 - .typedoc/docs/types/sign-up-resource.mdx | 29 -- .../docs/types/signed-in-session-resource.mdx | 2 - .typedoc/docs/types/state-selectors.mdx | 1 - .typedoc/docs/types/telemetry-log-entry.mdx | 1 - .typedoc/docs/types/use-auth-return.mdx | 61 ---- .../docs/types/use-session-list-return.mdx | 13 - .typedoc/docs/types/use-session-return.mdx | 19 - .typedoc/docs/types/use-sign-in-return.mdx | 13 - .typedoc/docs/types/use-sign-up-return.mdx | 13 - .typedoc/docs/types/use-user-return.mdx | 19 - .../user-organization-invitation-resource.mdx | 28 -- .typedoc/docs/types/user-resource.mdx | 38 -- .typedoc/docs/types/without.mdx | 1 - 261 files changed, 1 insertion(+), 6336 deletions(-) delete mode 100644 .typedoc/docs/backend/allowlist-identifier.mdx delete mode 100644 .typedoc/docs/backend/auth-object.mdx delete mode 100644 .typedoc/docs/backend/authenticate-request-options.mdx delete mode 100644 .typedoc/docs/backend/client.mdx delete mode 100644 .typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx delete mode 100644 .typedoc/docs/backend/commerce-plan-json.mdx delete mode 100644 .typedoc/docs/backend/commerce-plan.mdx delete mode 100644 .typedoc/docs/backend/commerce-subscription-item-json.mdx delete mode 100644 .typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx delete mode 100644 .typedoc/docs/backend/commerce-subscription-item.mdx delete mode 100644 .typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx delete mode 100644 .typedoc/docs/backend/commerce-subscription.mdx delete mode 100644 .typedoc/docs/backend/email-address.mdx delete mode 100644 .typedoc/docs/backend/external-account.mdx delete mode 100644 .typedoc/docs/backend/get-auth-fn.mdx delete mode 100644 .typedoc/docs/backend/identification-link.mdx delete mode 100644 .typedoc/docs/backend/infer-auth-object-from-token-array.mdx delete mode 100644 .typedoc/docs/backend/infer-auth-object-from-token.mdx delete mode 100644 .typedoc/docs/backend/invitation-status.mdx delete mode 100644 .typedoc/docs/backend/invitation.mdx delete mode 100644 .typedoc/docs/backend/o-auth-application.mdx delete mode 100644 .typedoc/docs/backend/organization-invitation-status.mdx delete mode 100644 .typedoc/docs/backend/organization-invitation.mdx delete mode 100644 .typedoc/docs/backend/organization-membership-public-user-data.mdx delete mode 100644 .typedoc/docs/backend/organization-membership.mdx delete mode 100644 .typedoc/docs/backend/organization-sync-options.mdx delete mode 100644 .typedoc/docs/backend/organization-sync-target.mdx delete mode 100644 .typedoc/docs/backend/organization.mdx delete mode 100644 .typedoc/docs/backend/paginated-resource-response.mdx delete mode 100644 .typedoc/docs/backend/phone-number.mdx delete mode 100644 .typedoc/docs/backend/public-organization-data-json.mdx delete mode 100644 .typedoc/docs/backend/redirect-url.mdx delete mode 100644 .typedoc/docs/backend/saml-account.mdx delete mode 100644 .typedoc/docs/backend/saml-connection.mdx delete mode 100644 .typedoc/docs/backend/session-activity.mdx delete mode 100644 .typedoc/docs/backend/session.mdx delete mode 100644 .typedoc/docs/backend/user.mdx delete mode 100644 .typedoc/docs/backend/verification.mdx delete mode 100644 .typedoc/docs/backend/verify-machine-auth-token.mdx delete mode 100644 .typedoc/docs/backend/verify-token-options.mdx delete mode 100644 .typedoc/docs/backend/verify-token.mdx delete mode 100644 .typedoc/docs/backend/verify-webhook-options.mdx delete mode 100644 .typedoc/docs/backend/verify-webhook.mdx delete mode 100644 .typedoc/docs/backend/web3-wallet.mdx delete mode 100644 .typedoc/docs/clerk-react/api-keys.mdx delete mode 100644 .typedoc/docs/clerk-react/clerk-provider-props.mdx delete mode 100644 .typedoc/docs/clerk-react/protect.mdx delete mode 100644 .typedoc/docs/clerk-react/redirect-to-create-organization.mdx delete mode 100644 .typedoc/docs/clerk-react/redirect-to-organization-profile.mdx delete mode 100644 .typedoc/docs/clerk-react/redirect-to-user-profile.mdx delete mode 100644 .typedoc/docs/clerk-react/use-auth.mdx delete mode 100644 .typedoc/docs/clerk-react/use-clerk.mdx delete mode 100644 .typedoc/docs/clerk-react/use-organization-list.mdx delete mode 100644 .typedoc/docs/clerk-react/use-organization.mdx delete mode 100644 .typedoc/docs/clerk-react/use-reverification.mdx delete mode 100644 .typedoc/docs/clerk-react/use-session-list.mdx delete mode 100644 .typedoc/docs/clerk-react/use-session.mdx delete mode 100644 .typedoc/docs/clerk-react/use-sign-in.mdx delete mode 100644 .typedoc/docs/clerk-react/use-sign-up.mdx delete mode 100644 .typedoc/docs/clerk-react/use-user.mdx delete mode 100644 .typedoc/docs/nextjs/auth.mdx delete mode 100644 .typedoc/docs/nextjs/build-clerk-props.mdx delete mode 100644 .typedoc/docs/nextjs/clerk-middleware-auth-object.mdx delete mode 100644 .typedoc/docs/nextjs/clerk-middleware-options.mdx delete mode 100644 .typedoc/docs/nextjs/clerk-middleware.mdx delete mode 100644 .typedoc/docs/nextjs/create-async-get-auth.mdx delete mode 100644 .typedoc/docs/nextjs/create-sync-get-auth.mdx delete mode 100644 .typedoc/docs/nextjs/current-user.mdx delete mode 100644 .typedoc/docs/nextjs/get-auth.mdx delete mode 100644 .typedoc/docs/shared/api-url-from-publishable-key.mdx delete mode 100644 .typedoc/docs/shared/build-clerk-js-script-attributes.mdx delete mode 100644 .typedoc/docs/shared/build-publishable-key.mdx delete mode 100644 .typedoc/docs/shared/camel-to-snake.mdx delete mode 100644 .typedoc/docs/shared/clerk-js-script-url.mdx delete mode 100644 .typedoc/docs/shared/clerk-runtime-error.mdx delete mode 100644 .typedoc/docs/shared/create-dev-or-staging-url-cache.mdx delete mode 100644 .typedoc/docs/shared/create-path-matcher.mdx delete mode 100644 .typedoc/docs/shared/deep-camel-to-snake.mdx delete mode 100644 .typedoc/docs/shared/deep-snake-to-camel.mdx delete mode 100644 .typedoc/docs/shared/deprecated-object-property.mdx delete mode 100644 .typedoc/docs/shared/derive-state.mdx delete mode 100644 .typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx delete mode 100644 .typedoc/docs/shared/fast-deep-merge-and-replace.mdx delete mode 100644 .typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx delete mode 100644 .typedoc/docs/shared/get-cookie-suffix.mdx delete mode 100644 .typedoc/docs/shared/get-env-variable.mdx delete mode 100644 .typedoc/docs/shared/get-non-undefined-values.mdx delete mode 100644 .typedoc/docs/shared/get-script-url.mdx delete mode 100644 .typedoc/docs/shared/get-suffixed-cookie-name.mdx delete mode 100644 .typedoc/docs/shared/icon-image-url.mdx delete mode 100644 .typedoc/docs/shared/in-browser.mdx delete mode 100644 .typedoc/docs/shared/is-browser-online.mdx delete mode 100644 .typedoc/docs/shared/is-clerk-runtime-error.mdx delete mode 100644 .typedoc/docs/shared/is-development-from-publishable-key.mdx delete mode 100644 .typedoc/docs/shared/is-development-from-secret-key.mdx delete mode 100644 .typedoc/docs/shared/is-ipv4-address.mdx delete mode 100644 .typedoc/docs/shared/is-production-from-publishable-key.mdx delete mode 100644 .typedoc/docs/shared/is-production-from-secret-key.mdx delete mode 100644 .typedoc/docs/shared/is-publishable-key.mdx delete mode 100644 .typedoc/docs/shared/is-staging.mdx delete mode 100644 .typedoc/docs/shared/is-truthy.mdx delete mode 100644 .typedoc/docs/shared/is-valid-browser-online.mdx delete mode 100644 .typedoc/docs/shared/is-valid-browser.mdx delete mode 100644 .typedoc/docs/shared/isomorphic-atob.mdx delete mode 100644 .typedoc/docs/shared/load-clerk-js-script.mdx delete mode 100644 .typedoc/docs/shared/pages-or-infinite-options.mdx delete mode 100644 .typedoc/docs/shared/paginated-hook-config.mdx delete mode 100644 .typedoc/docs/shared/paginated-resources.mdx delete mode 100644 .typedoc/docs/shared/parse-publishable-key.mdx delete mode 100644 .typedoc/docs/shared/read-json-file.mdx delete mode 100644 .typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx delete mode 100644 .typedoc/docs/shared/snake-to-camel.mdx delete mode 100644 .typedoc/docs/shared/titleize.mdx delete mode 100644 .typedoc/docs/shared/to-sentence.mdx delete mode 100644 .typedoc/docs/shared/use-clerk.mdx delete mode 100644 .typedoc/docs/shared/use-organization-list-params.mdx delete mode 100644 .typedoc/docs/shared/use-organization-list-return.mdx delete mode 100644 .typedoc/docs/shared/use-organization-list.mdx delete mode 100644 .typedoc/docs/shared/use-organization-params.mdx delete mode 100644 .typedoc/docs/shared/use-organization-return.mdx delete mode 100644 .typedoc/docs/shared/use-organization.mdx delete mode 100644 .typedoc/docs/shared/use-reverification.mdx delete mode 100644 .typedoc/docs/shared/use-session-list.mdx delete mode 100644 .typedoc/docs/shared/use-session.mdx delete mode 100644 .typedoc/docs/shared/use-user.mdx delete mode 100644 .typedoc/docs/shared/user-agent-is-robot.mdx delete mode 100644 .typedoc/docs/shared/version-selector.mdx delete mode 100644 .typedoc/docs/types/act-claim.mdx delete mode 100644 .typedoc/docs/types/act-jwt-claim.mdx delete mode 100644 .typedoc/docs/types/active-session-resource.mdx delete mode 100644 .typedoc/docs/types/add-payment-source-params.mdx delete mode 100644 .typedoc/docs/types/cancel-subscription-params.mdx delete mode 100644 .typedoc/docs/types/check-authorization-fn.mdx delete mode 100644 .typedoc/docs/types/check-authorization-from-session-claims.mdx delete mode 100644 .typedoc/docs/types/check-authorization-params-from-session-claims.mdx delete mode 100644 .typedoc/docs/types/check-authorization-with-custom-permissions.mdx delete mode 100644 .typedoc/docs/types/clerk-api-error.mdx delete mode 100644 .typedoc/docs/types/clerk-api-response-error.mdx delete mode 100644 .typedoc/docs/types/clerk-host-router.mdx delete mode 100644 .typedoc/docs/types/clerk-jwt-claims.mdx delete mode 100644 .typedoc/docs/types/clerk-paginated-response.mdx delete mode 100644 .typedoc/docs/types/clerk-pagination-params.mdx delete mode 100644 .typedoc/docs/types/clerk-pagination-request.mdx delete mode 100644 .typedoc/docs/types/clerk-resource.mdx delete mode 100644 .typedoc/docs/types/clerk-status.mdx delete mode 100644 .typedoc/docs/types/clerk.mdx delete mode 100644 .typedoc/docs/types/commerce-billing-namespace.mdx delete mode 100644 .typedoc/docs/types/commerce-checkout-json.mdx delete mode 100644 .typedoc/docs/types/commerce-checkout-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-checkout-totals-json.mdx delete mode 100644 .typedoc/docs/types/commerce-checkout-totals.mdx delete mode 100644 .typedoc/docs/types/commerce-feature-json.mdx delete mode 100644 .typedoc/docs/types/commerce-feature-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-initialized-payment-source-json.mdx delete mode 100644 .typedoc/docs/types/commerce-initialized-payment-source-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-money-amount-json.mdx delete mode 100644 .typedoc/docs/types/commerce-money-amount.mdx delete mode 100644 .typedoc/docs/types/commerce-payer-resource-type.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-charge-type.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-json.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-source-json.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-source-methods.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-source-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-source-status.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-status.mdx delete mode 100644 .typedoc/docs/types/commerce-plan-json.mdx delete mode 100644 .typedoc/docs/types/commerce-plan-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-product-json.mdx delete mode 100644 .typedoc/docs/types/commerce-product-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-statement-group-json.mdx delete mode 100644 .typedoc/docs/types/commerce-statement-group.mdx delete mode 100644 .typedoc/docs/types/commerce-statement-json.mdx delete mode 100644 .typedoc/docs/types/commerce-statement-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-statement-status.mdx delete mode 100644 .typedoc/docs/types/commerce-statement-totals-json.mdx delete mode 100644 .typedoc/docs/types/commerce-statement-totals.mdx delete mode 100644 .typedoc/docs/types/commerce-subscription-item-json.mdx delete mode 100644 .typedoc/docs/types/commerce-subscription-item-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-subscription-json.mdx delete mode 100644 .typedoc/docs/types/commerce-subscription-plan-period.mdx delete mode 100644 .typedoc/docs/types/commerce-subscription-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-subscription-status.mdx delete mode 100644 .typedoc/docs/types/confirm-checkout-params.mdx delete mode 100644 .typedoc/docs/types/create-checkout-params.mdx delete mode 100644 .typedoc/docs/types/create-organization-params.mdx delete mode 100644 .typedoc/docs/types/element-object-key.mdx delete mode 100644 .typedoc/docs/types/elements-config.mdx delete mode 100644 .typedoc/docs/types/experimental_checkout-button-props.mdx delete mode 100644 .typedoc/docs/types/experimental_plan-details-button-props.mdx delete mode 100644 .typedoc/docs/types/experimental_subscription-details-button-props.mdx delete mode 100644 .typedoc/docs/types/for-payer-type.mdx delete mode 100644 .typedoc/docs/types/get-payment-attempts-params.mdx delete mode 100644 .typedoc/docs/types/get-payment-sources-params.mdx delete mode 100644 .typedoc/docs/types/get-plans-params.mdx delete mode 100644 .typedoc/docs/types/get-statements-params.mdx delete mode 100644 .typedoc/docs/types/get-subscription-params.mdx delete mode 100644 .typedoc/docs/types/get-subscriptions-params.mdx delete mode 100644 .typedoc/docs/types/get-token.mdx delete mode 100644 .typedoc/docs/types/id-selectors.mdx delete mode 100644 .typedoc/docs/types/initialize-payment-source-params.mdx delete mode 100644 .typedoc/docs/types/internal_checkout-props.mdx delete mode 100644 .typedoc/docs/types/internal_plan-details-props.mdx delete mode 100644 .typedoc/docs/types/internal_subscription-details-props.mdx delete mode 100644 .typedoc/docs/types/jwt-claims.mdx delete mode 100644 .typedoc/docs/types/jwt-header.mdx delete mode 100644 .typedoc/docs/types/legacy-redirect-props.mdx delete mode 100644 .typedoc/docs/types/localization-resource.mdx delete mode 100644 .typedoc/docs/types/make-default-payment-source-params.mdx delete mode 100644 .typedoc/docs/types/multi-domain-and-or-proxy.mdx delete mode 100644 .typedoc/docs/types/organization-custom-role-key.mdx delete mode 100644 .typedoc/docs/types/organization-domain-resource.mdx delete mode 100644 .typedoc/docs/types/organization-domain-verification-status.mdx delete mode 100644 .typedoc/docs/types/organization-enrollment-mode.mdx delete mode 100644 .typedoc/docs/types/organization-invitation-resource.mdx delete mode 100644 .typedoc/docs/types/organization-invitation-status.mdx delete mode 100644 .typedoc/docs/types/organization-membership-request-resource.mdx delete mode 100644 .typedoc/docs/types/organization-membership-resource.mdx delete mode 100644 .typedoc/docs/types/organization-permission-key.mdx delete mode 100644 .typedoc/docs/types/organization-resource.mdx delete mode 100644 .typedoc/docs/types/organization-suggestion-resource.mdx delete mode 100644 .typedoc/docs/types/organization-suggestion-status.mdx delete mode 100644 .typedoc/docs/types/organizations-jwt-claim.mdx delete mode 100644 .typedoc/docs/types/override.mdx delete mode 100644 .typedoc/docs/types/path-value.mdx delete mode 100644 .typedoc/docs/types/payment-gateway.mdx delete mode 100644 .typedoc/docs/types/pending-session-options.mdx delete mode 100644 .typedoc/docs/types/pending-session-resource.mdx delete mode 100644 .typedoc/docs/types/protect-props.mdx delete mode 100644 .typedoc/docs/types/record-to-path.mdx delete mode 100644 .typedoc/docs/types/redirect-options.mdx delete mode 100644 .typedoc/docs/types/remove-payment-source-params.mdx delete mode 100644 .typedoc/docs/types/reverification-config.mdx delete mode 100644 .typedoc/docs/types/saml-strategy.mdx delete mode 100644 .typedoc/docs/types/sdk-metadata.mdx delete mode 100644 .typedoc/docs/types/server-get-token-options.mdx delete mode 100644 .typedoc/docs/types/server-get-token.mdx delete mode 100644 .typedoc/docs/types/session-resource.mdx delete mode 100644 .typedoc/docs/types/session-status-claim.mdx delete mode 100644 .typedoc/docs/types/session-task.mdx delete mode 100644 .typedoc/docs/types/session-verification-level.mdx delete mode 100644 .typedoc/docs/types/session-verification-types.mdx delete mode 100644 .typedoc/docs/types/set-active-params.mdx delete mode 100644 .typedoc/docs/types/set-active.mdx delete mode 100644 .typedoc/docs/types/sign-in-resource.mdx delete mode 100644 .typedoc/docs/types/sign-out.mdx delete mode 100644 .typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx delete mode 100644 .typedoc/docs/types/sign-up-resource.mdx delete mode 100644 .typedoc/docs/types/signed-in-session-resource.mdx delete mode 100644 .typedoc/docs/types/state-selectors.mdx delete mode 100644 .typedoc/docs/types/telemetry-log-entry.mdx delete mode 100644 .typedoc/docs/types/use-auth-return.mdx delete mode 100644 .typedoc/docs/types/use-session-list-return.mdx delete mode 100644 .typedoc/docs/types/use-session-return.mdx delete mode 100644 .typedoc/docs/types/use-sign-in-return.mdx delete mode 100644 .typedoc/docs/types/use-sign-up-return.mdx delete mode 100644 .typedoc/docs/types/use-user-return.mdx delete mode 100644 .typedoc/docs/types/user-organization-invitation-resource.mdx delete mode 100644 .typedoc/docs/types/user-resource.mdx delete mode 100644 .typedoc/docs/types/without.mdx diff --git a/.gitignore b/.gitignore index 082710d3a61..dd5f9738fb7 100644 --- a/.gitignore +++ b/.gitignore @@ -97,5 +97,5 @@ scripts/.env !scripts/.env.example # typedoc -# .typedoc/docs +.typedoc/docs .typedoc/docs.json diff --git a/.typedoc/docs/backend/allowlist-identifier.mdx b/.typedoc/docs/backend/allowlist-identifier.mdx deleted file mode 100644 index bb250e6833a..00000000000 --- a/.typedoc/docs/backend/allowlist-identifier.mdx +++ /dev/null @@ -1,13 +0,0 @@ -The Backend `AllowlistIdentifier` object represents an identifier that has been added to the allowlist of your application. The Backend `AllowlistIdentifier` object is used in the [Backend API](/docs/reference/backend-api/tag/Allow-list-Block-list#operation/ListAllowlistIdentifiers) and is not directly accessible from the Frontend API. - -## Properties - -| Property | Type | Description | -| -------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `createdAt` | `number` | The date when the allowlist identifier was first created. | -| `id` | `string` | A unique ID for the allowlist identifier. | -| `identifier` | `string` | The [identifier](/docs/authentication/configuration/sign-up-sign-in-options#identifiers) that was added to the allowlist. | -| `identifierType` | "email_address" \| "phone_number" \| "web3_wallet" | The type of the allowlist identifier. | -| `instanceId?` | `string` | The ID of the instance that this allowlist identifier belongs to. | -| `invitationId?` | `string` | The ID of the invitation sent to the identifier. | -| `updatedAt` | `number` | The date when the allowlist identifier was last updated. | diff --git a/.typedoc/docs/backend/auth-object.mdx b/.typedoc/docs/backend/auth-object.mdx deleted file mode 100644 index 06d1716405b..00000000000 --- a/.typedoc/docs/backend/auth-object.mdx +++ /dev/null @@ -1,8 +0,0 @@ -## Properties - -| 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/.typedoc/docs/backend/authenticate-request-options.mdx b/.typedoc/docs/backend/authenticate-request-options.mdx deleted file mode 100644 index b28fe984305..00000000000 --- a/.typedoc/docs/backend/authenticate-request-options.mdx +++ /dev/null @@ -1,24 +0,0 @@ -| 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/.typedoc/docs/backend/client.mdx b/.typedoc/docs/backend/client.mdx deleted file mode 100644 index f9c1d5dc0d9..00000000000 --- a/.typedoc/docs/backend/client.mdx +++ /dev/null @@ -1,14 +0,0 @@ -The Backend `Client` object is similar to the [`Client`](/docs/references/javascript/client) object as it holds information about the authenticated sessions in the current device. However, the Backend `Client` object is different from the `Client` object in that it is used in the [Backend API](/docs/reference/backend-api/tag/Clients#operation/GetClient) and is not directly accessible from the Frontend API. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------------ | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- | -| `createdAt` | `number` | The date when the `Client` was first created. | -| `id` | `string` | The unique identifier for the `Client`. | -| `lastActiveSessionId` | null \| string | The ID of the last active [Session](/docs/references/backend/types/backend-session). | -| `sessionIds` | string[] | An array of [Session](/docs/references/backend/types/backend-session){{ target: '_blank' }} IDs associated with the `Client`. | -| `sessions` | [Session](/docs/references/backend/types/backend-session)[] | An array of [Session](/docs/references/backend/types/backend-session){{ target: '_blank' }} objects associated with the `Client`. | -| `signInId` | null \| string | The ID of the [`SignIn`](/docs/references/javascript/sign-in){{ target: '_blank' }}. | -| `signUpId` | null \| string | The ID of the [`SignUp`](/docs/references/javascript/sign-up){{ target: '_blank' }}. | -| `updatedAt` | `number` | The date when the `Client` was last updated. | diff --git a/.typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx b/.typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx deleted file mode 100644 index 5cf86956ee7..00000000000 --- a/.typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx +++ /dev/null @@ -1,8 +0,0 @@ -Webhooks specific interface for CommercePaymentAttempt. - -## Properties - -| Property | Type | Description | Overrides | -| ---------------------------- | ---------------------------- | --------------------------------------- | -------------------------- | -| `id` | `string` | The unique identifier for the resource. | - | -| `object` | `"commerce_payment_attempt"` | The type of the resource. | `ClerkResourceJSON.object` | diff --git a/.typedoc/docs/backend/commerce-plan-json.mdx b/.typedoc/docs/backend/commerce-plan-json.mdx deleted file mode 100644 index da74022198c..00000000000 --- a/.typedoc/docs/backend/commerce-plan-json.mdx +++ /dev/null @@ -1,24 +0,0 @@ -**`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` | `CommerceMoneyAmountJSON` | **`Experimental`** | - | -| `annual_monthly_fee` | `CommerceMoneyAmountJSON` | **`Experimental`** | - | -| `description?` | `string` | **`Experimental`** | - | -| `features` | FeatureJSON[] | **`Experimental`** | - | -| `fee` | `CommerceMoneyAmountJSON` | **`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/.typedoc/docs/backend/commerce-plan.mdx b/.typedoc/docs/backend/commerce-plan.mdx deleted file mode 100644 index f43e80be19f..00000000000 --- a/.typedoc/docs/backend/commerce-plan.mdx +++ /dev/null @@ -1,68 +0,0 @@ -**`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` | `CommerceMoneyAmount` | The monthly fee of the plan. | -| `annualFee` | `CommerceMoneyAmount` | The annual fee of the plan. | -| `annualMonthlyFee` | `CommerceMoneyAmount` | 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` | `CommerceMoneyAmount` | **`Experimental`** The annual fee of the plan. | -| `annualMonthlyFee` | `CommerceMoneyAmount` | **`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` | `CommerceMoneyAmount` | **`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/.typedoc/docs/backend/commerce-subscription-item-json.mdx b/.typedoc/docs/backend/commerce-subscription-item-json.mdx deleted file mode 100644 index adb3ec596ea..00000000000 --- a/.typedoc/docs/backend/commerce-subscription-item-json.mdx +++ /dev/null @@ -1,27 +0,0 @@ -**`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 | -| ------------------------------------------- | -------------------------------------------------------- | ---------------------------------------------------------- | -------------------------- | -| `amount` | null \| CommerceMoneyAmountJSON | **`Experimental`** | - | -| `canceled_at` | null \| number | **`Experimental`** | - | -| `created_at` | `number` | **`Experimental`** | - | -| `ended_at` | null \| number | **`Experimental`** | - | -| `id` | `string` | **`Experimental`** The unique identifier for the resource. | - | -| `is_free_trial?` | `boolean` | **`Experimental`** | - | -| `lifetime_paid` | `CommerceMoneyAmountJSON` | **`Experimental`** | - | -| `next_payment` | null \| \{ amount: number; date: number; \} | **`Experimental`** | - | -| `object` | `"commerce_subscription_item"` | **`Experimental`** The type of the resource. | `ClerkResourceJSON.object` | -| `past_due_at` | null \| number | **`Experimental`** | - | -| `payer_id` | `string` | **`Experimental`** | - | -| `period_end` | null \| number | **`Experimental`** | - | -| `period_start` | `number` | **`Experimental`** | - | -| `plan` | [`CommercePlanJSON`](commerce-plan-json.mdx) | **`Experimental`** | - | -| `plan_id` | `string` | **`Experimental`** | - | -| `plan_period` | "month" \| "annual" | **`Experimental`** | - | -| `status` | `CommerceSubscriptionItemStatus` | **`Experimental`** | - | -| `updated_at` | `number` | **`Experimental`** | - | diff --git a/.typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx b/.typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx deleted file mode 100644 index 103e78c0efe..00000000000 --- a/.typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx +++ /dev/null @@ -1,8 +0,0 @@ -Webhooks specific interface for CommerceSubscriptionItem. - -## Properties - -| Property | Type | Description | Overrides | -| ---------------------------- | ------------------------------ | --------------------------------------- | -------------------------- | -| `id` | `string` | The unique identifier for the resource. | - | -| `object` | `"commerce_subscription_item"` | The type of the resource. | `ClerkResourceJSON.object` | diff --git a/.typedoc/docs/backend/commerce-subscription-item.mdx b/.typedoc/docs/backend/commerce-subscription-item.mdx deleted file mode 100644 index 152a89b9219..00000000000 --- a/.typedoc/docs/backend/commerce-subscription-item.mdx +++ /dev/null @@ -1,74 +0,0 @@ -**`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 subscription item. | -| `status` | `CommerceSubscriptionItemStatus` | The status of the subscription item. | -| `planPeriod` | "month" \| "annual" | The plan period for the subscription item. | -| `periodStart` | `number` | The start of the current period. | -| `nextPayment` | null \| \{ amount: number; date: number; \} | The next payment information. | -| `amount` | undefined \| null \| CommerceMoneyAmount | The current amount for the subscription item. | -| `plan` | [`CommercePlan`](commerce-plan.mdx) | The plan associated with this subscription item. | -| `planId` | `string` | The plan ID. | -| `createdAt` | `number` | The date and time the subscription item was created. | -| `updatedAt` | `number` | The date and time the subscription item was last updated. | -| `periodEnd` | null \| number | The end of the current period. | -| `canceledAt` | null \| number | When the subscription item was canceled. | -| `pastDueAt` | null \| number | When the subscription item became past due. | -| `endedAt` | null \| number | When the subscription item ended. | -| `payerId` | `string` | The payer ID. | -| `isFreeTrial?` | `boolean` | Whether this subscription item is currently in a free trial period. | -| `lifetimePaid?` | null \| CommerceMoneyAmount | The lifetime amount paid for this subscription item. | - -#### Returns - -`CommerceSubscriptionItem` - -## Properties - -| Property | Type | Description | -| ----------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `amount` | undefined \| null \| CommerceMoneyAmount | **`Experimental`** The current amount for the subscription item. | -| `canceledAt` | null \| number | **`Experimental`** When the subscription item was canceled. | -| `createdAt` | `number` | **`Experimental`** The date and time the subscription item was created. | -| `endedAt` | null \| number | **`Experimental`** When the subscription item ended. | -| `id` | `string` | **`Experimental`** The unique identifier for the subscription item. | -| `isFreeTrial?` | `boolean` | **`Experimental`** Whether this subscription item is currently in a free trial period. | -| `lifetimePaid?` | null \| CommerceMoneyAmount | **`Experimental`** The lifetime amount paid for this subscription item. | -| `nextPayment` | null \| \{ amount: number; date: number; \} | **`Experimental`** The next payment information. | -| `pastDueAt` | null \| number | **`Experimental`** When the subscription item became past due. | -| `payerId` | `string` | **`Experimental`** The payer ID. | -| `periodEnd` | null \| number | **`Experimental`** The end of the current period. | -| `periodStart` | `number` | **`Experimental`** The start of the current period. | -| `plan` | [`CommercePlan`](commerce-plan.mdx) | **`Experimental`** The plan associated with this subscription item. | -| `planId` | `string` | **`Experimental`** The plan ID. | -| `planPeriod` | "month" \| "annual" | **`Experimental`** The plan period for the subscription item. | -| `status` | `CommerceSubscriptionItemStatus` | **`Experimental`** The status of the subscription item. | -| `updatedAt` | `number` | **`Experimental`** The date and time the subscription item was last updated. | - -## Methods - -### fromJSON() - -**`Experimental`** - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------------------------------------------------- | -| `data` | [`CommerceSubscriptionItemJSON`](commerce-subscription-item-json.mdx) | - -#### Returns - -`CommerceSubscriptionItem` diff --git a/.typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx b/.typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx deleted file mode 100644 index 587f9b985a1..00000000000 --- a/.typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx +++ /dev/null @@ -1,8 +0,0 @@ -Webhooks specific interface for CommerceSubscription. - -## Properties - -| Property | Type | Description | Overrides | -| ---------------------------- | ------------------------- | --------------------------------------- | -------------------------- | -| `id` | `string` | The unique identifier for the resource. | - | -| `object` | `"commerce_subscription"` | The type of the resource. | `ClerkResourceJSON.object` | diff --git a/.typedoc/docs/backend/commerce-subscription.mdx b/.typedoc/docs/backend/commerce-subscription.mdx deleted file mode 100644 index 9343e46b5f0..00000000000 --- a/.typedoc/docs/backend/commerce-subscription.mdx +++ /dev/null @@ -1,60 +0,0 @@ -**`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 commerce subscription. | -| `status` | "abandoned" \| "active" \| "ended" \| "canceled" \| "incomplete" \| "past_due" | The current status of the subscription. | -| `payerId` | `string` | The ID of the payer for this subscription. | -| `createdAt` | `number` | Unix timestamp (milliseconds) of creation. | -| `updatedAt` | `number` | Unix timestamp (milliseconds) of last update. | -| `activeAt` | null \| number | Unix timestamp (milliseconds) when the subscription became active. | -| `pastDueAt` | null \| number | Unix timestamp (milliseconds) when the subscription became past due. | -| `subscriptionItems` | [CommerceSubscriptionItem](commerce-subscription-item.mdx)[] | Array of subscription items in this subscription. | -| `nextPayment` | null \| \{ amount: CommerceMoneyAmount; date: number; \} | Information about the next scheduled payment. | -| `eligibleForFreeTrial` | `boolean` | Whether the payer is eligible for a free trial. | - -#### Returns - -`CommerceSubscription` - -## Properties - -| Property | Type | Description | -| -------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `activeAt` | null \| number | **`Experimental`** Unix timestamp (milliseconds) when the subscription became active. | -| `createdAt` | `number` | **`Experimental`** Unix timestamp (milliseconds) of creation. | -| `eligibleForFreeTrial` | `boolean` | **`Experimental`** Whether the payer is eligible for a free trial. | -| `id` | `string` | **`Experimental`** The unique identifier for the commerce subscription. | -| `nextPayment` | null \| \{ amount: CommerceMoneyAmount; date: number; \} | **`Experimental`** Information about the next scheduled payment. | -| `pastDueAt` | null \| number | **`Experimental`** Unix timestamp (milliseconds) when the subscription became past due. | -| `payerId` | `string` | **`Experimental`** The ID of the payer for this subscription. | -| `status` | "abandoned" \| "active" \| "ended" \| "canceled" \| "incomplete" \| "past_due" | **`Experimental`** The current status of the subscription. | -| `subscriptionItems` | [CommerceSubscriptionItem](commerce-subscription-item.mdx)[] | **`Experimental`** Array of subscription items in this subscription. | -| `updatedAt` | `number` | **`Experimental`** Unix timestamp (milliseconds) of last update. | - -## Methods - -### fromJSON() - -**`Experimental`** - -#### Parameters - -| Parameter | Type | -| --------- | -------------------------- | -| `data` | `CommerceSubscriptionJSON` | - -#### Returns - -`CommerceSubscription` diff --git a/.typedoc/docs/backend/email-address.mdx b/.typedoc/docs/backend/email-address.mdx deleted file mode 100644 index f4ddfe2caf9..00000000000 --- a/.typedoc/docs/backend/email-address.mdx +++ /dev/null @@ -1,14 +0,0 @@ -The Backend `EmailAddress` object is a model around an email address. Email addresses are one of the [identifiers](/docs/authentication/configuration/sign-up-sign-in-options#identifiers) used to provide identification for users. - -Email addresses must be **verified** to ensure that they are assigned to their rightful owners. The `EmailAddress` object holds all necessary state around the verification process. - -For implementation examples for adding and verifying email addresses, see the [email link custom flow](/docs/custom-flows/email-links) and [email code custom flow](/docs/custom-flows/add-email) guides. - -## Properties - -| Property | Type | Description | -| ---------------------------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `emailAddress` | `string` | The value of the email address. | -| `id` | `string` | The unique identifier for the email address. | -| `linkedTo` | [IdentificationLink](/docs/references/backend/types/backend-identification-link)[] | An array of objects containing information about any identifications that might be linked to the email address. | -| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of the email address. | diff --git a/.typedoc/docs/backend/external-account.mdx b/.typedoc/docs/backend/external-account.mdx deleted file mode 100644 index 278b9fdae4d..00000000000 --- a/.typedoc/docs/backend/external-account.mdx +++ /dev/null @@ -1,22 +0,0 @@ -The Backend `ExternalAccount` object is a model around an identification obtained by an external provider (e.g. a social provider such as Google). - -External account must be verified, so that you can make sure they can be assigned to their rightful owners. The `ExternalAccount` object holds all necessary state around the verification process. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------ | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `approvedScopes` | `string` | The scopes that the user has granted access to. | -| `emailAddress` | `string` | The user's email address. | -| `externalId` | `string` | The unique ID of the user in the provider. | -| `firstName` | `string` | The user's first name. | -| `id` | `string` | The unique identifier for this external account. | -| `identificationId` | `string` | The identification with which this external account is associated. | -| `imageUrl` | `string` | The user's image URL. | -| `label` | null \| string | A descriptive label to differentiate multiple external accounts of the same user for the same provider. | -| `lastName` | `string` | The user's last name. | -| `phoneNumber` | null \| string | The phone number related to this specific external account. | -| `provider` | `string` | The provider name (e.g., `google`). | -| `publicMetadata` | null \| Record\ | Metadata that can be read from the Frontend API and Backend API and can be set only from the Backend API. | -| `username` | null \| string | The user's username. | -| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of this external account. | diff --git a/.typedoc/docs/backend/get-auth-fn.mdx b/.typedoc/docs/backend/get-auth-fn.mdx deleted file mode 100644 index d069f7df58b..00000000000 --- a/.typedoc/docs/backend/get-auth-fn.mdx +++ /dev/null @@ -1,101 +0,0 @@ -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/.typedoc/docs/backend/identification-link.mdx b/.typedoc/docs/backend/identification-link.mdx deleted file mode 100644 index 5ed1b59fce1..00000000000 --- a/.typedoc/docs/backend/identification-link.mdx +++ /dev/null @@ -1,8 +0,0 @@ -Contains information about any identifications that might be linked to the email address. - -## Properties - -| Property | Type | Description | -| ------------------------ | -------- | ------------------------------------------------------------------------------------ | -| `id` | `string` | The unique identifier for the identification link. | -| `type` | `string` | The type of the identification link, e.g., `"email_address"`, `"phone_number"`, etc. | diff --git a/.typedoc/docs/backend/infer-auth-object-from-token-array.mdx b/.typedoc/docs/backend/infer-auth-object-from-token-array.mdx deleted file mode 100644 index a7421ad97d0..00000000000 --- a/.typedoc/docs/backend/infer-auth-object-from-token-array.mdx +++ /dev/null @@ -1,5 +0,0 @@ -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/.typedoc/docs/backend/infer-auth-object-from-token.mdx b/.typedoc/docs/backend/infer-auth-object-from-token.mdx deleted file mode 100644 index 09a78f383a0..00000000000 --- a/.typedoc/docs/backend/infer-auth-object-from-token.mdx +++ /dev/null @@ -1,2 +0,0 @@ -Infers auth object type from a single token type. -Returns SessionType for session tokens, or MachineType for machine tokens. diff --git a/.typedoc/docs/backend/invitation-status.mdx b/.typedoc/docs/backend/invitation-status.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/backend/invitation.mdx b/.typedoc/docs/backend/invitation.mdx deleted file mode 100644 index f7581ba48cd..00000000000 --- a/.typedoc/docs/backend/invitation.mdx +++ /dev/null @@ -1,14 +0,0 @@ -The Backend `Invitation` object represents an invitation to join your application. - -## Properties - -| Property | Type | Description | -| -------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `createdAt` | `number` | The date when the `Invitation` was first created. | -| `emailAddress` | `string` | The email address that the invitation was sent to. | -| `id` | `string` | The unique identifier for the `Invitation`. | -| `publicMetadata` | null \| Record\ | [Metadata](/docs/references/javascript/types/metadata#user-public-metadata){{ target: '_blank' }} that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. Once the user accepts the invitation and signs up, these metadata will end up in the user's public metadata. | -| `revoked?` | `boolean` | Whether the `Invitation` has been revoked. | -| `status` | "expired" \| "revoked" \| "pending" \| "accepted" | The status of the `Invitation`. | -| `updatedAt` | `number` | The date when the `Invitation` was last updated. | -| `url?` | `string` | The URL that the user can use to accept the invitation. | diff --git a/.typedoc/docs/backend/o-auth-application.mdx b/.typedoc/docs/backend/o-auth-application.mdx deleted file mode 100644 index 030d68ff7b0..00000000000 --- a/.typedoc/docs/backend/o-auth-application.mdx +++ /dev/null @@ -1,26 +0,0 @@ -The Backend `OAuthApplication` object holds information about an OAuth application. - -## Properties - -| Property | Type | Description | -| ---------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `authorizeUrl` | `string` | The URL used to authorize the user and obtain an authorization code. | -| `clientId` | `string` | The ID of the client associated with the OAuth application. | -| `clientImageUrl` | null \| string | The URL of the image or logo representing the OAuth application. | -| `clientSecret?` | `string` | The client secret associated with the OAuth application. Empty if public client. | -| `clientUri` | null \| string | The public-facing URL of the OAuth application, often shown on consent screens. | -| `consentScreenEnabled` | `boolean` | Specifies whether the consent screen should be displayed in the authentication flow. Cannot be disabled for dynamically registered OAuth applications. | -| `createdAt` | `number` | The date when the OAuth application was first created. | -| `discoveryUrl` | `string` | The OpenID Connect discovery endpoint URL for this OAuth application. | -| `dynamicallyRegistered` | `boolean` | Specifies whether the OAuth application is dynamically registered. | -| `id` | `string` | The unique identifier for the OAuth application. | -| `instanceId` | `string` | The ID of the instance that this OAuth application belongs to. | -| `isPublic` | `boolean` | Indicates whether the client is public. If true, the Proof Key of Code Exchange (PKCE) flow can be used. | -| `name` | `string` | The name of the new OAuth application. | -| `pkceRequired` | `boolean` | Specifies whether the Proof Key of Code Exchange (PKCE) flow should be required in the authentication flow. | -| `redirectUris` | string[] | An array of redirect URIs of the new OAuth application. | -| `scopes` | `string` | Scopes for the new OAuth application. | -| `tokenFetchUrl` | `string` | The URL used by the client to exchange an authorization code for an access token. | -| `tokenIntrospectionUrl` | `string` | The URL used to introspect and validate issued access tokens. | -| `updatedAt` | `number` | The date when the OAuth application was last updated. | -| `userInfoUrl` | `string` | The URL where the client can retrieve user information using an access token. | diff --git a/.typedoc/docs/backend/organization-invitation-status.mdx b/.typedoc/docs/backend/organization-invitation-status.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/backend/organization-invitation.mdx b/.typedoc/docs/backend/organization-invitation.mdx deleted file mode 100644 index 41b8a55b0a7..00000000000 --- a/.typedoc/docs/backend/organization-invitation.mdx +++ /dev/null @@ -1,19 +0,0 @@ -The Backend `OrganizationInvitation` object is similar to the [`OrganizationInvitation`](/docs/references/javascript/types/organization-invitation) object as it's the model around an organization invitation. However, the Backend `OrganizationInvitation` object is different in that it's used in the [Backend API](/docs/reference/backend-api/tag/Organization-Invitations#operation/CreateOrganizationInvitation){{ target: '_blank' }} and is not directly accessible from the Frontend API. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `createdAt` | `number` | The date when the invitation was first created. | -| `emailAddress` | `string` | The email address of the user who is invited to the [`Organization`](/docs/references/backend/types/backend-organization). | -| `expiresAt` | `number` | The date when the invitation expires. | -| `id` | `string` | The unique identifier for the `OrganizationInvitation`. | -| `organizationId` | `string` | The ID of the [`Organization`](/docs/references/backend/types/backend-organization) that the user is invited to. | -| `privateMetadata` | [`OrganizationInvitationPrivateMetadata`](/docs/references/javascript/types/metadata#organization-invitation-private-metadata) | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | -| `publicMetadata` | [`OrganizationInvitationPublicMetadata`](/docs/references/javascript/types/metadata#organization-invitation-public-metadata) | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | -| `publicOrganizationData?` | null \| [PublicOrganizationDataJSON](#public-organization-data-json) | Public data about the organization that the user is invited to. | -| `role` | `string` | The role of the invited user. | -| `roleName` | `string` | The name of the role of the invited user. | -| `status?` | "expired" \| "revoked" \| "pending" \| "accepted" | The status of the invitation. | -| `updatedAt` | `number` | The date when the invitation was last updated. | -| `url` | null \| string | The URL that the user can use to accept the invitation. | diff --git a/.typedoc/docs/backend/organization-membership-public-user-data.mdx b/.typedoc/docs/backend/organization-membership-public-user-data.mdx deleted file mode 100644 index 0c5cc72dbcd..00000000000 --- a/.typedoc/docs/backend/organization-membership-public-user-data.mdx +++ /dev/null @@ -1,8 +0,0 @@ -| Property | Type | Description | -| ------------------------------------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `firstName` | null \| string | The first name of the user. | -| `hasImage` | `boolean` | Whether the user has a profile picture. | -| `identifier` | `string` | The [identifier](/docs/authentication/configuration/sign-up-sign-in-options#identifiers) of the user. | -| `imageUrl` | `string` | Holds the default avatar or user's uploaded profile image. Compatible with Clerk's [Image Optimization](/docs/guides/image-optimization). | -| `lastName` | null \| string | The last name of the user. | -| `userId` | `string` | The ID of the user that this public data belongs to. | diff --git a/.typedoc/docs/backend/organization-membership.mdx b/.typedoc/docs/backend/organization-membership.mdx deleted file mode 100644 index 585912c6ef4..00000000000 --- a/.typedoc/docs/backend/organization-membership.mdx +++ /dev/null @@ -1,15 +0,0 @@ -The Backend `OrganizationMembership` object is similar to the [`OrganizationMembership`](/docs/references/javascript/types/organization-membership) object as it's the model around an organization membership entity and describes the relationship between users and organizations. However, the Backend `OrganizationMembership` object is different in that it's used in the [Backend API](/docs/reference/backend-api/tag/Organization-Memberships#operation/CreateOrganizationMembership){{ target: '_blank' }} and is not directly accessible from the Frontend API. - -## Properties - -| Property | Type | Description | -| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `createdAt` | `number` | The date when the membership was first created. | -| `id` | `string` | The unique identifier for the membership. | -| `organization` | [`Organization`](/docs/references/backend/types/backend-organization) | The organization that the user is a member of. | -| `permissions` | string[] | The permissions granted to the user in the organization. | -| `privateMetadata` | [`OrganizationMembershipPrivateMetadata`](/docs/references/javascript/types/metadata#organization-membership-private-metadata) | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | -| `publicMetadata` | [`OrganizationMembershipPublicMetadata`](/docs/references/javascript/types/metadata#organization-membership-public-metadata) | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | -| `publicUserData?` | null \| [OrganizationMembershipPublicUserData](#organization-membership-public-user-data) | Public information about the user that this membership belongs to. | -| `role` | `string` | The role of the user. | -| `updatedAt` | `number` | The date when the membership was last updated. | diff --git a/.typedoc/docs/backend/organization-sync-options.mdx b/.typedoc/docs/backend/organization-sync-options.mdx deleted file mode 100644 index 5a3609e438f..00000000000 --- a/.typedoc/docs/backend/organization-sync-options.mdx +++ /dev/null @@ -1,8 +0,0 @@ -> **OrganizationSyncOptions** = \{ organizationPatterns?: Pattern[]; personalAccountPatterns?: Pattern[]; \} - -## Properties - -| Property | Type | Description | -| --------------------------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `organizationPatterns?` | Pattern[] | 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/(.*)"]`. | -| `personalAccountPatterns?` | Pattern[] | 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/.typedoc/docs/backend/organization-sync-target.mdx b/.typedoc/docs/backend/organization-sync-target.mdx deleted file mode 100644 index 42fb0f448bb..00000000000 --- a/.typedoc/docs/backend/organization-sync-target.mdx +++ /dev/null @@ -1,2 +0,0 @@ -Represents an organization or a personal account - e.g. an -entity that can be activated by the handshake API. diff --git a/.typedoc/docs/backend/organization.mdx b/.typedoc/docs/backend/organization.mdx deleted file mode 100644 index 4da8acac205..00000000000 --- a/.typedoc/docs/backend/organization.mdx +++ /dev/null @@ -1,19 +0,0 @@ -The Backend `Organization` object is similar to the [`Organization`](/docs/references/javascript/organization) object as it holds information about an organization, as well as methods for managing it. However, the Backend `Organization` object is different in that it is used in the [Backend API](/docs/reference/backend-api/tag/Organizations#operation/ListOrganizations){{ target: '_blank' }} and is not directly accessible from the Frontend API. - -## Properties - -| Property | Type | Description | -| ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `adminDeleteEnabled` | `boolean` | Whether the organization allows admins to delete users. | -| `createdAt` | `number` | The date when the organization was first created. | -| `createdBy?` | `string` | The ID of the user who created the organization. | -| `hasImage` | `boolean` | Whether the organization has an image. | -| `id` | `string` | The unique identifier for the organization. | -| `imageUrl` | `string` | Holds the organization's logo. Compatible with Clerk's [Image Optimization](/docs/guides/image-optimization). | -| `maxAllowedMemberships` | `number` | The maximum number of memberships allowed in the organization. | -| `membersCount?` | `number` | The number of members in the organization. | -| `name` | `string` | The name of the organization. | -| `privateMetadata` | [`OrganizationPrivateMetadata`](/docs/references/javascript/types/metadata#organization-private-metadata) | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | -| `publicMetadata` | null \| [OrganizationPublicMetadata](/docs/references/javascript/types/metadata#organization-public-metadata) | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | -| `slug` | `string` | The URL-friendly identifier of the user's active organization. If supplied, it must be unique for the instance. | -| `updatedAt` | `number` | The date when the organization was last updated. | diff --git a/.typedoc/docs/backend/paginated-resource-response.mdx b/.typedoc/docs/backend/paginated-resource-response.mdx deleted file mode 100644 index 1603ff21b4e..00000000000 --- a/.typedoc/docs/backend/paginated-resource-response.mdx +++ /dev/null @@ -1,14 +0,0 @@ -An interface that describes the response of a method that returns a paginated list of resources. - -If the promise resolves, you will get back the [properties](#properties) listed below. `data` will be an array of the resource type you requested. You can use the `totalCount` property to determine how many total items exist remotely. - -Some methods that return this type allow pagination with the `limit` and `offset` parameters, in which case the first 10 items will be returned by default. For methods such as [`getAllowlistIdentifierList()`](/docs/references/backend/allowlist/get-allowlist-identifier-list), which do not take a `limit` or `offset`, all items will be returned. - -If the promise is rejected, you will receive a `ClerkAPIResponseError` or network error. - -## Properties - -| Property | Type | Description | -| ------------------------------------ | -------- | -------------------------------------------- | -| `data` | `T` | An array that contains the fetched data. | -| `totalCount` | `number` | The total count of data that exist remotely. | diff --git a/.typedoc/docs/backend/phone-number.mdx b/.typedoc/docs/backend/phone-number.mdx deleted file mode 100644 index 01d074308db..00000000000 --- a/.typedoc/docs/backend/phone-number.mdx +++ /dev/null @@ -1,16 +0,0 @@ -The Backend `PhoneNumber` object describes a phone number. Phone numbers can be used as a proof of identification for users, or simply as a means of contacting users. - -Phone numbers must be **verified** to ensure that they can be assigned to their rightful owners. The `PhoneNumber` object holds all the necessary state around the verification process. - -Finally, phone numbers can be used as part of [multi-factor authentication](/docs/authentication/configuration/sign-up-sign-in-options#multi-factor-authentication). During sign in, users can opt in to an extra verification step where they will receive an SMS message with a one-time code. This code must be entered to complete the sign in process. - -## Properties - -| Property | Type | Description | -| -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `defaultSecondFactor` | `boolean` | Set to `true` if this phone number is the default second factor. Set to `false` otherwise. A user must have exactly one default second factor, if multi-factor authentication (2FA) is enabled. | -| `id` | `string` | The unique identifier for this phone number. | -| `linkedTo` | [IdentificationLink](/docs/references/backend/types/backend-identification-link)[] | An object containing information about any other identification that might be linked to this phone number. | -| `phoneNumber` | `string` | The value of this phone number, in [E.164 format](https://en.wikipedia.org/wiki/E.164). | -| `reservedForSecondFactor` | `boolean` | Set to `true` if this phone number is reserved for multi-factor authentication (2FA). Set to `false` otherwise. | -| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of this phone number. | diff --git a/.typedoc/docs/backend/public-organization-data-json.mdx b/.typedoc/docs/backend/public-organization-data-json.mdx deleted file mode 100644 index 4a509f0f1b1..00000000000 --- a/.typedoc/docs/backend/public-organization-data-json.mdx +++ /dev/null @@ -1,8 +0,0 @@ -| Property | Type | Description | -| ----------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------- | -| `has_image` | `boolean` | Whether the organization has a profile image. | -| `id` | `string` | The unique identifier for the resource. | -| `image_url?` | `string` | Holds the default organization profile image. Compatible with Clerk's [Image Optimization](/docs/guides/image-optimization). | -| `name` | `string` | The name of the organization. | -| `object` | `ObjectType` | The type of the resource. | -| `slug` | `string` | The slug of the organization. | diff --git a/.typedoc/docs/backend/redirect-url.mdx b/.typedoc/docs/backend/redirect-url.mdx deleted file mode 100644 index 1b128348cea..00000000000 --- a/.typedoc/docs/backend/redirect-url.mdx +++ /dev/null @@ -1,12 +0,0 @@ -Redirect URLs are whitelisted URLs that facilitate secure authentication flows in native applications (e.g. React Native, Expo). In these contexts, Clerk ensures that security-critical nonces are passed only to the whitelisted URLs. - -The Backend `RedirectUrl` object represents a redirect URL in your application. This object is used in the Backend API. - -## Properties - -| Property | Type | Description | -| ---------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `createdAt` | `number` | The date when the redirect URL was first created. | -| `id` | `string` | The unique identifier for the redirect URL. | -| `updatedAt` | `number` | The date when the redirect URL was last updated. | -| `url` | `string` | The full URL value prefixed with `https://` or a custom scheme. Examples: `https://my-app.com/oauth-callback`, `my-app://oauth-callback`. | diff --git a/.typedoc/docs/backend/saml-account.mdx b/.typedoc/docs/backend/saml-account.mdx deleted file mode 100644 index 9099ed83ecc..00000000000 --- a/.typedoc/docs/backend/saml-account.mdx +++ /dev/null @@ -1,15 +0,0 @@ -The Backend `SamlAccount` object describes a SAML account. - -## Properties - -| Property | Type | Description | -| -------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------ | -| `active` | `boolean` | A boolean that indicates whether the SAML account is active. | -| `emailAddress` | `string` | The email address of the SAML account. | -| `firstName` | `string` | The first name of the SAML account. | -| `id` | `string` | The unique identifier for the SAML account. | -| `lastName` | `string` | The last name of the SAML account. | -| `provider` | `string` | The provider of the SAML account. | -| `providerUserId` | null \| string | The user's ID as used in the provider. | -| `samlConnection` | null \| SamlAccountConnection | The SAML connection of the SAML account. | -| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | The verification of the SAML account. | diff --git a/.typedoc/docs/backend/saml-connection.mdx b/.typedoc/docs/backend/saml-connection.mdx deleted file mode 100644 index d55d90126bd..00000000000 --- a/.typedoc/docs/backend/saml-connection.mdx +++ /dev/null @@ -1,27 +0,0 @@ -The Backend `SamlConnection` object holds information about a SAML connection for an organization. - -## Properties - -| Property | Type | Description | -| ---------------------------------------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `acsUrl` | `string` | The Assertion Consumer Service (ACS) URL of the connection. | -| `active` | `boolean` | Indicates whether the connection is active or not. | -| `allowIdpInitiated` | `boolean` | Indicates whether the connection allows Identity Provider (IdP) initiated flows or not. | -| `allowSubdomains` | `boolean` | Indicates whether users with an email address subdomain are allowed to use this connection in order to authenticate or not. | -| `attributeMapping` | `AttributeMapping` | Defines the attribute name mapping between the Identity Provider (IdP) and Clerk's [`User`](/docs/references/javascript/user) properties. | -| `createdAt` | `number` | The date when the connection was first created. | -| `domain` | `string` | The domain of your organization. Sign in flows using an email with this domain will use the connection. | -| `id` | `string` | The unique identifier for the connection. | -| `idpCertificate` | null \| string | The X.509 certificate as provided by the Identity Provider (IdP). | -| `idpEntityId` | null \| string | The Entity ID as provided by the Identity Provider (IdP). | -| `idpMetadata` | null \| string | The XML content of the Identity Provider (IdP) metadata file. If present, it takes priority over the corresponding individual properties. | -| `idpMetadataUrl` | null \| string | The URL which serves the Identity Provider (IdP) metadata. If present, it takes priority over the corresponding individual properties. | -| `idpSsoUrl` | null \| string | The Single-Sign On URL as provided by the Identity Provider (IdP). | -| `name` | `string` | The name to use as a label for the connection. | -| `organizationId` | null \| string | The organization ID of the organization. | -| `provider` | `string` | The Identity Provider (IdP) of the connection. | -| `spEntityId` | `string` | The Entity ID as provided by the Service Provider (Clerk). | -| `spMetadataUrl` | `string` | The metadata URL as provided by the Service Provider (Clerk). | -| `syncUserAttributes` | `boolean` | Indicates whether the connection syncs user attributes between the Service Provider (SP) and Identity Provider (IdP) or not. | -| `updatedAt` | `number` | The date when the SAML connection was last updated. | -| `userCount` | `number` | The number of users associated with the connection. | diff --git a/.typedoc/docs/backend/session-activity.mdx b/.typedoc/docs/backend/session-activity.mdx deleted file mode 100644 index b6a304b26e0..00000000000 --- a/.typedoc/docs/backend/session-activity.mdx +++ /dev/null @@ -1,14 +0,0 @@ -The Backend `SessionActivity` object models the activity of a user session, capturing details such as the device type, browser information, and geographical location. - -## Properties - -| Property | Type | Description | -| --------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------- | -| `browserName?` | `string` | The name of the browser from which this session activity occurred. | -| `browserVersion?` | `string` | The version of the browser from which this session activity occurred. | -| `city?` | `string` | The city from which this session activity occurred. Resolved by IP address geo-location. | -| `country?` | `string` | The country from which this session activity occurred. Resolved by IP address geo-location. | -| `deviceType?` | `string` | The type of the device which was used in this session activity. | -| `id` | `string` | The unique identifier for the session activity record. | -| `ipAddress?` | `string` | The IP address from which this session activity originated. | -| `isMobile` | `boolean` | Will be set to `true` if the session activity came from a mobile device. Set to `false` otherwise. | diff --git a/.typedoc/docs/backend/session.mdx b/.typedoc/docs/backend/session.mdx deleted file mode 100644 index 6cf5fa2e50b..00000000000 --- a/.typedoc/docs/backend/session.mdx +++ /dev/null @@ -1,18 +0,0 @@ -The Backend `Session` object is similar to the [`Session`](/docs/references/javascript/session) object as it is an abstraction over an HTTP session and models the period of information exchange between a user and the server. However, the Backend `Session` object is different as it is used in the [Backend API](/docs/reference/backend-api/tag/Sessions#operation/GetSessionList) and is not directly accessible from the Frontend API. - -## Properties - -| Property | Type | Description | -| ----------------------------------------------------------------- | ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `abandonAt` | `number` | The date when the `Session` will be abandoned. | -| `actor` | null \| Record\ | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | -| `clientId` | `string` | The ID of the client associated with the `Session`. | -| `createdAt` | `number` | The date when the `Session` was first created. | -| `expireAt` | `number` | The date when the `Session` will expire. | -| `id` | `string` | The unique identifier for the `Session`. | -| `lastActiveAt` | `number` | The time the session was last active on the [`Client`](/docs/references/backend/types/backend-client). | -| `lastActiveOrganizationId?` | `string` | The ID of the last active organization. | -| `latestActivity?` | [`SessionActivity`](/docs/references/backend/types/backend-session-activity) | An object that provides additional information about this session, focused around user activity data. | -| `status` | `string` | The current state of the `Session`. | -| `updatedAt` | `number` | The date when the `Session` was last updated. | -| `userId` | `string` | The ID of the user associated with the `Session`. | diff --git a/.typedoc/docs/backend/user.mdx b/.typedoc/docs/backend/user.mdx deleted file mode 100644 index 9847d75c136..00000000000 --- a/.typedoc/docs/backend/user.mdx +++ /dev/null @@ -1,47 +0,0 @@ -The Backend `User` object is similar to the `User` object as it holds information about a user of your application, such as their unique identifier, name, email addresses, phone numbers, and more. However, the Backend `User` object is different from the `User` object in that it is used in the [Backend API](/docs/reference/backend-api/tag/Users#operation/GetUser){{ target: '_blank' }} and is not directly accessible from the Frontend API. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `backupCodeEnabled` | `boolean` | A boolean indicating whether the user has enabled Backup codes. | -| `banned` | `boolean` | A boolean indicating whether the user is banned or not. | -| `createdAt` | `number` | The date when the user was first created. | -| `createOrganizationEnabled` | `boolean` | A boolean indicating whether the organization creation is enabled for the user or not. | -| `createOrganizationsLimit` | null \| number | An integer indicating the number of organizations that can be created by the user. If the value is `0`, then the user can create unlimited organizations. Default is `null`. | -| `deleteSelfEnabled` | `boolean` | A boolean indicating whether the user can delete their own account. | -| `emailAddresses` | [EmailAddress](/docs/references/backend/types/backend-email-address)[] | An array of all the `EmailAddress` objects associated with the user. Includes the primary. | -| `externalAccounts` | [ExternalAccount](/docs/references/backend/types/backend-external-account)[] | An array of all the `ExternalAccount` objects associated with the user via OAuth. **Note**: This includes both verified & unverified external accounts. | -| `externalId` | null \| string | The ID of the user as used in your external systems. Must be unique across your instance. | -| `firstName` | null \| string | The user's first name. | -| `hasImage` | `boolean` | A getter boolean to check if the user has uploaded an image or one was copied from OAuth. Returns `false` if Clerk is displaying an avatar for the user. | -| `id` | `string` | The unique identifier for the user. | -| `imageUrl` | `string` | The URL of the user's profile image. | -| `lastActiveAt` | null \| number | Date when the user was last active. | -| `lastName` | null \| string | The user's last name. | -| `lastSignInAt` | null \| number | The date when the user last signed in. May be empty if the user has never signed in. | -| `legalAcceptedAt` | null \| number | The unix timestamp of when the user accepted the legal requirements. `null` if [**Require express consent to legal documents**](/docs/authentication/configuration/legal-compliance) is not enabled. | -| `locked` | `boolean` | A boolean indicating whether the user is banned or not. | -| `passwordEnabled` | `boolean` | A boolean indicating whether the user has a password on their account. | -| `phoneNumbers` | [PhoneNumber](/docs/references/backend/types/backend-phone-number)[] | An array of all the `PhoneNumber` objects associated with the user. Includes the primary. | -| `primaryEmailAddressId` | null \| string | The ID for the `EmailAddress` that the user has set as primary. | -| `primaryPhoneNumberId` | null \| string | The ID for the `PhoneNumber` that the user has set as primary. | -| `primaryWeb3WalletId` | null \| string | The ID for the [`Web3Wallet`](/docs/references/backend/types/backend-web3-wallet) that the user signed up with. | -| `privateMetadata` | `UserPrivateMetadata` | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | -| `publicMetadata` | `UserPublicMetadata` | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | -| `samlAccounts` | [SamlAccount](/docs/references/backend/types/backend-saml-account)[] | An array of all the `SamlAccount` objects associated with the user via SAML. | -| `totpEnabled` | `boolean` | A boolean indicating whether the user has enabled TOTP by generating a TOTP secret and verifying it via an authenticator app. | -| `twoFactorEnabled` | `boolean` | A boolean indicating whether the user has enabled two-factor authentication. | -| `unsafeMetadata` | `UserUnsafeMetadata` | Metadata that can be read and set from the Frontend API. It's considered unsafe because it can be modified from the frontend. | -| `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 - -| Property | Type | Description | -| ------------------------------------------------------ | ----------------------------------------------------------------------------------------- | -------------------------------------- | -| `fullName` | null \| string | The full name of the user. | -| `primaryEmailAddress` | null \| [EmailAddress](/docs/references/backend/types/backend-email-address) | The primary email address of the user. | -| `primaryPhoneNumber` | null \| [PhoneNumber](/docs/references/backend/types/backend-phone-number) | The primary phone number of the user. | -| `primaryWeb3Wallet` | null \| [Web3Wallet](/docs/references/backend/types/backend-web3-wallet) | The primary web3 wallet of the user. | diff --git a/.typedoc/docs/backend/verification.mdx b/.typedoc/docs/backend/verification.mdx deleted file mode 100644 index 0abc5338e0e..00000000000 --- a/.typedoc/docs/backend/verification.mdx +++ /dev/null @@ -1,13 +0,0 @@ -The Backend `Verification` object describes the state of the verification process of a sign-in or sign-up attempt. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------------------------------------ | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `attempts` | null \| number | The number of attempts related to the verification. | -| `expireAt` | null \| number | The time the verification will expire at. | -| `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` | `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/.typedoc/docs/backend/verify-machine-auth-token.mdx b/.typedoc/docs/backend/verify-machine-auth-token.mdx deleted file mode 100644 index 3c6cc9d35c7..00000000000 --- a/.typedoc/docs/backend/verify-machine-auth-token.mdx +++ /dev/null @@ -1,12 +0,0 @@ -Verifies any type of machine token by detecting its type from the prefix. - -## Parameters - -| Parameter | Type | Description | -| --------- | --------------------------------------------- | ------------------------------------------------------------------------- | -| `token` | `string` | The token to verify (e.g. starts with "m2m*", "oauth*", "api*key*", etc.) | -| `options` | [`VerifyTokenOptions`](#verify-token-options) | Options including secretKey for BAPI authorization | - -## Returns - -`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"; \} \| \{ data: APIKey; errors?: undefined; tokenType: "api_key" \| "m2m_token" \| "oauth_token"; \}\> diff --git a/.typedoc/docs/backend/verify-token-options.mdx b/.typedoc/docs/backend/verify-token-options.mdx deleted file mode 100644 index e35c5fa20b3..00000000000 --- a/.typedoc/docs/backend/verify-token-options.mdx +++ /dev/null @@ -1,11 +0,0 @@ -| Property | Type | Description | -| ----------------------------------------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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`. | -| ~~`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). | -| `secretKey?` | `string` | The Clerk Secret Key from the [**API keys**](https://dashboard.clerk.com/last-active?path=api-keys) page in the Clerk Dashboard. | -| `skipJwksCache?` | `boolean` | A flag to ignore the JWKS cache and always fetch JWKS before each JWT verification. | diff --git a/.typedoc/docs/backend/verify-token.mdx b/.typedoc/docs/backend/verify-token.mdx deleted file mode 100644 index 5667b1e6842..00000000000 --- a/.typedoc/docs/backend/verify-token.mdx +++ /dev/null @@ -1,83 +0,0 @@ -> [!WARNING] -> This is a lower-level method intended for more advanced use-cases. It's recommended to use [`authenticateRequest()`](/docs/references/backend/authenticate-request), which fully authenticates a token passed from the `request` object. - -```ts -function verifyToken(token, options): Promise>; -``` - -Verifies a Clerk-generated token signature. Networkless if the `jwtKey` is provided. Otherwise, performs a network call to retrieve the JWKS from the [Backend API](/docs/reference/backend-api/tag/JWKS#operation/GetJWKS){{ target: '_blank' }}. - -## Parameters - -| Parameter | Type | Description | -| --------- | --------------------------------------------- | -------------------------------- | -| `token` | `string` | The token to verify. | -| `options` | [`VerifyTokenOptions`](#verify-token-options) | Options for verifying the token. | - -### `VerifyTokenOptions` - -It is recommended to set these options as [environment variables](/docs/deployments/clerk-environment-variables#api-and-sdk-configuration) where possible, and then pass them to the function. For example, you can set the `secretKey` option using the `CLERK_SECRET_KEY` environment variable, and then pass it to the function like this: `createClerkClient({ secretKey: process.env.CLERK_SECRET_KEY })`. - -> [!WARNING] -> You must provide either `jwtKey` or `secretKey`. - - - -## Returns - -`Promise`\<`JwtReturnType`\<`JwtPayload`, `TokenVerificationError`\>\> - -## Example - -The following example demonstrates how to use the [JavaScript Backend SDK](/docs/references/backend/overview) to verify the token signature. - -In the following example: - -1. The **JWKS Public Key** from the Clerk Dashboard is set in the environment variable `CLERK_JWT_KEY`. -1. The session token is retrieved from the `__session` cookie or the Authorization header. -1. The token is verified in a networkless manner by passing the `jwtKey` prop. -1. The `authorizedParties` prop is passed to verify that the session token is generated from the expected frontend application. -1. If the token is valid, the response contains the verified token. - -```ts -import { verifyToken } from '@clerk/backend'; -import { cookies } from 'next/headers'; - -export async function GET(request: Request) { - const cookieStore = cookies(); - const sessToken = cookieStore.get('__session')?.value; - const bearerToken = request.headers.get('Authorization')?.replace('Bearer ', ''); - const token = sessToken || bearerToken; - - if (!token) { - return Response.json({ error: 'Token not found. User must sign in.' }, { status: 401 }); - } - - try { - const verifiedToken = await verifyToken(token, { - jwtKey: process.env.CLERK_JWT_KEY, - authorizedParties: ['http://localhost:3001', 'api.example.com'], // Replace with your authorized parties - }); - - return Response.json({ verifiedToken }); - } catch (error) { - return Response.json({ error: 'Token not verified.' }, { status: 401 }); - } -} -``` - -If the token is valid, the response will contain a JSON object that looks something like this: - -```json -{ - "verifiedToken": { - "azp": "http://localhost:3000", - "exp": 1687906422, - "iat": 1687906362, - "iss": "https://magical-marmoset-51.clerk.accounts.dev", - "nbf": 1687906352, - "sid": "sess_2Ro7e2IxrffdqBboq8KfB6eGbIy", - "sub": "user_2RfWKJREkjKbHZy0Wqa5qrHeAnb" - } -} -``` diff --git a/.typedoc/docs/backend/verify-webhook-options.mdx b/.typedoc/docs/backend/verify-webhook-options.mdx deleted file mode 100644 index c0bc04c4ae2..00000000000 --- a/.typedoc/docs/backend/verify-webhook-options.mdx +++ /dev/null @@ -1,7 +0,0 @@ -> **VerifyWebhookOptions** = \{ signingSecret?: string; \} - -## Properties - -| Property | Type | Description | -| ------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `signingSecret?` | `string` | The signing secret for the webhook. It's recommended to use the [`CLERK_WEBHOOK_SIGNING_SECRET` environment variable](/docs/deployments/clerk-environment-variables#webhooks) instead. | diff --git a/.typedoc/docs/backend/verify-webhook.mdx b/.typedoc/docs/backend/verify-webhook.mdx deleted file mode 100644 index e16c0e4d51f..00000000000 --- a/.typedoc/docs/backend/verify-webhook.mdx +++ /dev/null @@ -1,42 +0,0 @@ -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; -``` - -## Parameters - -| Parameter | Type | Description | -| ------------------------ | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `request` | `Request` | The request object. | -| `options` | \{ signingSecret?: string; \} | Optional configuration object. | -| `options.signingSecret?` | `string` | The signing secret for the webhook. It's recommended to use the [`CLERK_WEBHOOK_SIGNING_SECRET` environment variable](/docs/deployments/clerk-environment-variables#webhooks) instead. | - -## Returns - -`Promise`\<`WebhookEvent`\> - -## Example - -See the [guide on syncing data](/docs/webhooks/sync-data) for more comprehensive and framework-specific examples that you can copy and paste into your app. - -```ts -try { - const evt = await verifyWebhook(request); - - // Access the event data - const { id } = evt.data; - const eventType = evt.type; - - // Handle specific event types - if (evt.type === 'user.created') { - console.log('New user created:', evt.data.id); - // Handle user creation - } - - return new Response('Success', { status: 200 }); -} catch (err) { - console.error('Webhook verification failed:', err); - return new Response('Webhook verification failed', { status: 400 }); -} -``` diff --git a/.typedoc/docs/backend/web3-wallet.mdx b/.typedoc/docs/backend/web3-wallet.mdx deleted file mode 100644 index d0eeb11bfbf..00000000000 --- a/.typedoc/docs/backend/web3-wallet.mdx +++ /dev/null @@ -1,11 +0,0 @@ -The Backend `Web3Wallet` object describes a Web3 wallet address. The address can be used as a proof of identification for users. - -Web3 addresses must be verified to ensure that they can be assigned to their rightful owners. The verification is completed via Web3 wallet browser extensions, such as [Metamask](https://metamask.io/), [Coinbase Wallet](https://www.coinbase.com/wallet), and [OKX Wallet](https://www.okx.com/help/section/faq-web3-wallet). The `Web3Wallet3` object holds all the necessary state around the verification process. - -## Properties - -| Property | Type | Description | -| ---------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `id` | `string` | The unique ID for the Web3 wallet. | -| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of this Web3 wallet. | -| `web3Wallet` | `string` | The Web3 wallet address, made up of 0x + 40 hexadecimal characters. | diff --git a/.typedoc/docs/clerk-react/api-keys.mdx b/.typedoc/docs/clerk-react/api-keys.mdx deleted file mode 100644 index 4147bc55f14..00000000000 --- a/.typedoc/docs/clerk-react/api-keys.mdx +++ /dev/null @@ -1,19 +0,0 @@ -**`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/.typedoc/docs/clerk-react/clerk-provider-props.mdx b/.typedoc/docs/clerk-react/clerk-provider-props.mdx deleted file mode 100644 index e157d089a4f..00000000000 --- a/.typedoc/docs/clerk-react/clerk-provider-props.mdx +++ /dev/null @@ -1,43 +0,0 @@ -## Properties - -| Property | Type | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `afterMultiSessionSingleSignOutUrl?` | null \| string | The full URL or path to navigate to after signing out the current user is complete. This option applies to [multi-session applications](/docs/authentication/configuration/session-options#multi-session-applications). | -| ~~`afterSignInUrl?`~~ | null \| string | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | -| `afterSignOutUrl?` | null \| string | Full URL or path to navigate to after successful sign out. | -| ~~`afterSignUpUrl?`~~ | null \| string | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | -| `allowedRedirectOrigins?` | (string \| RegExp)[] | An optional array of domains to validate user-provided redirect URLs against. If no match is made, the redirect is considered unsafe and the default redirect will be used with a warning logged in the console. | -| `allowedRedirectProtocols?` | string[] | An optional array of protocols to validate user-provided redirect URLs against. If no match is made, the redirect is considered unsafe and the default redirect will be used with a warning logged in the console. | -| `appearance?` | `Appearance` | Optional object to style your components. Will only affect [Clerk Components](/docs/components/overview) and not [Account Portal](/docs/account-portal/overview) pages. | -| `clerkJSUrl?` | `string` | The URL that `@clerk/clerk-js` should be hot-loaded from. | -| `clerkJSVariant?` | "" \| "headless" | If your web application only uses [Control Components](/docs/components/overview#control-components), you can set this value to `'headless'` and load a minimal ClerkJS bundle for optimal page performance. | -| `clerkJSVersion?` | `string` | The npm version for `@clerk/clerk-js`. | -| `domain?` | string \| (url) => string | **Required if your application is a satellite application**. Sets the domain of the satellite application. | -| `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?` | [`LocalizationResource`](/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. | -| `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`). | -| `publishableKey` | `string` | The Clerk Publishable Key for your instance. This can be found on the [API keys](https://dashboard.clerk.com/last-active?path=api-keys) page in the Clerk Dashboard. | -| ~~`redirectUrl?`~~ | null \| string | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | -| `routerPush?` | (to, metadata?) => unknown | A function which takes the destination path as an argument and performs a "push" navigation. | -| `routerReplace?` | (to, metadata?) => unknown | A function which takes the destination path as an argument and performs a "replace" navigation. | -| `sdkMetadata?` | \{ environment?: string; name: string; version: string; \} | Contains information about the SDK that the host application is using. You don't need to set this value yourself unless you're [developing an SDK](/docs/references/sdk/overview). | -| `sdkMetadata.environment?` | `string` | Typically this will be the `NODE_ENV` that the SDK is currently running in. | -| `sdkMetadata.name` | `string` | The npm package name of the SDK. | -| `sdkMetadata.version` | `string` | The npm package version of the SDK. | -| `selectInitialSession?` | (client) => null \| [SignedInSessionResource](/docs/references/javascript/session) | By default, the last signed-in session is used during client initialization. This option allows you to override that behavior, e.g. by selecting a specific session. | -| `signInFallbackRedirectUrl?` | null \| string | The fallback URL to redirect to after the user signs in, if there's no `redirect_url` in the path already. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. Defaults to `'/'`. | -| `signInForceRedirectUrl?` | null \| string | This URL will always be redirected to after the user signs in. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. | -| `signInUrl?` | `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. **It is required to 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. | -| `signUpFallbackRedirectUrl?` | null \| string | The fallback URL to redirect to after the user signs up, if there's no `redirect_url` in the path already. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. Defaults to `'/'`. | -| `signUpForceRedirectUrl?` | null \| string | This URL will always be redirected to after the user signs up. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. | -| `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. | -| `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/.typedoc/docs/clerk-react/protect.mdx b/.typedoc/docs/clerk-react/protect.mdx deleted file mode 100644 index 4d3c56c30f0..00000000000 --- a/.typedoc/docs/clerk-react/protect.mdx +++ /dev/null @@ -1,21 +0,0 @@ -Use `` in order to prevent unauthenticated or unauthorized users from accessing the children passed to the component. - -Examples: - -``` - - - has({permission:"a_permission_key"})} /> - has({role:"a_role_key"})} /> -Unauthorized

} /> -``` - -## Parameters - -| Parameter | Type | -| ------------------- | -------------- | -| `__namedParameters` | `ProtectProps` | - -## Returns - -`ReactNode` diff --git a/.typedoc/docs/clerk-react/redirect-to-create-organization.mdx b/.typedoc/docs/clerk-react/redirect-to-create-organization.mdx deleted file mode 100644 index 002c69ba5c1..00000000000 --- a/.typedoc/docs/clerk-react/redirect-to-create-organization.mdx +++ /dev/null @@ -1,13 +0,0 @@ -## Parameters - -| Parameter | Type | -| --------- | --------------------------------------------------- | -| `props` | [`Without`](../types/without.mdx)\<`P`, `"clerk"`\> | - -## Returns - -null \| Element - -## Deprecated - -Use [`redirectToCreateOrganization()`](/docs/references/javascript/clerk#redirect-to-create-organization) instead. diff --git a/.typedoc/docs/clerk-react/redirect-to-organization-profile.mdx b/.typedoc/docs/clerk-react/redirect-to-organization-profile.mdx deleted file mode 100644 index 1bb05bc69e5..00000000000 --- a/.typedoc/docs/clerk-react/redirect-to-organization-profile.mdx +++ /dev/null @@ -1,13 +0,0 @@ -## Parameters - -| Parameter | Type | -| --------- | --------------------------------------------------- | -| `props` | [`Without`](../types/without.mdx)\<`P`, `"clerk"`\> | - -## Returns - -null \| Element - -## Deprecated - -Use [`redirectToOrganizationProfile()`](/docs/references/javascript/clerk#redirect-to-organization-profile) instead. diff --git a/.typedoc/docs/clerk-react/redirect-to-user-profile.mdx b/.typedoc/docs/clerk-react/redirect-to-user-profile.mdx deleted file mode 100644 index f8e8364b5a6..00000000000 --- a/.typedoc/docs/clerk-react/redirect-to-user-profile.mdx +++ /dev/null @@ -1,13 +0,0 @@ -## Parameters - -| Parameter | Type | -| --------- | --------------------------------------------------- | -| `props` | [`Without`](../types/without.mdx)\<`P`, `"clerk"`\> | - -## Returns - -null \| Element - -## Deprecated - -Use [`redirectToUserProfile()`](/docs/references/javascript/clerk#redirect-to-user-profile) instead. diff --git a/.typedoc/docs/clerk-react/use-auth.mdx b/.typedoc/docs/clerk-react/use-auth.mdx deleted file mode 100644 index f905ad3d242..00000000000 --- a/.typedoc/docs/clerk-react/use-auth.mdx +++ /dev/null @@ -1,176 +0,0 @@ -The `useAuth()` hook provides access to the current user's authentication state and methods to manage the active session. - -> [!NOTE] -> To access auth data server-side, see the [`Auth` object reference doc](/docs/references/backend/types/auth-object). - - -By default, Next.js opts all routes into static rendering. If you need to opt a route or routes into dynamic rendering because you need to access the authentication data at request time, you can create a boundary by passing the `dynamic` prop to ``. See the [guide on rendering modes](/docs/references/nextjs/rendering-modes) for more information, including code examples. - - -## Parameters - -| Parameter | Type | Description | -| ---------------------------- | -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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 - -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. - - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `actor` | `undefined` | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | -| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | -| `has` | `undefined` | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | -| `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. | -| `orgId` | `undefined` | The ID of the user's active organization. | -| `orgRole` | `undefined` | The current user's role in their active organization. | -| `orgSlug` | `undefined` | The URL-friendly identifier of the user's active organization. | -| `sessionClaims` | `undefined` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | -| `sessionId` | `undefined` | The ID for the current session. | -| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | -| `userId` | `undefined` | The ID of the current user. | - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `actor` | `null` | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | -| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | -| `has()` | (params) => false | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | -| `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. | -| `orgId` | `null` | The ID of the user's active organization. | -| `orgRole` | `null` | The current user's role in their active organization. | -| `orgSlug` | `null` | The URL-friendly identifier of the user's active organization. | -| `sessionClaims` | `null` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | -| `sessionId` | `null` | The ID for the current session. | -| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | -| `userId` | `null` | The ID of the current user. | - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `actor` | null \| \{ [x: string]: unknown; sub: string; \} | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | -| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | -| `has()` | (isAuthorizedParams) => boolean | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | -| `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. | -| `orgId` | `null` | The ID of the user's active organization. | -| `orgRole` | `null` | The current user's role in their active organization. | -| `orgSlug` | `null` | The URL-friendly identifier of the user's active organization. | -| `sessionClaims` | `JwtPayload` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | -| `sessionId` | `string` | The ID for the current session. | -| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | -| `userId` | `string` | The ID of the current user. | - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `actor` | null \| \{ [x: string]: unknown; sub: string; \} | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | -| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | -| `has()` | (isAuthorizedParams) => boolean | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | -| `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. | -| `orgId` | `string` | The ID of the user's active organization. | -| `orgRole` | `OrganizationCustomRoleKey` | The current user's role in their active organization. | -| `orgSlug` | null \| string | The URL-friendly identifier of the user's active organization. | -| `sessionClaims` | `JwtPayload` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | -| `sessionId` | `string` | The ID for the current session. | -| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | -| `userId` | `string` | The ID of the current user. | - - - -## Example - -The following example demonstrates how to use the `useAuth()` hook to access the current auth state, like whether the user is signed in or not. It also includes a basic example for using the `getToken()` method to retrieve a session token for fetching data from an external resource. - - - - -```tsx {{ filename: 'src/pages/ExternalDataPage.tsx' }} -import { useAuth } from '@clerk/clerk-react'; - -export default function ExternalDataPage() { - const { userId, sessionId, getToken, isLoaded, isSignedIn } = useAuth(); - - const fetchExternalData = async () => { - const token = await getToken(); - - // Fetch data from an external API - const response = await fetch('https://api.example.com/data', { - headers: { - Authorization: `Bearer ${token}`, - }, - }); - - return response.json(); - }; - - if (!isLoaded) { - return
Loading...
; - } - - if (!isSignedIn) { - return
Sign in to view this page
; - } - - return ( -
-

- Hello, {userId}! Your current active session is {sessionId}. -

- -
- ); -} -``` - -
- - -```tsx {{ filename: 'app/external-data/page.tsx' }} -'use client'; - -import { useAuth } from '@clerk/nextjs'; - -export default function ExternalDataPage() { - const { userId, sessionId, getToken, isLoaded, isSignedIn } = useAuth(); - - const fetchExternalData = async () => { - const token = await getToken(); - - // Fetch data from an external API - const response = await fetch('https://api.example.com/data', { - headers: { - Authorization: `Bearer ${token}`, - }, - }); - - return response.json(); - }; - - if (!isLoaded) { - return
Loading...
; - } - - if (!isSignedIn) { - return
Sign in to view this page
; - } - - return ( -
-

- Hello, {userId}! Your current active session is {sessionId}. -

- -
- ); -} -``` - -
-
diff --git a/.typedoc/docs/clerk-react/use-clerk.mdx b/.typedoc/docs/clerk-react/use-clerk.mdx deleted file mode 100644 index 130acc124c9..00000000000 --- a/.typedoc/docs/clerk-react/use-clerk.mdx +++ /dev/null @@ -1,43 +0,0 @@ -> [!WARNING] -> This hook should only be used for advanced use cases, such as building a completely custom OAuth flow or as an escape hatch to access to the `Clerk` object. - -The `useClerk()` hook provides access to the [`Clerk`](/docs/references/javascript/clerk) object, allowing you to build alternatives to any Clerk Component. - -## Returns - -[Clerk](/docs/references/javascript/clerk) — The `useClerk()` hook returns the `Clerk` object, which includes all the methods and properties listed in the [`Clerk` reference](/docs/references/javascript/clerk). - -## Example - -The following example uses the `useClerk()` hook to access the `clerk` object. The `clerk` object is used to call the [`openSignIn()`](/docs/references/javascript/clerk#sign-in) method to open the sign-in modal. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useClerk } from '@clerk/clerk-react'; - -export default function Home() { - const clerk = useClerk(); - - return ; -} -``` - - - - -```tsx {{ filename: 'app/page.tsx' }} -'use client'; - -import { useClerk } from '@clerk/nextjs'; - -export default function HomePage() { - const clerk = useClerk(); - - return ; -} -``` - - - diff --git a/.typedoc/docs/clerk-react/use-organization-list.mdx b/.typedoc/docs/clerk-react/use-organization-list.mdx deleted file mode 100644 index 3bce63714df..00000000000 --- a/.typedoc/docs/clerk-react/use-organization-list.mdx +++ /dev/null @@ -1,146 +0,0 @@ -The `useOrganizationList()` hook provides access to the current user's organization memberships, invitations, and suggestions. It also includes methods for creating new organizations and managing the active organization. - -## Parameters - -| Parameter | Type | -| --------- | ---- | -| `params?` | `T` | - -## Returns - -[`UseOrganizationListReturn`](../shared/use-organization-list-return.mdx)\<`T`\> - -## Examples - -### Expanding and paginating attributes - -To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. So by default, the `userMemberships`, `userInvitations`, and `userSuggestions` attributes are not populated. You must pass true or an object with the desired properties to fetch and paginate the data. - -```tsx -// userMemberships.data will never be populated -const { userMemberships } = useOrganizationList(); - -// Use default values to fetch userMemberships, such as initialPage = 1 and pageSize = 10 -const { userMemberships } = useOrganizationList({ - userMemberships: true, -}); - -// Pass your own values to fetch userMemberships -const { userMemberships } = useOrganizationList({ - userMemberships: { - pageSize: 20, - initialPage: 2, // skips the first page - }, -}); - -// Aggregate pages in order to render an infinite list -const { userMemberships } = useOrganizationList({ - userMemberships: { - infinite: true, - }, -}); -``` - -### Infinite pagination - -The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `userMemberships` attribute will be populated with the first page of the user's organization memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. - -```tsx {{ filename: 'src/components/JoinedOrganizations.tsx' }} -import { useOrganizationList } from '@clerk/clerk-react'; -import React from 'react'; - -const JoinedOrganizations = () => { - const { isLoaded, setActive, userMemberships } = useOrganizationList({ - userMemberships: { - infinite: true, - }, - }); - - if (!isLoaded) { - return <>Loading; - } - - return ( - <> -
    - {userMemberships.data?.map(mem => ( -
  • - {mem.organization.name} - -
  • - ))} -
- - - - ); -}; - -export default JoinedOrganizations; -``` - -### Simple pagination - -The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `userInvitations` attribute will be populated with the first page of invitations. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of invitations. - -Notice the difference between this example's pagination and the infinite pagination example above. - -```tsx {{ filename: 'src/components/UserInvitationsTable.tsx' }} -import { useOrganizationList } from '@clerk/clerk-react'; -import React from 'react'; - -const UserInvitationsTable = () => { - const { isLoaded, userInvitations } = useOrganizationList({ - userInvitations: { - infinite: true, - keepPreviousData: true, - }, - }); - - if (!isLoaded || userInvitations.isLoading) { - return <>Loading; - } - - return ( - <> - - - - - - - - - - {userInvitations.data?.map(inv => ( - - - - - ))} - -
EmailOrg name
{inv.emailAddress}{inv.publicOrganizationData.name}
- - - - - ); -}; - -export default UserInvitationsTable; -``` diff --git a/.typedoc/docs/clerk-react/use-organization.mdx b/.typedoc/docs/clerk-react/use-organization.mdx deleted file mode 100644 index d37be2324cb..00000000000 --- a/.typedoc/docs/clerk-react/use-organization.mdx +++ /dev/null @@ -1,130 +0,0 @@ -The `useOrganization()` hook retrieves attributes of the currently active organization. - -## Parameters - -| Parameter | Type | -| --------- | ---- | -| `params?` | `T` | - -## Returns - -[`UseOrganizationReturn`](../shared/use-organization-return.mdx)\<`T`\> - -## Examples - -### Expand and paginate attributes - -To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. By default, the `memberships`, `invitations`, `membershipRequests`, and `domains` attributes are not populated. You must pass `true` or an object with the desired properties to fetch and paginate the data. - -```tsx -// invitations.data will never be populated. -const { invitations } = useOrganization(); - -// Use default values to fetch invitations, such as initialPage = 1 and pageSize = 10 -const { invitations } = useOrganization({ - invitations: true, -}); - -// Pass your own values to fetch invitations -const { invitations } = useOrganization({ - invitations: { - pageSize: 20, - initialPage: 2, // skips the first page - }, -}); - -// Aggregate pages in order to render an infinite list -const { invitations } = useOrganization({ - invitations: { - infinite: true, - }, -}); -``` - -### Infinite pagination - -The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. - -```tsx -import { useOrganization } from '@clerk/clerk-react' - -export default function MemberList() { - const { memberships } = useOrganization({ - memberships: { - infinite: true, // Append new data to the existing list - keepPreviousData: true, // Persist the cached data until the new data has been fetched - }, - }) - - if (!memberships) { - // Handle loading state - return null - } - - return ( -
-

Organization members

-
    - {memberships.data?.map((membership) => ( -
  • - {membership.publicUserData.firstName} {membership.publicUserData.lastName} < - {membership.publicUserData.identifier}> :: {membership.role} -
  • - ))} -
- - -
- ) -} -``` - -### Simple pagination - -The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of memberships. - -Notice the difference between this example's pagination and the infinite pagination example above. - -```tsx -import { useOrganization } from '@clerk/clerk-react' - -export default function MemberList() { - const { memberships } = useOrganization({ - memberships: { - keepPreviousData: true, // Persist the cached data until the new data has been fetched - }, - }) - - if (!memberships) { - // Handle loading state - return null - } - - return ( -
-

Organization members

-
    - {memberships.data?.map((membership) => ( -
  • - {membership.publicUserData.firstName} {membership.publicUserData.lastName} < - {membership.publicUserData.identifier}> :: {membership.role} -
  • - ))} -
- - - - -
- ) -} -``` diff --git a/.typedoc/docs/clerk-react/use-reverification.mdx b/.typedoc/docs/clerk-react/use-reverification.mdx deleted file mode 100644 index a9dc76aff33..00000000000 --- a/.typedoc/docs/clerk-react/use-reverification.mdx +++ /dev/null @@ -1,54 +0,0 @@ -> [!WARNING] -> -> Depending on the SDK you're using, this feature requires `@clerk/nextjs@6.12.7` or later, `@clerk/clerk-react@5.25.1` or later, and `@clerk/clerk-js@5.57.1` or later. - -The `useReverification()` hook is used to handle a session's reverification flow. If a request requires reverification, a modal will display, prompting the user to verify their credentials. Upon successful verification, the original request will automatically retry. - -## Parameters - -| Parameter | Type | -| ---------- | --------- | -| `fetcher` | `Fetcher` | -| `options?` | `Options` | - -## Returns - -`UseReverificationResult`\<`Fetcher`\> — The `useReverification()` hook returns an array with the "enhanced" fetcher. - -## Example - -### Handle cancellation of the reverification process - -The following example demonstrates how to handle scenarios where a user cancels the reverification flow, such as closing the modal, which might result in `myData` being `null`. - -In the following example, `myFetcher` would be a function in your backend that fetches data from the route that requires reverification. See the [guide on how to require reverification](/docs/guides/reverification) for more information. - -```tsx {{ filename: 'src/components/MyButton.tsx' }} -import { useReverification } from '@clerk/clerk-react'; -import { isReverificationCancelledError } from '@clerk/clerk-react/error'; - -type MyData = { - balance: number; -}; - -export function MyButton() { - const fetchMyData = () => fetch('/api/balance').then(res => res.json() as Promise); - const enhancedFetcher = useReverification(fetchMyData); - - const handleClick = async () => { - try { - const myData = await enhancedFetcher(); - // ^ is types as `MyData` - } catch (e) { - // Handle error returned from the fetcher here - - // You can also handle cancellation with the following - if (isReverificationCancelledError(err)) { - // Handle the cancellation error here - } - } - }; - - return ; -} -``` diff --git a/.typedoc/docs/clerk-react/use-session-list.mdx b/.typedoc/docs/clerk-react/use-session-list.mdx deleted file mode 100644 index 778f89720ee..00000000000 --- a/.typedoc/docs/clerk-react/use-session-list.mdx +++ /dev/null @@ -1,77 +0,0 @@ -The `useSessionList()` hook returns an array of [`Session`](/docs/references/javascript/session) objects that have been registered on the client device. - -## 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. - - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `sessions` | `undefined` | A list of sessions that have been registered on the client device. | -| `setActive` | `undefined` | A function that sets the active session and/or organization. | - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `sessions` | [SessionResource](/docs/references/javascript/session)[] | A list of sessions that have been registered on the client device. | -| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session and/or organization. | - - - -## Example - -### Get a list of sessions - -The following example uses `useSessionList()` to get a list of sessions that have been registered on the client device. The `sessions` property is used to show the number of times the user has visited the page. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useSessionList } from '@clerk/clerk-react'; - -export default function Home() { - const { isLoaded, sessions } = useSessionList(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return ( -
-

Welcome back. You've been here {sessions.length} times before.

-
- ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -'use client'; - -import { useSessionList } from '@clerk/nextjs'; - -export default function HomePage() { - const { isLoaded, sessions } = useSessionList(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return ( -
-

Welcome back. You've been here {sessions.length} times before.

-
- ); -} -``` - -
-
diff --git a/.typedoc/docs/clerk-react/use-session.mdx b/.typedoc/docs/clerk-react/use-session.mdx deleted file mode 100644 index 0ace96d5bc6..00000000000 --- a/.typedoc/docs/clerk-react/use-session.mdx +++ /dev/null @@ -1,89 +0,0 @@ -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. - -## 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. - - - - | Name | Type | Description | | ------ | ------ | ------ | | `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 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 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` | `boolean` - | A boolean that indicates whether a user is currently signed in. | | `session` | - [`SignedInSessionResource`](/docs/references/javascript/session) | The current session for the user. | - - - -## Example - -### Access the `Session` object - -The following example uses the `useSession()` hook to access the `Session` object, which has the `lastActiveAt` property. The `lastActiveAt` property is a `Date` object used to show the time the session was last active. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useSession } from '@clerk/clerk-react'; - -export default function Home() { - const { isLoaded, session, isSignedIn } = useSession(); - - if (!isLoaded) { - // Handle loading state - return null; - } - if (!isSignedIn) { - // Handle signed out state - return null; - } - - return ( -
-

This session has been active since {session.lastActiveAt.toLocaleString()}

-
- ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -'use client'; - -import { useSession } from '@clerk/nextjs'; - -export default function HomePage() { - const { isLoaded, session, isSignedIn } = useSession(); - - if (!isLoaded) { - // Handle loading state - return null; - } - if (!isSignedIn) { - // Handle signed out state - return null; - } - - return ( -
-

This session has been active since {session.lastActiveAt.toLocaleString()}

-
- ); -} -``` - -
-
diff --git a/.typedoc/docs/clerk-react/use-sign-in.mdx b/.typedoc/docs/clerk-react/use-sign-in.mdx deleted file mode 100644 index 1cdabc6daef..00000000000 --- a/.typedoc/docs/clerk-react/use-sign-in.mdx +++ /dev/null @@ -1,73 +0,0 @@ -The `useSignIn()` hook provides access to the [`SignIn`](/docs/references/javascript/sign-in) object, which allows you to check the current state of a sign-in attempt and manage the sign-in flow. You can use this to create a [custom sign-in flow](/docs/custom-flows/overview#sign-in-flow). - -## 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. - - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `setActive` | `undefined` | A function that sets the active session. | -| `signIn` | `undefined` | An object that contains the current sign-in attempt status and methods to create a new sign-in attempt. | - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session. | -| `signIn` | [SignInResource](/docs/references/javascript/sign-in) | An object that contains the current sign-in attempt status and methods to create a new sign-in attempt. | - - - -## Examples - -### Check the current state of a sign-in - -The following example uses the `useSignIn()` hook to access the [`SignIn`](/docs/references/javascript/sign-in) object, which contains the current sign-in attempt status and methods to create a new sign-in attempt. The `isLoaded` property is used to handle the loading state. - - - - -```tsx {{ filename: 'src/pages/SignInPage.tsx' }} -import { useSignIn } from '@clerk/clerk-react'; - -export default function SignInPage() { - const { isLoaded, signIn } = useSignIn(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return
The current sign-in attempt status is {signIn?.status}.
; -} -``` - -
- - -```tsx {{ filename: 'app/sign-in/page.tsx' }} -'use client'; - -import { useSignIn } from '@clerk/nextjs'; - -export default function SignInPage() { - const { isLoaded, signIn } = useSignIn(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return
The current sign-in attempt status is {signIn?.status}.
; -} -``` - -
-
- -### Create a custom sign-in flow with `useSignIn()` - -The `useSignIn()` hook can also be used to build fully custom sign-in flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-in flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignIn()` hook to create custom flows, see the [custom flow guides](/docs/custom-flows/overview). diff --git a/.typedoc/docs/clerk-react/use-sign-up.mdx b/.typedoc/docs/clerk-react/use-sign-up.mdx deleted file mode 100644 index 4a0318c4059..00000000000 --- a/.typedoc/docs/clerk-react/use-sign-up.mdx +++ /dev/null @@ -1,73 +0,0 @@ -The `useSignUp()` hook provides access to the [`SignUp`](/docs/references/javascript/sign-up) object, which allows you to check the current state of a sign-up attempt and manage the sign-up flow. You can use this to create a [custom sign-up flow](/docs/custom-flows/overview#sign-up-flow). - -## 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. - - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `setActive` | `undefined` | A function that sets the active session. | -| `signUp` | `undefined` | An object that contains the current sign-up attempt status and methods to create a new sign-up attempt. | - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session. | -| `signUp` | [`SignUpResource`](/docs/references/javascript/sign-up) | An object that contains the current sign-up attempt status and methods to create a new sign-up attempt. | - - - -## Examples - -### Check the current state of a sign-up - -The following example uses the `useSignUp()` hook to access the [`SignUp`](/docs/references/javascript/sign-up) object, which contains the current sign-up attempt status and methods to create a new sign-up attempt. The `isLoaded` property is used to handle the loading state. - - - - -```tsx {{ filename: 'src/pages/SignUpPage.tsx' }} -import { useSignUp } from '@clerk/clerk-react'; - -export default function SignUpPage() { - const { isLoaded, signUp } = useSignUp(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return
The current sign-up attempt status is {signUp?.status}.
; -} -``` - -
- - -```tsx {{ filename: 'app/sign-up/page.tsx' }} -'use client'; - -import { useSignUp } from '@clerk/nextjs'; - -export default function SignUpPage() { - const { isLoaded, signUp } = useSignUp(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return
The current sign-up attempt status is {signUp?.status}.
; -} -``` - -
-
- -### Create a custom sign-up flow with `useSignUp()` - -The `useSignUp()` hook can also be used to build fully custom sign-up flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-up flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignUp()` hook to create custom flows, see the [custom flow guides](/docs/custom-flows/overview). diff --git a/.typedoc/docs/clerk-react/use-user.mdx b/.typedoc/docs/clerk-react/use-user.mdx deleted file mode 100644 index d8d08b7ab26..00000000000 --- a/.typedoc/docs/clerk-react/use-user.mdx +++ /dev/null @@ -1,208 +0,0 @@ -The `useUser()` hook provides access to the current user's [`User`](/docs/references/javascript/user) object, which contains all the data for a single user in your application and provides methods to manage their account. This hook also allows you to check if the user is signed in and if Clerk has loaded and initialized. - -## 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. - - - - | Name | Type | Description | | ------ | ------ | ------ | | `isLoaded` | `false` | A boolean that indicates whether - Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | | `isSignedIn` | - `undefined` | A boolean that returns `true` if the user is signed in. | | `user` | `undefined` | The `User` object - for the current 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 returns `true` if the user is signed in. | | `user` | `null` | The `User` object for the current - 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 returns `true` if the user is signed in. | | `user` | - [`UserResource`](/docs/references/javascript/user) | The `User` object for the current user. | - - - -## Examples - -### Get the current user - -The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which contains the current user's data such as their full name. The `isLoaded` and `isSignedIn` properties are used to handle the loading state and to check if the user is signed in, respectively. - -```tsx {{ filename: 'src/Example.tsx' }} -export default function Example() { - const { isSignedIn, user, isLoaded } = useUser(); - - if (!isLoaded) { - return
Loading...
; - } - - if (!isSignedIn) { - return
Sign in to view this page
; - } - - return
Hello {user.firstName}!
; -} -``` - -### Update user data - -The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`update()`](/docs/references/javascript/user#update) method to update the current user's information. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useUser } from '@clerk/clerk-react'; - -export default function Home() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - await user.update({ - firstName: 'John', - lastName: 'Doe', - }); - }; - - return ( - <> - -

user.firstName: {user?.firstName}

-

user.lastName: {user?.lastName}

- - ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -'use client'; - -import { useUser } from '@clerk/nextjs'; - -export default function HomePage() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - await user.update({ - firstName: 'John', - lastName: 'Doe', - }); - }; - - return ( - <> - -

user.firstName: {user?.firstName}

-

user.lastName: {user?.lastName}

- - ); -} -``` - -
-
- -### Reload user data - -The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`reload()`](/docs/references/javascript/user#reload) method to get the latest user's information. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useUser } from '@clerk/clerk-react'; - -export default function Home() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - // Update data via an API endpoint - const updateMetadata = await fetch('/api/updateMetadata'); - - // Check if the update was successful - if (updateMetadata.message !== 'success') { - throw new Error('Error updating'); - } - - // If the update was successful, reload the user data - await user.reload(); - }; - - return ( - <> - -

user role: {user?.publicMetadata.role}

- - ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -'use client'; - -import { useUser } from '@clerk/nextjs'; - -export default function HomePage() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - // Update data via an API endpoint - const updateMetadata = await fetch('/api/updateMetadata'); - - // Check if the update was successful - if (updateMetadata.message !== 'success') { - throw new Error('Error updating'); - } - - // If the update was successful, reload the user data - await user.reload(); - }; - - return ( - <> - -

user role: {user?.publicMetadata.role}

- - ); -} -``` - -
-
diff --git a/.typedoc/docs/nextjs/auth.mdx b/.typedoc/docs/nextjs/auth.mdx deleted file mode 100644 index c19bd0e7c4a..00000000000 --- a/.typedoc/docs/nextjs/auth.mdx +++ /dev/null @@ -1,5 +0,0 @@ -The `auth()` helper returns the [`Auth`](/docs/references/backend/types/auth-object) object of the currently active user, as well as the [`redirectToSignIn()`](/docs/references/nextjs/auth#redirect-to-sign-in) method. - -- Only available for App Router. -- Only works on the server-side, such as in Server Components, Route Handlers, and Server Actions. -- Requires [`clerkMiddleware()`](/docs/references/nextjs/clerk-middleware) to be configured. diff --git a/.typedoc/docs/nextjs/build-clerk-props.mdx b/.typedoc/docs/nextjs/build-clerk-props.mdx deleted file mode 100644 index b8cc9f53e99..00000000000 --- a/.typedoc/docs/nextjs/build-clerk-props.mdx +++ /dev/null @@ -1,38 +0,0 @@ -Clerk uses `buildClerkProps` to inform the client-side helpers of the authentication state of the user. This function is used SSR in the `getServerSideProps` function of your Next.js application. - -## Examples - -### Basic usage - -```tsx {{ filename: 'pages/myServerSidePage.tsx' }} -import { getAuth, buildClerkProps } from '@clerk/nextjs/server'; -import { GetServerSideProps } from 'next'; - -export const getServerSideProps: GetServerSideProps = async ctx => { - const { userId } = getAuth(ctx.req); - - if (!userId) { - // handle user is not signed in. - } - - // Load any data your application needs for the page using the userId - return { props: { ...buildClerkProps(ctx.req) } }; -}; -``` - -### Usage with `clerkClient` - -The `clerkClient` allows you to access the Clerk API. You can use this to retrieve or update data. - -```tsx {{ filename: 'pages/api/example.ts' }} -import { getAuth, buildClerkProps, clerkClient } from '@clerk/nextjs/server'; -import { GetServerSideProps } from 'next'; - -export const getServerSideProps: GetServerSideProps = async ctx => { - const { userId } = getAuth(ctx.req); - - const user = userId ? await clerkClient().users.getUser(userId) : undefined; - - return { props: { ...buildClerkProps(ctx.req, { user }) } }; -}; -``` diff --git a/.typedoc/docs/nextjs/clerk-middleware-auth-object.mdx b/.typedoc/docs/nextjs/clerk-middleware-auth-object.mdx deleted file mode 100644 index c66ae2fec8d..00000000000 --- a/.typedoc/docs/nextjs/clerk-middleware-auth-object.mdx +++ /dev/null @@ -1,3 +0,0 @@ -## Deprecated - -Use `ClerkMiddlewareSessionAuthObject` instead. diff --git a/.typedoc/docs/nextjs/clerk-middleware-options.mdx b/.typedoc/docs/nextjs/clerk-middleware-options.mdx deleted file mode 100644 index 9514009e75d..00000000000 --- a/.typedoc/docs/nextjs/clerk-middleware-options.mdx +++ /dev/null @@ -1,29 +0,0 @@ -The `clerkMiddleware()` function accepts an optional object. The following options are available. - -## Properties - -| Property | Type | Description | -| --------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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`. | -| `contentSecurityPolicy?` | `ContentSecurityPolicyOptions` | When set, automatically injects a Content-Security-Policy header(s) compatible with Clerk. | -| `debug?` | `boolean` | If true, additional debug information will be logged to the console. | -| `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/.typedoc/docs/nextjs/clerk-middleware.mdx b/.typedoc/docs/nextjs/clerk-middleware.mdx deleted file mode 100644 index a1913f86cd4..00000000000 --- a/.typedoc/docs/nextjs/clerk-middleware.mdx +++ /dev/null @@ -1 +0,0 @@ -The `clerkMiddleware()` helper integrates Clerk authentication into your Next.js application through Middleware. `clerkMiddleware()` is compatible with both the App and Pages routers. diff --git a/.typedoc/docs/nextjs/create-async-get-auth.mdx b/.typedoc/docs/nextjs/create-async-get-auth.mdx deleted file mode 100644 index e598027e2ba..00000000000 --- a/.typedoc/docs/nextjs/create-async-get-auth.mdx +++ /dev/null @@ -1,23 +0,0 @@ -The async variant of our old `createGetAuth` allows for asynchronous code inside its callback. -Should be used with function like `auth()` that are already asynchronous. - -## Parameters - -| Parameter | Type | -| --------------------------------------- | ------------------------------------------------------------------------ | -| `__namedParameters` | \{ debugLoggerName: string; noAuthStatusMessage: string; \} | -| `__namedParameters.debugLoggerName` | `string` | -| `__namedParameters.noAuthStatusMessage` | `string` | - -## Returns - -### Parameters - -| 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 - -`Promise`\<[`AuthObject`](../backend/auth-object.mdx)\> diff --git a/.typedoc/docs/nextjs/create-sync-get-auth.mdx b/.typedoc/docs/nextjs/create-sync-get-auth.mdx deleted file mode 100644 index 36f2647a57e..00000000000 --- a/.typedoc/docs/nextjs/create-sync-get-auth.mdx +++ /dev/null @@ -1,24 +0,0 @@ -Previous known as `createGetAuth`. We needed to create a sync and async variant in order to allow for improvements -that required dynamic imports (using `require` would not work). -It powers the synchronous top-level api `getAuth()`. - -## Parameters - -| Parameter | Type | -| --------------------------------------- | ------------------------------------------------------------------------ | -| `__namedParameters` | \{ debugLoggerName: string; noAuthStatusMessage: string; \} | -| `__namedParameters.debugLoggerName` | `string` | -| `__namedParameters.noAuthStatusMessage` | `string` | - -## Returns - -### Parameters - -| 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 - -SignedInAuthObject \| SignedOutAuthObject diff --git a/.typedoc/docs/nextjs/current-user.mdx b/.typedoc/docs/nextjs/current-user.mdx deleted file mode 100644 index 14aea0c9d73..00000000000 --- a/.typedoc/docs/nextjs/current-user.mdx +++ /dev/null @@ -1,25 +0,0 @@ -The `currentUser` helper returns the [Backend User](/docs/references/backend/types/backend-user) object of the currently active user. It can be used in Server Components, Route Handlers, and Server Actions. - -Under the hood, this helper: - -- calls `fetch()`, so it is automatically deduped per request. -- uses the [`GET /v1/users/{user_id}`](/docs/reference/backend-api/tag/Users#operation/GetUser) endpoint. -- counts towards the [Backend API request rate limit](/docs/backend-requests/resources/rate-limits). - -## Returns - -`Promise`\<null \| [User](../backend/user.mdx)\> - -## Example - -```tsx {{ filename: 'app/page.tsx' }} -import { currentUser } from '@clerk/nextjs/server'; - -export default async function Page() { - const user = await currentUser(); - - if (!user) return
Not signed in
; - - return
Hello {user?.firstName}
; -} -``` diff --git a/.typedoc/docs/nextjs/get-auth.mdx b/.typedoc/docs/nextjs/get-auth.mdx deleted file mode 100644 index ffbe591ae5f..00000000000 --- a/.typedoc/docs/nextjs/get-auth.mdx +++ /dev/null @@ -1,78 +0,0 @@ -The `getAuth()` helper retrieves authentication state from the request object. - -> [!NOTE] -> If you are using App Router, use the [`auth()` helper](/docs/references/nextjs/auth) instead. - -## Parameters - -| 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 - -SignedInAuthObject \| SignedOutAuthObject — The `Auth` object. See the [Auth -reference](/docs/references/backend/types/auth-object) for more information. - -## Examples - -### Protect API routes - -The following example demonstrates how to protect an API route by checking if the `userId` is present in the `getAuth()` response. - -```tsx {{ filename: 'app/api/example/route.ts' }} -import { getAuth } from '@clerk/nextjs/server'; -import type { NextApiRequest, NextApiResponse } from 'next'; - -export default async function handler(req: NextApiRequest, res: NextApiResponse) { - const { userId } = getAuth(req); - - if (!userId) { - return res.status(401).json({ error: 'Not authenticated' }); - } - - // Add logic that retrieves the data for the API route - - return res.status(200).json({ userId: userId }); -} -``` - -### Usage with `getToken()` - -`getAuth()` returns [`getToken()`](/docs/references/backend/types/auth-object#get-token), which is a method that returns the current user's session token or a custom JWT template. - -```tsx {{ filename: 'app/api/example/route.ts' }} -import { getAuth } from '@clerk/nextjs/server'; -import type { NextApiRequest, NextApiResponse } from 'next'; - -export default async function handler(req: NextApiRequest, res: NextApiResponse) { - const { getToken } = getAuth(req); - - const token = await getToken({ template: 'supabase' }); - - // Add logic that retrieves the data - // from your database using the token - - return res.status(200).json({}); -} -``` - -### Usage with `clerkClient` - -`clerkClient` is used to access the [Backend SDK](/docs/references/backend/overview), which exposes Clerk's Backend API resources. You can use `getAuth()` to pass authentication information that many of the Backend SDK methods require, like the user's ID. - -```tsx {{ filename: 'app/api/example/route.ts' }} -import { clerkClient, getAuth } from '@clerk/nextjs/server'; -import type { NextApiRequest, NextApiResponse } from 'next'; - -export default async function handler(req: NextApiRequest, res: NextApiResponse) { - const { userId } = getAuth(req); - - const client = await clerkClient(); - - const user = userId ? await client.users.getUser(userId) : null; - - return res.status(200).json({}); -} -``` diff --git a/.typedoc/docs/shared/api-url-from-publishable-key.mdx b/.typedoc/docs/shared/api-url-from-publishable-key.mdx deleted file mode 100644 index 5ad7e89596c..00000000000 --- a/.typedoc/docs/shared/api-url-from-publishable-key.mdx +++ /dev/null @@ -1,12 +0,0 @@ -Get the correct API url based on the publishable key. - -## Parameters - -| Parameter | Type | Description | -| ---------------- | -------- | ----------------------------- | -| `publishableKey` | `string` | The publishable key to parse. | - -## Returns - -"https://api.lclclerk.com" \| "https://api.clerkstage.dev" \| "https://api.clerk.com" — One of Clerk's API -URLs. diff --git a/.typedoc/docs/shared/build-clerk-js-script-attributes.mdx b/.typedoc/docs/shared/build-clerk-js-script-attributes.mdx deleted file mode 100644 index eb0fbc9ae76..00000000000 --- a/.typedoc/docs/shared/build-clerk-js-script-attributes.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Builds an object of Clerk JS script attributes based on the provided options. - -## Parameters - -| Parameter | Type | Description | -| --------- | -------------------------- | -------------------------------------------------------- | -| `options` | `LoadClerkJsScriptOptions` | The options containing the values for script attributes. | - -## Returns - -`Record`\<`string`, `string`\> — An object containing data attributes to be applied to the script element. diff --git a/.typedoc/docs/shared/build-publishable-key.mdx b/.typedoc/docs/shared/build-publishable-key.mdx deleted file mode 100644 index 2cd1ea56cbe..00000000000 --- a/.typedoc/docs/shared/build-publishable-key.mdx +++ /dev/null @@ -1,11 +0,0 @@ -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/.typedoc/docs/shared/camel-to-snake.mdx b/.typedoc/docs/shared/camel-to-snake.mdx deleted file mode 100644 index 8164e16a4df..00000000000 --- a/.typedoc/docs/shared/camel-to-snake.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Converts a string from camelCase to snake_case. - -## Parameters - -| Parameter | Type | -| --------- | -------------------------------- | -| `str` | undefined \| string | - -## Returns - -`string` diff --git a/.typedoc/docs/shared/clerk-js-script-url.mdx b/.typedoc/docs/shared/clerk-js-script-url.mdx deleted file mode 100644 index d34c653bbef..00000000000 --- a/.typedoc/docs/shared/clerk-js-script-url.mdx +++ /dev/null @@ -1,18 +0,0 @@ -Generates a Clerk JS script URL based on the provided options. - -## Parameters - -| Parameter | Type | Description | -| --------- | -------------------------- | --------------------------------------------------------- | -| `opts` | `LoadClerkJsScriptOptions` | The options to use when building the Clerk JS script URL. | - -## Returns - -`string` — The complete URL to the Clerk JS script. - -## Example - -```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/.typedoc/docs/shared/clerk-runtime-error.mdx b/.typedoc/docs/shared/clerk-runtime-error.mdx deleted file mode 100644 index f87931bbc4f..00000000000 --- a/.typedoc/docs/shared/clerk-runtime-error.mdx +++ /dev/null @@ -1,26 +0,0 @@ -Custom error class for representing Clerk runtime errors. - -ClerkRuntimeError - -## Example - -```ts -throw new ClerkRuntimeError('An error occurred', { code: 'password_invalid' }); -``` - -## Properties - -| Property | Type | Description | Overrides | -| ------------------------------ | -------- | ------------------------------------------------------------------ | --------------- | -| `code` | `string` | A unique code identifying the error, can be used for localization. | - | -| `message` | `string` | The error message. | `Error.message` | - -## Methods - -### toString() - -Returns a string representation of the error. - -#### Returns - -`string` — A formatted string with the error name and message. diff --git a/.typedoc/docs/shared/create-dev-or-staging-url-cache.mdx b/.typedoc/docs/shared/create-dev-or-staging-url-cache.mdx deleted file mode 100644 index d0f1aeaeda3..00000000000 --- a/.typedoc/docs/shared/create-dev-or-staging-url-cache.mdx +++ /dev/null @@ -1,10 +0,0 @@ -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/.typedoc/docs/shared/create-path-matcher.mdx b/.typedoc/docs/shared/create-path-matcher.mdx deleted file mode 100644 index 5fcfc7fed75..00000000000 --- a/.typedoc/docs/shared/create-path-matcher.mdx +++ /dev/null @@ -1,21 +0,0 @@ -Creates a function that matches paths against a set of patterns. - -## Parameters - -| Parameter | Type | Description | -| ---------- | ------------------ | ------------------------------------------------------- | -| `patterns` | `PathMatcherParam` | A string, RegExp, or array of patterns to match against | - -## Returns - -A function that takes a pathname and returns true if it matches any of the patterns - -### Parameters - -| Parameter | Type | -| ---------- | -------- | -| `pathname` | `string` | - -### Returns - -`boolean` diff --git a/.typedoc/docs/shared/deep-camel-to-snake.mdx b/.typedoc/docs/shared/deep-camel-to-snake.mdx deleted file mode 100644 index 08cd236e036..00000000000 --- a/.typedoc/docs/shared/deep-camel-to-snake.mdx +++ /dev/null @@ -1,13 +0,0 @@ -Transforms camelCased objects/ arrays to snake_cased. -This function recursively traverses all objects and arrays of the passed value -camelCased keys are removed. - -## Parameters - -| Parameter | Type | -| --------- | ----- | -| `obj` | `any` | - -## Returns - -`any` diff --git a/.typedoc/docs/shared/deep-snake-to-camel.mdx b/.typedoc/docs/shared/deep-snake-to-camel.mdx deleted file mode 100644 index 3ad646a85be..00000000000 --- a/.typedoc/docs/shared/deep-snake-to-camel.mdx +++ /dev/null @@ -1,13 +0,0 @@ -Transforms snake_cased objects/ arrays to camelCased. -This function recursively traverses all objects and arrays of the passed value -camelCased keys are removed. - -## Parameters - -| Parameter | Type | -| --------- | ----- | -| `obj` | `any` | - -## Returns - -`any` diff --git a/.typedoc/docs/shared/deprecated-object-property.mdx b/.typedoc/docs/shared/deprecated-object-property.mdx deleted file mode 100644 index 611635bfb00..00000000000 --- a/.typedoc/docs/shared/deprecated-object-property.mdx +++ /dev/null @@ -1,21 +0,0 @@ -Mark object property as deprecated. - -A console WARNING will be displayed when object property is being accessed. - -1. Deprecate object property - const obj = { something: 'aloha' }; - -deprecatedObjectProperty(obj, 'something', 'Use `somethingElse` instead.'); - -## Parameters - -| Parameter | Type | -| ---------- | --------------------------- | -| `obj` | `Record`\<`string`, `any`\> | -| `propName` | `string` | -| `warning` | `string` | -| `key?` | `string` | - -## Returns - -`void` diff --git a/.typedoc/docs/shared/derive-state.mdx b/.typedoc/docs/shared/derive-state.mdx deleted file mode 100644 index c5a89ed30bd..00000000000 --- a/.typedoc/docs/shared/derive-state.mdx +++ /dev/null @@ -1,29 +0,0 @@ -Derives authentication state based on the current rendering context (SSR or client-side). - -## Parameters - -| Parameter | Type | -| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `clerkOperational` | `boolean` | -| `state` | `Resources` | -| `initialState` | undefined \| 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; \}\> | - -## Returns - -\{ actor: undefined \| null \| \{ [x: string]: unknown; sub: string; \}; factorVerificationAge: null \| \[number, number\]; organization: undefined \| null \| [OrganizationResource](/docs/references/javascript/organization); orgId: undefined \| null \| string; orgPermissions: undefined \| null \| Autocomplete\[]; orgRole: undefined \| null \| string; orgSlug: undefined \| null \| string; session: undefined \| null \| [SignedInSessionResource](/docs/references/javascript/session); sessionClaims: undefined \| null \| JwtPayload; sessionId: undefined \| null \| string; sessionStatus: undefined \| "active" \| "pending"; user: undefined \| null \| [UserResource](/docs/references/javascript/user); userId: undefined \| null \| string; \} - -| Name | Type | -| ----------------------- | -------------------------------------------------------------------------------------------------- | -| `actor` | undefined \| null \| \{ [x: string]: unknown; sub: string; \} | -| `factorVerificationAge` | null \| \[number, number\] | -| `organization` | undefined \| null \| [OrganizationResource](/docs/references/javascript/organization) | -| `orgId` | undefined \| null \| string | -| `orgPermissions` | undefined \| null \| Autocomplete\[] | -| `orgRole` | undefined \| null \| string | -| `orgSlug` | undefined \| null \| string | -| `session` | undefined \| null \| [SignedInSessionResource](/docs/references/javascript/session) | -| `sessionClaims` | undefined \| null \| JwtPayload | -| `sessionId` | undefined \| null \| string | -| `sessionStatus` | undefined \| "active" \| "pending" | -| `user` | undefined \| null \| [UserResource](/docs/references/javascript/user) | -| `userId` | undefined \| null \| string | diff --git a/.typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx b/.typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx deleted file mode 100644 index 3f8f20906e7..00000000000 --- a/.typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx +++ /dev/null @@ -1,13 +0,0 @@ -Gets the **clerk_db_jwt JWT from either the hash or the search -Side effect: -Removes **clerk_db_jwt JWT from the URL (hash and searchParams) and updates the browser history - -## Parameters - -| Parameter | Type | -| --------- | ----- | -| `url` | `URL` | - -## Returns - -`string` diff --git a/.typedoc/docs/shared/fast-deep-merge-and-replace.mdx b/.typedoc/docs/shared/fast-deep-merge-and-replace.mdx deleted file mode 100644 index b07891dbf5c..00000000000 --- a/.typedoc/docs/shared/fast-deep-merge-and-replace.mdx +++ /dev/null @@ -1,14 +0,0 @@ -Merges 2 objects without creating new object references -The merged props will appear on the `target` object -If `target` already has a value for a given key it will not be overwritten - -## Parameters - -| Parameter | Type | -| --------- | ---------------------------------------------------- | -| `source` | undefined \| null \| Record\ | -| `target` | undefined \| null \| Record\ | - -## Returns - -`void` diff --git a/.typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx b/.typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx deleted file mode 100644 index 4c846eea8c0..00000000000 --- a/.typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx +++ /dev/null @@ -1,14 +0,0 @@ -Retrieve the clerk-js major tag using the major version from the pkgVersion -param or use the frontendApi to determine if the canary tag should be used. -The default tag is `latest`. - -## Parameters - -| Parameter | Type | -| ------------- | -------- | -| `frontendApi` | `string` | -| `version?` | `string` | - -## Returns - -`string` diff --git a/.typedoc/docs/shared/get-cookie-suffix.mdx b/.typedoc/docs/shared/get-cookie-suffix.mdx deleted file mode 100644 index ac115fcc8b1..00000000000 --- a/.typedoc/docs/shared/get-cookie-suffix.mdx +++ /dev/null @@ -1,13 +0,0 @@ -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/.typedoc/docs/shared/get-env-variable.mdx b/.typedoc/docs/shared/get-env-variable.mdx deleted file mode 100644 index a60f14161bd..00000000000 --- a/.typedoc/docs/shared/get-env-variable.mdx +++ /dev/null @@ -1,12 +0,0 @@ -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. | - -## Returns - -`string` — The environment variable value or empty string if not found. diff --git a/.typedoc/docs/shared/get-non-undefined-values.mdx b/.typedoc/docs/shared/get-non-undefined-values.mdx deleted file mode 100644 index 0d051136c43..00000000000 --- a/.typedoc/docs/shared/get-non-undefined-values.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Get all non-undefined values from an object. - -## Parameters - -| Parameter | Type | -| --------- | ---- | -| `obj` | `T` | - -## Returns - -`Partial`\<`T`\> diff --git a/.typedoc/docs/shared/get-script-url.mdx b/.typedoc/docs/shared/get-script-url.mdx deleted file mode 100644 index 66218a1414c..00000000000 --- a/.typedoc/docs/shared/get-script-url.mdx +++ /dev/null @@ -1,14 +0,0 @@ -Retrieve the clerk-js script url from the frontendApi and the major tag -using the [getClerkJsMajorVersionOrTag](get-clerk-js-major-version-or-tag.mdx) or a provided clerkJSVersion tag. - -## Parameters - -| Parameter | Type | -| ----------------------------------- | ------------------------------------------- | -| `frontendApi` | `string` | -| `__namedParameters` | \{ clerkJSVersion?: string; \} | -| `__namedParameters.clerkJSVersion?` | `string` | - -## Returns - -`string` diff --git a/.typedoc/docs/shared/get-suffixed-cookie-name.mdx b/.typedoc/docs/shared/get-suffixed-cookie-name.mdx deleted file mode 100644 index f4f707d155e..00000000000 --- a/.typedoc/docs/shared/get-suffixed-cookie-name.mdx +++ /dev/null @@ -1,13 +0,0 @@ -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/.typedoc/docs/shared/icon-image-url.mdx b/.typedoc/docs/shared/icon-image-url.mdx deleted file mode 100644 index e0e3fbde62d..00000000000 --- a/.typedoc/docs/shared/icon-image-url.mdx +++ /dev/null @@ -1,13 +0,0 @@ -Returns the URL for a static image -using the new img.clerk.com service - -## Parameters - -| Parameter | Type | -| --------- | ---------------------------- | -| `id` | `string` | -| `format` | "svg" \| "jpeg" | - -## Returns - -`string` diff --git a/.typedoc/docs/shared/in-browser.mdx b/.typedoc/docs/shared/in-browser.mdx deleted file mode 100644 index e08842d7935..00000000000 --- a/.typedoc/docs/shared/in-browser.mdx +++ /dev/null @@ -1,5 +0,0 @@ -Checks if the window object is defined. You can also use this to check if something is happening on the client side. - -## Returns - -`boolean` diff --git a/.typedoc/docs/shared/is-browser-online.mdx b/.typedoc/docs/shared/is-browser-online.mdx deleted file mode 100644 index a4f7d95040f..00000000000 --- a/.typedoc/docs/shared/is-browser-online.mdx +++ /dev/null @@ -1,5 +0,0 @@ -Checks if the current environment is a browser and if the navigator is online. - -## Returns - -`boolean` diff --git a/.typedoc/docs/shared/is-clerk-runtime-error.mdx b/.typedoc/docs/shared/is-clerk-runtime-error.mdx deleted file mode 100644 index 6faae627914..00000000000 --- a/.typedoc/docs/shared/is-clerk-runtime-error.mdx +++ /dev/null @@ -1,24 +0,0 @@ -Checks if the provided error object is an instance of ClerkRuntimeError. - -## Parameters - -| Parameter | Type | Description | -| --------- | ----- | -------------------------- | -| `err` | `any` | The error object to check. | - -## Returns - -`err is ClerkRuntimeError` — True if the error is a ClerkRuntimeError, false otherwise. - -## Example - -```ts -const error = new ClerkRuntimeError('An error occurred'); -if (isClerkRuntimeError(error)) { - // Handle ClerkRuntimeError - console.error('ClerkRuntimeError:', error.message); -} else { - // Handle other errors - console.error('Other error:', error.message); -} -``` diff --git a/.typedoc/docs/shared/is-development-from-publishable-key.mdx b/.typedoc/docs/shared/is-development-from-publishable-key.mdx deleted file mode 100644 index 6d17f30a7d4..00000000000 --- a/.typedoc/docs/shared/is-development-from-publishable-key.mdx +++ /dev/null @@ -1,12 +0,0 @@ -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/.typedoc/docs/shared/is-development-from-secret-key.mdx b/.typedoc/docs/shared/is-development-from-secret-key.mdx deleted file mode 100644 index 6d2785217a4..00000000000 --- a/.typedoc/docs/shared/is-development-from-secret-key.mdx +++ /dev/null @@ -1,12 +0,0 @@ -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/.typedoc/docs/shared/is-ipv4-address.mdx b/.typedoc/docs/shared/is-ipv4-address.mdx deleted file mode 100644 index ae9f7620269..00000000000 --- a/.typedoc/docs/shared/is-ipv4-address.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Checks if a string is a valid IPv4 address. - -## Parameters - -| Parameter | Type | -| --------- | ---------------------------------------- | -| `str` | undefined \| null \| string | - -## Returns - -`boolean` — True if the string is a valid IPv4 address, false otherwise. diff --git a/.typedoc/docs/shared/is-production-from-publishable-key.mdx b/.typedoc/docs/shared/is-production-from-publishable-key.mdx deleted file mode 100644 index 8aa8847074c..00000000000 --- a/.typedoc/docs/shared/is-production-from-publishable-key.mdx +++ /dev/null @@ -1,12 +0,0 @@ -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/.typedoc/docs/shared/is-production-from-secret-key.mdx b/.typedoc/docs/shared/is-production-from-secret-key.mdx deleted file mode 100644 index 289067ce0df..00000000000 --- a/.typedoc/docs/shared/is-production-from-secret-key.mdx +++ /dev/null @@ -1,12 +0,0 @@ -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/.typedoc/docs/shared/is-publishable-key.mdx b/.typedoc/docs/shared/is-publishable-key.mdx deleted file mode 100644 index b45694915b5..00000000000 --- a/.typedoc/docs/shared/is-publishable-key.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Checks if the provided key is a valid publishable key. - -## Parameters - -| Parameter | Type | Description | -| --------- | -------- | ------------------------------------------------------------------- | -| `key` | `string` | The key to be checked. Defaults to an empty string if not provided. | - -## Returns - -`boolean` — `true` if 'key' is a valid publishable key, `false` otherwise. diff --git a/.typedoc/docs/shared/is-staging.mdx b/.typedoc/docs/shared/is-staging.mdx deleted file mode 100644 index 1491f1c9705..00000000000 --- a/.typedoc/docs/shared/is-staging.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Check if the frontendApi ends with a staging domain - -## Parameters - -| Parameter | Type | -| ------------- | -------- | -| `frontendApi` | `string` | - -## Returns - -`boolean` diff --git a/.typedoc/docs/shared/is-truthy.mdx b/.typedoc/docs/shared/is-truthy.mdx deleted file mode 100644 index 9c9ea5413ba..00000000000 --- a/.typedoc/docs/shared/is-truthy.mdx +++ /dev/null @@ -1,11 +0,0 @@ -A function to determine if a value is truthy. - -## Parameters - -| Parameter | Type | -| --------- | --------- | -| `value` | `unknown` | - -## Returns - -`boolean` — True for `true`, true, positive numbers. False for `false`, false, 0, negative integers and anything else. diff --git a/.typedoc/docs/shared/is-valid-browser-online.mdx b/.typedoc/docs/shared/is-valid-browser-online.mdx deleted file mode 100644 index cbc8b340524..00000000000 --- a/.typedoc/docs/shared/is-valid-browser-online.mdx +++ /dev/null @@ -1,5 +0,0 @@ -Runs `isBrowserOnline` and `isValidBrowser` to check if the current environment is a valid browser and if the navigator is online. - -## Returns - -`boolean` diff --git a/.typedoc/docs/shared/is-valid-browser.mdx b/.typedoc/docs/shared/is-valid-browser.mdx deleted file mode 100644 index 5d89b5b376c..00000000000 --- a/.typedoc/docs/shared/is-valid-browser.mdx +++ /dev/null @@ -1,5 +0,0 @@ -Checks if the current environment is a browser and the user agent is not a bot. - -## Returns - -`boolean` diff --git a/.typedoc/docs/shared/isomorphic-atob.mdx b/.typedoc/docs/shared/isomorphic-atob.mdx deleted file mode 100644 index ed412ce6632..00000000000 --- a/.typedoc/docs/shared/isomorphic-atob.mdx +++ /dev/null @@ -1,12 +0,0 @@ -A function that decodes a string of data which has been encoded using base-64 encoding. -Uses `atob` if available, otherwise uses `Buffer` from `global`. If neither are available, returns the data as-is. - -## Parameters - -| Parameter | Type | -| --------- | -------- | -| `data` | `string` | - -## Returns - -`string` diff --git a/.typedoc/docs/shared/load-clerk-js-script.mdx b/.typedoc/docs/shared/load-clerk-js-script.mdx deleted file mode 100644 index 7719e2d7433..00000000000 --- a/.typedoc/docs/shared/load-clerk-js-script.mdx +++ /dev/null @@ -1,26 +0,0 @@ -Hotloads the Clerk JS script with robust failure detection. - -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 - -| Parameter | Type | Description | -| --------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -| `opts?` | `LoadClerkJsScriptOptions` | The options used to build the Clerk JS script URL and load the script. Must include a `publishableKey` if no existing script is found. | - -## Returns - -`Promise`\<null \| HTMLScriptElement\> — Promise that resolves with null if Clerk loads successfully, or rejects with an error. - -## Example - -```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/.typedoc/docs/shared/pages-or-infinite-options.mdx b/.typedoc/docs/shared/pages-or-infinite-options.mdx deleted file mode 100644 index c2a7ab7b9c4..00000000000 --- a/.typedoc/docs/shared/pages-or-infinite-options.mdx +++ /dev/null @@ -1,4 +0,0 @@ -| 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`. | diff --git a/.typedoc/docs/shared/paginated-hook-config.mdx b/.typedoc/docs/shared/paginated-hook-config.mdx deleted file mode 100644 index 99f8acfd945..00000000000 --- a/.typedoc/docs/shared/paginated-hook-config.mdx +++ /dev/null @@ -1,4 +0,0 @@ -| Name | Type | Description | -| ------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `infinite?` | `boolean` | If `true`, newly fetched data will be appended to the existing list rather than replacing it. Useful for implementing infinite scroll functionality. Defaults to `false`. | -| `keepPreviousData?` | `boolean` | If `true`, the previous data will be kept in the cache until new data is fetched. Defaults to `false`. | diff --git a/.typedoc/docs/shared/paginated-resources.mdx b/.typedoc/docs/shared/paginated-resources.mdx deleted file mode 100644 index a6608f7e55f..00000000000 --- a/.typedoc/docs/shared/paginated-resources.mdx +++ /dev/null @@ -1,17 +0,0 @@ -| Property | Type | Description | -| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `count` | `number` | The total count of data that exist remotely. | -| `data` | T[] | An array that contains the fetched data. For example, for the `memberships` attribute, data will be an array of [`OrganizationMembership`](/docs/references/javascript/types/organization-membership) objects. | -| `error` | null \| ClerkAPIResponseError | Clerk's API response error object. | -| `fetchNext` | () => void | A function that triggers the next page to be loaded. This is the same as `fetchPage(page => Math.min(pageCount, page + 1))`. | -| `fetchPage` | `ValueOrSetter`\<`number`\> | A function that triggers a specific page to be loaded. | -| `fetchPrevious` | () => void | A function that triggers the previous page to be loaded. This is the same as `fetchPage(page => Math.max(0, page - 1))`. | -| `hasNextPage` | `boolean` | A boolean that indicates if there are available pages to be fetched. | -| `hasPreviousPage` | `boolean` | A boolean that indicates if there are available pages to be fetched. | -| `isError` | `boolean` | A boolean that indicates the request failed. | -| `isFetching` | `boolean` | A boolean that is `true` if there is an ongoing request or a revalidation. | -| `isLoading` | `boolean` | A boolean that is `true` if there is an ongoing request and there is no fetched data. | -| `page` | `number` | The current page. | -| `pageCount` | `number` | The total amount of pages. It is calculated based on `count`, `initialPage`, and `pageSize`. | -| `revalidate` | () => Promise\ | A function that triggers a revalidation of the current page. | -| `setData` | `Infinite` _extends_ `true` ? `CacheSetter`\<(undefined \| [ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\)[]\> : `CacheSetter`\<undefined \| [ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\\> | A function that allows you to set the data manually. | diff --git a/.typedoc/docs/shared/parse-publishable-key.mdx b/.typedoc/docs/shared/parse-publishable-key.mdx deleted file mode 100644 index 2c9e088ff79..00000000000 --- a/.typedoc/docs/shared/parse-publishable-key.mdx +++ /dev/null @@ -1,47 +0,0 @@ -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/.typedoc/docs/shared/read-json-file.mdx b/.typedoc/docs/shared/read-json-file.mdx deleted file mode 100644 index 1c1c1061146..00000000000 --- a/.typedoc/docs/shared/read-json-file.mdx +++ /dev/null @@ -1,15 +0,0 @@ -Read an expected JSON type File. - -Probably paired with: - - - -## Parameters - -| Parameter | Type | -| --------- | ------ | -| `file` | `File` | - -## Returns - -`Promise`\<`unknown`\> diff --git a/.typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx b/.typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx deleted file mode 100644 index 765e4d63c97..00000000000 --- a/.typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx +++ /dev/null @@ -1,17 +0,0 @@ -Sets the package name for error messages during ClerkJS script loading. - -## Parameters - -| Parameter | Type | Description | -| ------------- | -------- | ------------------------------------------------------------------------------ | -| `packageName` | `string` | The name of the package to use in error messages (e.g., '@clerk/clerk-react'). | - -## Returns - -`void` - -## Example - -```typescript -setClerkJsLoadingErrorPackageName('@clerk/clerk-react'); -``` diff --git a/.typedoc/docs/shared/snake-to-camel.mdx b/.typedoc/docs/shared/snake-to-camel.mdx deleted file mode 100644 index b860d97abee..00000000000 --- a/.typedoc/docs/shared/snake-to-camel.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Converts a string from snake_case to camelCase. - -## Parameters - -| Parameter | Type | -| --------- | -------------------------------- | -| `str` | undefined \| string | - -## Returns - -`string` diff --git a/.typedoc/docs/shared/titleize.mdx b/.typedoc/docs/shared/titleize.mdx deleted file mode 100644 index 9442d0c0c1c..00000000000 --- a/.typedoc/docs/shared/titleize.mdx +++ /dev/null @@ -1,17 +0,0 @@ -Converts the first character of a string to uppercase. - -## Parameters - -| Parameter | Type | Description | -| --------- | ---------------------------------------- | --------------------------- | -| `str` | undefined \| null \| string | The string to be converted. | - -## Returns - -`string` — The modified string with the rest of the string unchanged. - -## Example - -```ts -titleize('hello world'); // 'Hello world' -``` diff --git a/.typedoc/docs/shared/to-sentence.mdx b/.typedoc/docs/shared/to-sentence.mdx deleted file mode 100644 index ad4d413ed9d..00000000000 --- a/.typedoc/docs/shared/to-sentence.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Convert words to a sentence. - -## Parameters - -| Parameter | Type | Description | -| --------- | --------------------- | ------------------------------- | -| `items` | string[] | An array of words to be joined. | - -## Returns - -`string` — A string with the items joined by a comma and the last item joined by ", or". diff --git a/.typedoc/docs/shared/use-clerk.mdx b/.typedoc/docs/shared/use-clerk.mdx deleted file mode 100644 index 130acc124c9..00000000000 --- a/.typedoc/docs/shared/use-clerk.mdx +++ /dev/null @@ -1,43 +0,0 @@ -> [!WARNING] -> This hook should only be used for advanced use cases, such as building a completely custom OAuth flow or as an escape hatch to access to the `Clerk` object. - -The `useClerk()` hook provides access to the [`Clerk`](/docs/references/javascript/clerk) object, allowing you to build alternatives to any Clerk Component. - -## Returns - -[Clerk](/docs/references/javascript/clerk) — The `useClerk()` hook returns the `Clerk` object, which includes all the methods and properties listed in the [`Clerk` reference](/docs/references/javascript/clerk). - -## Example - -The following example uses the `useClerk()` hook to access the `clerk` object. The `clerk` object is used to call the [`openSignIn()`](/docs/references/javascript/clerk#sign-in) method to open the sign-in modal. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useClerk } from '@clerk/clerk-react'; - -export default function Home() { - const clerk = useClerk(); - - return ; -} -``` - - - - -```tsx {{ filename: 'app/page.tsx' }} -'use client'; - -import { useClerk } from '@clerk/nextjs'; - -export default function HomePage() { - const clerk = useClerk(); - - return ; -} -``` - - - diff --git a/.typedoc/docs/shared/use-organization-list-params.mdx b/.typedoc/docs/shared/use-organization-list-params.mdx deleted file mode 100644 index 592db3abc4f..00000000000 --- a/.typedoc/docs/shared/use-organization-list-params.mdx +++ /dev/null @@ -1,5 +0,0 @@ -| Property | Type | Description | -| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `userInvitations?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: "expired" \| "revoked" \| "pending" \| "accepted"; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the invitations by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| -| `userMemberships?` | true \| \{ initialPage?: number; pageSize?: number; \} & object & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • Any of the properties described in [Shared properties](#shared-properties).
| -| `userSuggestions?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: "pending" \| "accepted" \| ("pending" \| "accepted")[]; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the suggestions by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| diff --git a/.typedoc/docs/shared/use-organization-list-return.mdx b/.typedoc/docs/shared/use-organization-list-return.mdx deleted file mode 100644 index a6d6a3dc742..00000000000 --- a/.typedoc/docs/shared/use-organization-list-return.mdx +++ /dev/null @@ -1,8 +0,0 @@ -| Property | Type | Description | -| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `createOrganization` | undefined \| ([CreateOrganizationParams](#create-organization-params)) => Promise\<[OrganizationResource](/docs/references/javascript/organization)\> | A function that returns a `Promise` which resolves to the newly created `Organization`. | -| `isLoaded` | `boolean` | A boolean that indicates whether Clerk has completed initialization and there is an authenticated user. Initially `false`, becomes `true` once Clerk loads with a user. | -| `setActive` | undefined \| ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session and/or organization. | -| `userInvitations` | PaginatedResourcesWithDefault\<[UserOrganizationInvitationResource](/docs/references/javascript/types/user-organization-invitation)\> \| [PaginatedResources](#paginated-resources)\<[UserOrganizationInvitationResource](/docs/references/javascript/types/user-organization-invitation), T\["userInvitations"\] _extends_ \{ infinite: true; \} ? true : false\> | Returns `PaginatedResources` which includes a list of the user's organization invitations. | -| `userMemberships` | PaginatedResourcesWithDefault\<[OrganizationMembershipResource](/docs/references/javascript/types/organization-membership)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationMembershipResource](/docs/references/javascript/types/organization-membership), T\["userMemberships"\] _extends_ \{ infinite: true; \} ? true : false\> | Returns `PaginatedResources` which includes a list of the user's organization memberships. | -| `userSuggestions` | PaginatedResourcesWithDefault\<[OrganizationSuggestionResource](/docs/references/javascript/types/organization-suggestion)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationSuggestionResource](/docs/references/javascript/types/organization-suggestion), T\["userSuggestions"\] _extends_ \{ infinite: true; \} ? true : false\> | Returns `PaginatedResources` which includes a list of suggestions for organizations that the user can join. | diff --git a/.typedoc/docs/shared/use-organization-list.mdx b/.typedoc/docs/shared/use-organization-list.mdx deleted file mode 100644 index d894fd4adcd..00000000000 --- a/.typedoc/docs/shared/use-organization-list.mdx +++ /dev/null @@ -1,146 +0,0 @@ -The `useOrganizationList()` hook provides access to the current user's organization memberships, invitations, and suggestions. It also includes methods for creating new organizations and managing the active organization. - -## Parameters - -| Parameter | Type | -| --------- | ---- | -| `params?` | `T` | - -## Returns - -[`UseOrganizationListReturn`](use-organization-list-return.mdx)\<`T`\> - -## Examples - -### Expanding and paginating attributes - -To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. So by default, the `userMemberships`, `userInvitations`, and `userSuggestions` attributes are not populated. You must pass true or an object with the desired properties to fetch and paginate the data. - -```tsx -// userMemberships.data will never be populated -const { userMemberships } = useOrganizationList(); - -// Use default values to fetch userMemberships, such as initialPage = 1 and pageSize = 10 -const { userMemberships } = useOrganizationList({ - userMemberships: true, -}); - -// Pass your own values to fetch userMemberships -const { userMemberships } = useOrganizationList({ - userMemberships: { - pageSize: 20, - initialPage: 2, // skips the first page - }, -}); - -// Aggregate pages in order to render an infinite list -const { userMemberships } = useOrganizationList({ - userMemberships: { - infinite: true, - }, -}); -``` - -### Infinite pagination - -The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `userMemberships` attribute will be populated with the first page of the user's organization memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. - -```tsx {{ filename: 'src/components/JoinedOrganizations.tsx' }} -import { useOrganizationList } from '@clerk/clerk-react'; -import React from 'react'; - -const JoinedOrganizations = () => { - const { isLoaded, setActive, userMemberships } = useOrganizationList({ - userMemberships: { - infinite: true, - }, - }); - - if (!isLoaded) { - return <>Loading; - } - - return ( - <> -
    - {userMemberships.data?.map(mem => ( -
  • - {mem.organization.name} - -
  • - ))} -
- - - - ); -}; - -export default JoinedOrganizations; -``` - -### Simple pagination - -The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `userInvitations` attribute will be populated with the first page of invitations. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of invitations. - -Notice the difference between this example's pagination and the infinite pagination example above. - -```tsx {{ filename: 'src/components/UserInvitationsTable.tsx' }} -import { useOrganizationList } from '@clerk/clerk-react'; -import React from 'react'; - -const UserInvitationsTable = () => { - const { isLoaded, userInvitations } = useOrganizationList({ - userInvitations: { - infinite: true, - keepPreviousData: true, - }, - }); - - if (!isLoaded || userInvitations.isLoading) { - return <>Loading; - } - - return ( - <> - - - - - - - - - - {userInvitations.data?.map(inv => ( - - - - - ))} - -
EmailOrg name
{inv.emailAddress}{inv.publicOrganizationData.name}
- - - - - ); -}; - -export default UserInvitationsTable; -``` diff --git a/.typedoc/docs/shared/use-organization-params.mdx b/.typedoc/docs/shared/use-organization-params.mdx deleted file mode 100644 index cfbb1bca26d..00000000000 --- a/.typedoc/docs/shared/use-organization-params.mdx +++ /dev/null @@ -1,7 +0,0 @@ -| Property | Type | Description | -| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `domains?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ enrollmentMode?: "manual_invitation" \| "automatic_invitation" \| "automatic_suggestion"; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `enrollmentMode`: A string that filters the domains by the provided [enrollment mode](/docs/organizations/verified-domains#enrollment-mode).
  • Any of the properties described in [Shared properties](#shared-properties).
| -| `invitations?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: ("expired" \| "revoked" \| "pending" \| "accepted")[]; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the invitations by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| -| `membershipRequests?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: "expired" \| "revoked" \| "pending" \| "accepted"; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the membership requests by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| -| `memberships?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ query?: string; role?: string[]; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `role`: An array of [`OrganizationCustomRoleKey`](/docs/references/javascript/types/organization-custom-role-key).
  • `query`: A string that filters the memberships by the provided string.
  • Any of the properties described in [Shared properties](#shared-properties).
| -| `subscriptions?` | true \| \{ initialPage?: number; pageSize?: number; \} & object & \{ orgId?: string; \} & \{ infinite?: boolean; keepPreviousData?: 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. If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `orgId`: A string that filters the subscriptions by the provided organization ID.
  • Any of the properties described in [Shared properties](#shared-properties).
| diff --git a/.typedoc/docs/shared/use-organization-return.mdx b/.typedoc/docs/shared/use-organization-return.mdx deleted file mode 100644 index db16c2a130b..00000000000 --- a/.typedoc/docs/shared/use-organization-return.mdx +++ /dev/null @@ -1,10 +0,0 @@ -| Property | Type | Description | -| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `domains` | null \| PaginatedResourcesWithDefault\<[OrganizationDomainResource](/docs/references/javascript/types/organization-domain)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationDomainResource](/docs/references/javascript/types/organization-domain), T\["membershipRequests"\] _extends_ \{ infinite: true; \} ? true : false\> | Includes a paginated list of the organization's domains. | -| `invitations` | null \| PaginatedResourcesWithDefault\<[OrganizationInvitationResource](/docs/references/javascript/types/organization-invitation)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationInvitationResource](/docs/references/javascript/types/organization-invitation), T\["invitations"\] _extends_ \{ infinite: true; \} ? true : false\> | Includes a paginated list of the organization's invitations. | -| `isLoaded` | `boolean` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `membership` | undefined \| null \| [OrganizationMembershipResource](/docs/references/javascript/types/organization-membership) | The current organization membership. | -| `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\<[CommerceSubscriptionItemResource](/docs/references/javascript/types/commerce-subscription-item-resource)\> \| [PaginatedResources](#paginated-resources)\<[CommerceSubscriptionItemResource](/docs/references/javascript/types/commerce-subscription-item-resource), 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/.typedoc/docs/shared/use-organization.mdx b/.typedoc/docs/shared/use-organization.mdx deleted file mode 100644 index bb92bf55245..00000000000 --- a/.typedoc/docs/shared/use-organization.mdx +++ /dev/null @@ -1,130 +0,0 @@ -The `useOrganization()` hook retrieves attributes of the currently active organization. - -## Parameters - -| Parameter | Type | -| --------- | ---- | -| `params?` | `T` | - -## Returns - -[`UseOrganizationReturn`](use-organization-return.mdx)\<`T`\> - -## Examples - -### Expand and paginate attributes - -To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. By default, the `memberships`, `invitations`, `membershipRequests`, and `domains` attributes are not populated. You must pass `true` or an object with the desired properties to fetch and paginate the data. - -```tsx -// invitations.data will never be populated. -const { invitations } = useOrganization(); - -// Use default values to fetch invitations, such as initialPage = 1 and pageSize = 10 -const { invitations } = useOrganization({ - invitations: true, -}); - -// Pass your own values to fetch invitations -const { invitations } = useOrganization({ - invitations: { - pageSize: 20, - initialPage: 2, // skips the first page - }, -}); - -// Aggregate pages in order to render an infinite list -const { invitations } = useOrganization({ - invitations: { - infinite: true, - }, -}); -``` - -### Infinite pagination - -The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. - -```tsx -import { useOrganization } from '@clerk/clerk-react' - -export default function MemberList() { - const { memberships } = useOrganization({ - memberships: { - infinite: true, // Append new data to the existing list - keepPreviousData: true, // Persist the cached data until the new data has been fetched - }, - }) - - if (!memberships) { - // Handle loading state - return null - } - - return ( -
-

Organization members

-
    - {memberships.data?.map((membership) => ( -
  • - {membership.publicUserData.firstName} {membership.publicUserData.lastName} < - {membership.publicUserData.identifier}> :: {membership.role} -
  • - ))} -
- - -
- ) -} -``` - -### Simple pagination - -The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of memberships. - -Notice the difference between this example's pagination and the infinite pagination example above. - -```tsx -import { useOrganization } from '@clerk/clerk-react' - -export default function MemberList() { - const { memberships } = useOrganization({ - memberships: { - keepPreviousData: true, // Persist the cached data until the new data has been fetched - }, - }) - - if (!memberships) { - // Handle loading state - return null - } - - return ( -
-

Organization members

-
    - {memberships.data?.map((membership) => ( -
  • - {membership.publicUserData.firstName} {membership.publicUserData.lastName} < - {membership.publicUserData.identifier}> :: {membership.role} -
  • - ))} -
- - - - -
- ) -} -``` diff --git a/.typedoc/docs/shared/use-reverification.mdx b/.typedoc/docs/shared/use-reverification.mdx deleted file mode 100644 index a9dc76aff33..00000000000 --- a/.typedoc/docs/shared/use-reverification.mdx +++ /dev/null @@ -1,54 +0,0 @@ -> [!WARNING] -> -> Depending on the SDK you're using, this feature requires `@clerk/nextjs@6.12.7` or later, `@clerk/clerk-react@5.25.1` or later, and `@clerk/clerk-js@5.57.1` or later. - -The `useReverification()` hook is used to handle a session's reverification flow. If a request requires reverification, a modal will display, prompting the user to verify their credentials. Upon successful verification, the original request will automatically retry. - -## Parameters - -| Parameter | Type | -| ---------- | --------- | -| `fetcher` | `Fetcher` | -| `options?` | `Options` | - -## Returns - -`UseReverificationResult`\<`Fetcher`\> — The `useReverification()` hook returns an array with the "enhanced" fetcher. - -## Example - -### Handle cancellation of the reverification process - -The following example demonstrates how to handle scenarios where a user cancels the reverification flow, such as closing the modal, which might result in `myData` being `null`. - -In the following example, `myFetcher` would be a function in your backend that fetches data from the route that requires reverification. See the [guide on how to require reverification](/docs/guides/reverification) for more information. - -```tsx {{ filename: 'src/components/MyButton.tsx' }} -import { useReverification } from '@clerk/clerk-react'; -import { isReverificationCancelledError } from '@clerk/clerk-react/error'; - -type MyData = { - balance: number; -}; - -export function MyButton() { - const fetchMyData = () => fetch('/api/balance').then(res => res.json() as Promise); - const enhancedFetcher = useReverification(fetchMyData); - - const handleClick = async () => { - try { - const myData = await enhancedFetcher(); - // ^ is types as `MyData` - } catch (e) { - // Handle error returned from the fetcher here - - // You can also handle cancellation with the following - if (isReverificationCancelledError(err)) { - // Handle the cancellation error here - } - } - }; - - return ; -} -``` diff --git a/.typedoc/docs/shared/use-session-list.mdx b/.typedoc/docs/shared/use-session-list.mdx deleted file mode 100644 index 778f89720ee..00000000000 --- a/.typedoc/docs/shared/use-session-list.mdx +++ /dev/null @@ -1,77 +0,0 @@ -The `useSessionList()` hook returns an array of [`Session`](/docs/references/javascript/session) objects that have been registered on the client device. - -## 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. - - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `sessions` | `undefined` | A list of sessions that have been registered on the client device. | -| `setActive` | `undefined` | A function that sets the active session and/or organization. | - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `sessions` | [SessionResource](/docs/references/javascript/session)[] | A list of sessions that have been registered on the client device. | -| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session and/or organization. | - - - -## Example - -### Get a list of sessions - -The following example uses `useSessionList()` to get a list of sessions that have been registered on the client device. The `sessions` property is used to show the number of times the user has visited the page. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useSessionList } from '@clerk/clerk-react'; - -export default function Home() { - const { isLoaded, sessions } = useSessionList(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return ( -
-

Welcome back. You've been here {sessions.length} times before.

-
- ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -'use client'; - -import { useSessionList } from '@clerk/nextjs'; - -export default function HomePage() { - const { isLoaded, sessions } = useSessionList(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return ( -
-

Welcome back. You've been here {sessions.length} times before.

-
- ); -} -``` - -
-
diff --git a/.typedoc/docs/shared/use-session.mdx b/.typedoc/docs/shared/use-session.mdx deleted file mode 100644 index 0ace96d5bc6..00000000000 --- a/.typedoc/docs/shared/use-session.mdx +++ /dev/null @@ -1,89 +0,0 @@ -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. - -## 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. - - - - | Name | Type | Description | | ------ | ------ | ------ | | `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 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 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` | `boolean` - | A boolean that indicates whether a user is currently signed in. | | `session` | - [`SignedInSessionResource`](/docs/references/javascript/session) | The current session for the user. | - - - -## Example - -### Access the `Session` object - -The following example uses the `useSession()` hook to access the `Session` object, which has the `lastActiveAt` property. The `lastActiveAt` property is a `Date` object used to show the time the session was last active. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useSession } from '@clerk/clerk-react'; - -export default function Home() { - const { isLoaded, session, isSignedIn } = useSession(); - - if (!isLoaded) { - // Handle loading state - return null; - } - if (!isSignedIn) { - // Handle signed out state - return null; - } - - return ( -
-

This session has been active since {session.lastActiveAt.toLocaleString()}

-
- ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -'use client'; - -import { useSession } from '@clerk/nextjs'; - -export default function HomePage() { - const { isLoaded, session, isSignedIn } = useSession(); - - if (!isLoaded) { - // Handle loading state - return null; - } - if (!isSignedIn) { - // Handle signed out state - return null; - } - - return ( -
-

This session has been active since {session.lastActiveAt.toLocaleString()}

-
- ); -} -``` - -
-
diff --git a/.typedoc/docs/shared/use-user.mdx b/.typedoc/docs/shared/use-user.mdx deleted file mode 100644 index d8d08b7ab26..00000000000 --- a/.typedoc/docs/shared/use-user.mdx +++ /dev/null @@ -1,208 +0,0 @@ -The `useUser()` hook provides access to the current user's [`User`](/docs/references/javascript/user) object, which contains all the data for a single user in your application and provides methods to manage their account. This hook also allows you to check if the user is signed in and if Clerk has loaded and initialized. - -## 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. - - - - | Name | Type | Description | | ------ | ------ | ------ | | `isLoaded` | `false` | A boolean that indicates whether - Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | | `isSignedIn` | - `undefined` | A boolean that returns `true` if the user is signed in. | | `user` | `undefined` | The `User` object - for the current 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 returns `true` if the user is signed in. | | `user` | `null` | The `User` object for the current - 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 returns `true` if the user is signed in. | | `user` | - [`UserResource`](/docs/references/javascript/user) | The `User` object for the current user. | - - - -## Examples - -### Get the current user - -The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which contains the current user's data such as their full name. The `isLoaded` and `isSignedIn` properties are used to handle the loading state and to check if the user is signed in, respectively. - -```tsx {{ filename: 'src/Example.tsx' }} -export default function Example() { - const { isSignedIn, user, isLoaded } = useUser(); - - if (!isLoaded) { - return
Loading...
; - } - - if (!isSignedIn) { - return
Sign in to view this page
; - } - - return
Hello {user.firstName}!
; -} -``` - -### Update user data - -The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`update()`](/docs/references/javascript/user#update) method to update the current user's information. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useUser } from '@clerk/clerk-react'; - -export default function Home() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - await user.update({ - firstName: 'John', - lastName: 'Doe', - }); - }; - - return ( - <> - -

user.firstName: {user?.firstName}

-

user.lastName: {user?.lastName}

- - ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -'use client'; - -import { useUser } from '@clerk/nextjs'; - -export default function HomePage() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - await user.update({ - firstName: 'John', - lastName: 'Doe', - }); - }; - - return ( - <> - -

user.firstName: {user?.firstName}

-

user.lastName: {user?.lastName}

- - ); -} -``` - -
-
- -### Reload user data - -The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`reload()`](/docs/references/javascript/user#reload) method to get the latest user's information. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useUser } from '@clerk/clerk-react'; - -export default function Home() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - // Update data via an API endpoint - const updateMetadata = await fetch('/api/updateMetadata'); - - // Check if the update was successful - if (updateMetadata.message !== 'success') { - throw new Error('Error updating'); - } - - // If the update was successful, reload the user data - await user.reload(); - }; - - return ( - <> - -

user role: {user?.publicMetadata.role}

- - ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -'use client'; - -import { useUser } from '@clerk/nextjs'; - -export default function HomePage() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - // Update data via an API endpoint - const updateMetadata = await fetch('/api/updateMetadata'); - - // Check if the update was successful - if (updateMetadata.message !== 'success') { - throw new Error('Error updating'); - } - - // If the update was successful, reload the user data - await user.reload(); - }; - - return ( - <> - -

user role: {user?.publicMetadata.role}

- - ); -} -``` - -
-
diff --git a/.typedoc/docs/shared/user-agent-is-robot.mdx b/.typedoc/docs/shared/user-agent-is-robot.mdx deleted file mode 100644 index fada624f70e..00000000000 --- a/.typedoc/docs/shared/user-agent-is-robot.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Checks if the user agent is a bot. - -## Parameters - -| Parameter | Type | Description | -| ----------- | -------- | --------------------- | -| `userAgent` | `string` | Any user agent string | - -## Returns - -`boolean` diff --git a/.typedoc/docs/shared/version-selector.mdx b/.typedoc/docs/shared/version-selector.mdx deleted file mode 100644 index f40c7058ab1..00000000000 --- a/.typedoc/docs/shared/version-selector.mdx +++ /dev/null @@ -1,17 +0,0 @@ -This version selector is a bit complicated, so here is the flow: - -1. Use the clerkJSVersion prop on the provider -2. Use the exact `@clerk/clerk-js` version if it is a `@snapshot` prerelease -3. Use the prerelease tag of `@clerk/clerk-js` or the packageVersion provided -4. Fallback to the major version of `@clerk/clerk-js` or the packageVersion provided - -## Parameters - -| Parameter | Type | Description | -| ---------------- | -------------------------------- | ----------------------------------------------------------------------------------------- | -| `clerkJSVersion` | undefined \| string | The optional clerkJSVersion prop on the provider | -| `packageVersion` | `string` | The version of `@clerk/clerk-js` that will be used if an explicit version is not provided | - -## Returns - -`string` — The npm tag, version or major version to use diff --git a/.typedoc/docs/types/act-claim.mdx b/.typedoc/docs/types/act-claim.mdx deleted file mode 100644 index 3de8a4c99a4..00000000000 --- a/.typedoc/docs/types/act-claim.mdx +++ /dev/null @@ -1 +0,0 @@ -JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). diff --git a/.typedoc/docs/types/act-jwt-claim.mdx b/.typedoc/docs/types/act-jwt-claim.mdx deleted file mode 100644 index 33ad615eb64..00000000000 --- a/.typedoc/docs/types/act-jwt-claim.mdx +++ /dev/null @@ -1,5 +0,0 @@ -JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). - -## Deprecated - -Use `ActClaim` instead. diff --git a/.typedoc/docs/types/active-session-resource.mdx b/.typedoc/docs/types/active-session-resource.mdx deleted file mode 100644 index ea2985b809f..00000000000 --- a/.typedoc/docs/types/active-session-resource.mdx +++ /dev/null @@ -1,33 +0,0 @@ -Represents a session resource that has completed all pending tasks -and authentication factors - -## Properties - -| Property | Type | Description | Overrides | -| ---------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `end` | () => Promise\<[SessionResource](/docs/references/javascript/session)\> | Marks the session as ended. The session will no longer be active for this `Client` and its status will become **ended**. | - | -| `factorVerificationAge` | null \| \[number, number\] | An array where each item represents the number of minutes since the last verification of a first or second factor: `[firstFactorAge, secondFactorAge]`. | - | -| `id` | `string` | The unique identifier for the session. | - | -| `pathRoot` | `string` | The root path of the resource. | - | -| `status` | `"active"` | The current state of the session. | [`SessionResource`](/docs/references/javascript/session).[`status`](/docs/references/javascript/session#status) | -| `user` | [`UserResource`](/docs/references/javascript/user) | The user associated with the session. | [`SessionResource`](/docs/references/javascript/session).[`user`](/docs/references/javascript/session#user) | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`ActiveSessionResource`\> - -#### Inherited from - -[`SessionResource`](/docs/references/javascript/session).[`reload`](/docs/references/javascript/session#reload) diff --git a/.typedoc/docs/types/add-payment-source-params.mdx b/.typedoc/docs/types/add-payment-source-params.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/add-payment-source-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/cancel-subscription-params.mdx b/.typedoc/docs/types/cancel-subscription-params.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/cancel-subscription-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/check-authorization-fn.mdx b/.typedoc/docs/types/check-authorization-fn.mdx deleted file mode 100644 index cbec4ba71ef..00000000000 --- a/.typedoc/docs/types/check-authorization-fn.mdx +++ /dev/null @@ -1,9 +0,0 @@ -## Parameters - -| Parameter | Type | -| -------------------- | -------- | -| `isAuthorizedParams` | `Params` | - -## Returns - -`boolean` diff --git a/.typedoc/docs/types/check-authorization-from-session-claims.mdx b/.typedoc/docs/types/check-authorization-from-session-claims.mdx deleted file mode 100644 index f7357cd71cb..00000000000 --- a/.typedoc/docs/types/check-authorization-from-session-claims.mdx +++ /dev/null @@ -1,13 +0,0 @@ -Type guard for server-side authorization checks using session claims. -System permissions are not allowed since they are not included -in session claims and cannot be verified on the server side. - -## Parameters - -| Parameter | Type | -| -------------------- | -------------------------------------------------------------------------------------------------------- | -| `isAuthorizedParams` | [`CheckAuthorizationParamsFromSessionClaims`](check-authorization-params-from-session-claims.mdx)\<`P`\> | - -## Returns - -`boolean` diff --git a/.typedoc/docs/types/check-authorization-params-from-session-claims.mdx b/.typedoc/docs/types/check-authorization-params-from-session-claims.mdx deleted file mode 100644 index 5299e174317..00000000000 --- a/.typedoc/docs/types/check-authorization-params-from-session-claims.mdx +++ /dev/null @@ -1,9 +0,0 @@ -## Properties - -| Property | Type | Description | -| --------------------------------------------- | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -| `feature?` | `Autocomplete`\< user:${string} \| org:${string} \> | The [feature](/docs/billing/overview) to check for. | -| `permission?` | `DisallowSystemPermissions`\<`P`\> | The [permission](/docs/organizations/roles-permissions) to check for. | -| `plan?` | `Autocomplete`\< user:${string} \| org:${string} \> | The [plan](/docs/billing/overview) to check for. | -| `reverification?` | [`ReverificationConfig`](reverification-config.mdx) | The reverification configuration to check for. This feature is currently in public beta. **It is not recommended for production use.** | -| `role?` | `string` | The [role](/docs/organizations/roles-permissions) to check for. | diff --git a/.typedoc/docs/types/check-authorization-with-custom-permissions.mdx b/.typedoc/docs/types/check-authorization-with-custom-permissions.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/clerk-api-error.mdx b/.typedoc/docs/types/clerk-api-error.mdx deleted file mode 100644 index 63a5b74ea7b..00000000000 --- a/.typedoc/docs/types/clerk-api-error.mdx +++ /dev/null @@ -1,24 +0,0 @@ -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[]; 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/.typedoc/docs/types/clerk-api-response-error.mdx b/.typedoc/docs/types/clerk-api-response-error.mdx deleted file mode 100644 index b2f65c266de..00000000000 --- a/.typedoc/docs/types/clerk-api-response-error.mdx +++ /dev/null @@ -1 +0,0 @@ -Interface representing a Clerk API Response Error. diff --git a/.typedoc/docs/types/clerk-host-router.mdx b/.typedoc/docs/types/clerk-host-router.mdx deleted file mode 100644 index c94fdb43453..00000000000 --- a/.typedoc/docs/types/clerk-host-router.mdx +++ /dev/null @@ -1 +0,0 @@ -This type represents a generic router interface that Clerk relies on to interact with the host router. diff --git a/.typedoc/docs/types/clerk-jwt-claims.mdx b/.typedoc/docs/types/clerk-jwt-claims.mdx deleted file mode 100644 index 4aab45ad6c6..00000000000 --- a/.typedoc/docs/types/clerk-jwt-claims.mdx +++ /dev/null @@ -1,28 +0,0 @@ -Clerk-issued JWT payload - -## Deprecated - -Use `JwtPayload` instead. - -## Indexable - -\[`propName`: `string`\]: `unknown` - -Any other JWT Claim Set member. - -## Properties - -| Property | Type | Description | -| ------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| ~~`act?`~~ | \{ [x: string]: unknown; sub: string; \} | JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). | -| `act.sub` | `string` | - | -| ~~`azp?`~~ | `string` | JWT Authorized party - [RFC7800#section-3](https://tools.ietf.org/html/rfc7800#section-3). | -| ~~`exp`~~ | `number` | JWT Expiration Time - [RFC7519#section-4.1.4](https://tools.ietf.org/html/rfc7519#section-4.1.4). | -| ~~`iat`~~ | `number` | JWT Issued At - [RFC7519#section-4.1.6](https://tools.ietf.org/html/rfc7519#section-4.1.6). | -| ~~`iss`~~ | `string` | JWT Issuer - [RFC7519#section-4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1). | -| ~~`nbf`~~ | `number` | JWT Not Before - [RFC7519#section-4.1.5](https://tools.ietf.org/html/rfc7519#section-4.1.5). | -| ~~`org_id?`~~ | `string` | Active organization ID. | -| ~~`org_role?`~~ | `string` | Active organization role. | -| ~~`org_slug?`~~ | `string` | Active organization slug. | -| ~~`sid`~~ | `string` | Session ID | -| ~~`sub`~~ | `string` | JWT Subject - [RFC7519#section-4.1.2](https://tools.ietf.org/html/rfc7519#section-4.1.2). | diff --git a/.typedoc/docs/types/clerk-paginated-response.mdx b/.typedoc/docs/types/clerk-paginated-response.mdx deleted file mode 100644 index bd31a7df330..00000000000 --- a/.typedoc/docs/types/clerk-paginated-response.mdx +++ /dev/null @@ -1,11 +0,0 @@ -An interface that describes the response of a method that returns a paginated list of resources. - -> [!TIP] -> Clerk's SDKs always use `Promise>`. If the promise resolves, you will get back the properties. If the promise is rejected, you will receive a `ClerkAPIResponseError` or network error. - -## Properties - -| Property | Type | Description | -| -------------------------------------- | ---------------- | -------------------------------------------- | -| `data` | T[] | An array that contains the fetched data. | -| `total_count` | `number` | The total count of data that exist remotely. | diff --git a/.typedoc/docs/types/clerk-pagination-params.mdx b/.typedoc/docs/types/clerk-pagination-params.mdx deleted file mode 100644 index 70057fdc8c9..00000000000 --- a/.typedoc/docs/types/clerk-pagination-params.mdx +++ /dev/null @@ -1,6 +0,0 @@ -## Properties - -| 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`. | diff --git a/.typedoc/docs/types/clerk-pagination-request.mdx b/.typedoc/docs/types/clerk-pagination-request.mdx deleted file mode 100644 index e7b59556cc0..00000000000 --- a/.typedoc/docs/types/clerk-pagination-request.mdx +++ /dev/null @@ -1,8 +0,0 @@ -Pagination params in request - -## Type declaration - -| Name | Type | Description | -| --------- | -------- | ---------------------------------------------------- | -| `limit?` | `number` | Maximum number of items returned per request. | -| `offset?` | `number` | This is the starting point for your fetched results. | diff --git a/.typedoc/docs/types/clerk-resource.mdx b/.typedoc/docs/types/clerk-resource.mdx deleted file mode 100644 index 639c609d8c0..00000000000 --- a/.typedoc/docs/types/clerk-resource.mdx +++ /dev/null @@ -1,24 +0,0 @@ -Defines common properties and methods that all Clerk resources must implement. - -## Properties - -| Property | Type | Description | -| -------------------------------- | -------- | -------------------------------------- | -| `id?` | `string` | The unique identifier of the resource. | -| `pathRoot` | `string` | The root path of the resource. | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`ClerkResource`\> diff --git a/.typedoc/docs/types/clerk-status.mdx b/.typedoc/docs/types/clerk-status.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/clerk.mdx b/.typedoc/docs/types/clerk.mdx deleted file mode 100644 index fff118bd1d0..00000000000 --- a/.typedoc/docs/types/clerk.mdx +++ /dev/null @@ -1,332 +0,0 @@ -Main Clerk SDK object. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `__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_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` | `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`](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. | -| `closeOrganizationProfile` | () => void | Closes the Clerk OrganizationProfile modal. | -| `closeSignIn` | () => void | Closes the Clerk SignIn modal. | -| `closeSignUp` | () => void | Closes the Clerk SignUp modal. | -| `closeUserProfile` | () => void | Closes the Clerk UserProfile modal. | -| `closeWaitlist` | () => void | Closes the Clerk Waitlist modal. | -| `createOrganization` | (params) => Promise\<[OrganizationResource](/docs/references/javascript/organization)\> | Creates an organization, adding the current user as admin. | -| `domain` | `string` | Clerk Satellite Frontend API string. | -| `getOrganization` | (organizationId) => Promise\<[OrganizationResource](/docs/references/javascript/organization)\> | Retrieves a single organization by id. | -| `handleEmailLinkVerification` | (params, customNavigate?) => Promise\ | Completes a Email Link flow started by Clerk.client.signIn.createEmailLinkFlow or Clerk.client.signUp.createEmailLinkFlow | -| `handleGoogleOneTapCallback` | (signInOrUp, params, customNavigate?) => Promise\ | Completes a Google One Tap redirection flow started by [Clerk.authenticateWithGoogleOneTap](#authenticatewithgoogleonetap) | -| `handleRedirectCallback` | (params, customNavigate?) => Promise\ | Completes an OAuth or SAML redirection flow started by Clerk.client.signIn.authenticateWithRedirect or Clerk.client.signUp.authenticateWithRedirect | -| `handleUnauthenticated` | () => Promise\ | Handles a 401 response from Frontend API by refreshing the client and session object accordingly | -| `instanceType` | undefined \| InstanceType | Clerk Instance type is defined from the Publishable key | -| `isSatellite` | `boolean` | Clerk Flag for satellite apps. | -| `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. | -| `mountOrganizationSwitcher` | (targetNode, props?) => void | Mount an organization switcher component at the target element. | -| `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. | -| `navigate` | `CustomNavigation` | Function used to commit a navigation after certain steps in the Clerk processes. | -| `off` | `OffEventListener` | Removes an event handler for a specific Clerk event. **Param** The event name to unsubscribe from **Param** The callback function to remove | -| `on` | `OnEventListener` | Registers an event handler for a specific Clerk event. **Param** The event name to subscribe to **Param** The callback function to execute when the event is dispatched **Param** Optional configuration object **Param** If true and the event was previously dispatched, handler will be called immediately with the latest payload | -| `openCreateOrganization` | (props?) => void | Opens the Clerk CreateOrganization modal. | -| `openGoogleOneTap` | (props?) => void | Opens the Google One Tap component. | -| `openOrganizationProfile` | (props?) => void | Opens the Clerk OrganizationProfile modal. | -| `openSignIn` | (props?) => void | Opens the Clerk SignIn component in a modal. | -| `openSignUp` | (props?) => void | Opens the Clerk SignUp component in a modal. | -| `openUserProfile` | (props?) => void | Opens the Clerk UserProfile modal. | -| `openWaitlist` | (props?) => void | Opens the Clerk Waitlist modal. | -| `organization` | undefined \| null \| [OrganizationResource](/docs/references/javascript/organization) | Active Organization | -| `proxyUrl` | undefined \| string | Clerk Proxy url string. | -| `publishableKey` | `string` | Clerk Publishable Key string. | -| `redirectToAfterSignIn` | () => void | Redirects to the configured afterSignIn URL. | -| `redirectToAfterSignOut` | () => void | Redirects to the configured afterSignOut URL. | -| `redirectToAfterSignUp` | () => void | Redirects to the configured afterSignUp URL. | -| `redirectToCreateOrganization` | () => Promise\ | Redirects to the configured URL where `` is mounted. | -| `redirectToOrganizationProfile` | () => Promise\ | Redirects to the configured URL where `` is mounted. | -| `redirectToUserProfile` | () => Promise\ | Redirects to the configured URL where `` is mounted. | -| `redirectToWaitlist` | () => void | Redirects to the configured URL where `` is mounted. | -| `sdkMetadata` | undefined \| \{ environment?: string; name: string; version: string; \} | If present, contains information about the SDK that the host application is using. For example, if Clerk is loaded through `@clerk/nextjs`, this would be `{ name: '@clerk/nextjs', version: '1.0.0' }` | -| `session` | undefined \| null \| [SignedInSessionResource](/docs/references/javascript/session) | Current Session. | -| `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. | -| `unmountOrganizationSwitcher` | (targetNode) => void | Unmount the organization profile component from the target node.\* | -| `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. | -| `user` | undefined \| null \| [UserResource](/docs/references/javascript/user) | Current User. | -| `version` | undefined \| string | Clerk SDK version number. | - -## Methods - -### buildAfterMultiSessionSingleSignOutUrl() - -Returns the configured afterMultiSessionSingleSignOutUrl of the instance. - -#### Returns - -`string` - ---- - -### buildAfterSignInUrl() - -Returns the configured afterSignInUrl of the instance. - -#### Parameters - -| Parameter | Type | -| --------------------------- | -------------------------------------------- | -| `__namedParameters?` | \{ params?: URLSearchParams; \} | -| `__namedParameters.params?` | `URLSearchParams` | - -#### Returns - -`string` - ---- - -### buildAfterSignOutUrl() - -Returns the configured afterSignOutUrl of the instance. - -#### Returns - -`string` - ---- - -### buildAfterSignUpUrl() - -Returns the configured afterSignInUrl of the instance. - -#### Parameters - -| Parameter | Type | -| --------------------------- | -------------------------------------------- | -| `__namedParameters?` | \{ params?: URLSearchParams; \} | -| `__namedParameters.params?` | `URLSearchParams` | - -#### Returns - -`string` - ---- - -### buildCreateOrganizationUrl() - -Returns the configured url where `` is mounted or a custom create-organization page is rendered. - -#### Returns - -`string` - ---- - -### buildNewSubscriptionRedirectUrl() - -Returns the configured newSubscriptionRedirectUrl of the instance. - -#### Returns - -`string` - ---- - -### buildOrganizationProfileUrl() - -Returns the configured url where `` is mounted or a custom organization-profile page is rendered. - -#### Returns - -`string` - ---- - -### buildSignInUrl() - -Returns the configured url where `` is mounted or a custom sign-in page is rendered. - -#### Parameters - -| Parameter | Type | Description | -| --------- | ----------------------------------------- | ------------------------------------------------ | -| `opts?` | [`RedirectOptions`](redirect-options.mdx) | A [RedirectOptions](redirect-options.mdx) object | - -#### Returns - -`string` - ---- - -### buildSignUpUrl() - -Returns the configured url where `` is mounted or a custom sign-up page is rendered. - -#### Parameters - -| Parameter | Type | Description | -| --------- | ----------------------------------------- | ------------------------------------------------ | -| `opts?` | [`RedirectOptions`](redirect-options.mdx) | A [RedirectOptions](redirect-options.mdx) object | - -#### Returns - -`string` - ---- - -### buildTasksUrl() - -Returns the configured url where tasks are mounted. - -#### Returns - -`string` - ---- - -### buildUrlWithAuth() - -Decorates the provided url with the auth token for development instances. - -#### Parameters - -| Parameter | Type | -| --------- | -------- | -| `to` | `string` | - -#### Returns - -`string` - ---- - -### buildUserProfileUrl() - -Returns the url where `` is mounted or a custom user-profile page is rendered. - -#### Returns - -`string` - ---- - -### buildWaitlistUrl() - -Returns the configured url where `` is mounted or a custom waitlist page is rendered. - -#### Parameters - -| Parameter | Type | -| --------------------- | ------------------------------------------------------------ | -| `opts?` | \{ initialValues?: Record\; \} | -| `opts.initialValues?` | `Record`\<`string`, `string`\> | - -#### Returns - -`string` - ---- - -### redirectToSignIn() - -Redirects to the configured URL where `` is mounted. - -#### Parameters - -| Parameter | Type | Description | -| --------- | ----------------------- | ------------------------------------------------ | -| `opts?` | `SignInRedirectOptions` | A [RedirectOptions](redirect-options.mdx) object | - -#### Returns - -`Promise`\<`unknown`\> - ---- - -### redirectToSignUp() - -Redirects to the configured URL where `` is mounted. - -#### Parameters - -| Parameter | Type | Description | -| --------- | ----------------------- | ------------------------------------------------ | -| `opts?` | `SignUpRedirectOptions` | A [RedirectOptions](redirect-options.mdx) object | - -#### Returns - -`Promise`\<`unknown`\> - ---- - -### redirectToTasks() - -Redirects to the configured URL where tasks are mounted. - -#### Parameters - -| Parameter | Type | Description | -| --------- | ---------------------- | ------------------------------------------------ | -| `opts?` | `TasksRedirectOptions` | A [RedirectOptions](redirect-options.mdx) object | - -#### Returns - -`Promise`\<`unknown`\> - ---- - -### redirectWithAuth() - -Redirects to the provided url after decorating it with the auth token for development instances. - -#### Parameters - -| Parameter | Type | -| --------- | -------- | -| `to` | `string` | - -#### Returns - -`Promise`\<`unknown`\> diff --git a/.typedoc/docs/types/commerce-billing-namespace.mdx b/.typedoc/docs/types/commerce-billing-namespace.mdx deleted file mode 100644 index 29e5563cda1..00000000000 --- a/.typedoc/docs/types/commerce-billing-namespace.mdx +++ /dev/null @@ -1,24 +0,0 @@ -**`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](/docs/references/javascript/types/commerce-subscription-item-resource)\>\> | **`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/.typedoc/docs/types/commerce-checkout-json.mdx b/.typedoc/docs/types/commerce-checkout-json.mdx deleted file mode 100644 index 0bc32fe21d2..00000000000 --- a/.typedoc/docs/types/commerce-checkout-json.mdx +++ /dev/null @@ -1,27 +0,0 @@ -**`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`** | - | -| `free_trial_ends_at?` | null \| number | **`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/.typedoc/docs/types/commerce-checkout-resource.mdx b/.typedoc/docs/types/commerce-checkout-resource.mdx deleted file mode 100644 index c37d75bb3a6..00000000000 --- a/.typedoc/docs/types/commerce-checkout-resource.mdx +++ /dev/null @@ -1,48 +0,0 @@ -**`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: ``. | - | -| `freeTrialEndsAt` | 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: ``. | - | -| `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/.typedoc/docs/types/commerce-checkout-totals-json.mdx b/.typedoc/docs/types/commerce-checkout-totals-json.mdx deleted file mode 100644 index de2958cec5f..00000000000 --- a/.typedoc/docs/types/commerce-checkout-totals-json.mdx +++ /dev/null @@ -1,20 +0,0 @@ -**`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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | -| `grand_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | -| `subtotal` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | -| `tax_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | -| `total_due_now` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | diff --git a/.typedoc/docs/types/commerce-checkout-totals.mdx b/.typedoc/docs/types/commerce-checkout-totals.mdx deleted file mode 100644 index c07e0c2fa44..00000000000 --- a/.typedoc/docs/types/commerce-checkout-totals.mdx +++ /dev/null @@ -1,21 +0,0 @@ -**`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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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/.typedoc/docs/types/commerce-feature-json.mdx b/.typedoc/docs/types/commerce-feature-json.mdx deleted file mode 100644 index 63af4c9a40f..00000000000 --- a/.typedoc/docs/types/commerce-feature-json.mdx +++ /dev/null @@ -1,21 +0,0 @@ -**`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/.typedoc/docs/types/commerce-feature-resource.mdx b/.typedoc/docs/types/commerce-feature-resource.mdx deleted file mode 100644 index 668ddfc40c3..00000000000 --- a/.typedoc/docs/types/commerce-feature-resource.mdx +++ /dev/null @@ -1,42 +0,0 @@ -**`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/.typedoc/docs/types/commerce-initialized-payment-source-json.mdx b/.typedoc/docs/types/commerce-initialized-payment-source-json.mdx deleted file mode 100644 index ccac7ad70db..00000000000 --- a/.typedoc/docs/types/commerce-initialized-payment-source-json.mdx +++ /dev/null @@ -1,20 +0,0 @@ -**`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/.typedoc/docs/types/commerce-initialized-payment-source-resource.mdx b/.typedoc/docs/types/commerce-initialized-payment-source-resource.mdx deleted file mode 100644 index 4bf9397e718..00000000000 --- a/.typedoc/docs/types/commerce-initialized-payment-source-resource.mdx +++ /dev/null @@ -1,40 +0,0 @@ -**`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/.typedoc/docs/types/commerce-money-amount-json.mdx b/.typedoc/docs/types/commerce-money-amount-json.mdx deleted file mode 100644 index f077ceca22c..00000000000 --- a/.typedoc/docs/types/commerce-money-amount-json.mdx +++ /dev/null @@ -1,19 +0,0 @@ -**`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/.typedoc/docs/types/commerce-money-amount.mdx b/.typedoc/docs/types/commerce-money-amount.mdx deleted file mode 100644 index 42f29879978..00000000000 --- a/.typedoc/docs/types/commerce-money-amount.mdx +++ /dev/null @@ -1,19 +0,0 @@ -**`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/.typedoc/docs/types/commerce-payer-resource-type.mdx b/.typedoc/docs/types/commerce-payer-resource-type.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/commerce-payer-resource-type.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/commerce-payment-charge-type.mdx b/.typedoc/docs/types/commerce-payment-charge-type.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/commerce-payment-charge-type.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/commerce-payment-json.mdx b/.typedoc/docs/types/commerce-payment-json.mdx deleted file mode 100644 index 7925118f659..00000000000 --- a/.typedoc/docs/types/commerce-payment-json.mdx +++ /dev/null @@ -1,26 +0,0 @@ -**`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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-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/.typedoc/docs/types/commerce-payment-resource.mdx b/.typedoc/docs/types/commerce-payment-resource.mdx deleted file mode 100644 index 4c1610cb0ca..00000000000 --- a/.typedoc/docs/types/commerce-payment-resource.mdx +++ /dev/null @@ -1,46 +0,0 @@ -**`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` | [`CommerceMoneyAmount`](commerce-money-amount.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`](/docs/references/javascript/types/commerce-subscription-item-resource) | **`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`](/docs/references/javascript/types/commerce-subscription-item-resource) | **`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/.typedoc/docs/types/commerce-payment-source-json.mdx b/.typedoc/docs/types/commerce-payment-source-json.mdx deleted file mode 100644 index ac44b63fa07..00000000000 --- a/.typedoc/docs/types/commerce-payment-source-json.mdx +++ /dev/null @@ -1,24 +0,0 @@ -**`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/.typedoc/docs/types/commerce-payment-source-methods.mdx b/.typedoc/docs/types/commerce-payment-source-methods.mdx deleted file mode 100644 index 362a61fe25b..00000000000 --- a/.typedoc/docs/types/commerce-payment-source-methods.mdx +++ /dev/null @@ -1,18 +0,0 @@ -**`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/.typedoc/docs/types/commerce-payment-source-resource.mdx b/.typedoc/docs/types/commerce-payment-source-resource.mdx deleted file mode 100644 index e4b52eb2fa7..00000000000 --- a/.typedoc/docs/types/commerce-payment-source-resource.mdx +++ /dev/null @@ -1,46 +0,0 @@ -**`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/.typedoc/docs/types/commerce-payment-source-status.mdx b/.typedoc/docs/types/commerce-payment-source-status.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/commerce-payment-source-status.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/commerce-payment-status.mdx b/.typedoc/docs/types/commerce-payment-status.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/commerce-payment-status.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/commerce-plan-json.mdx b/.typedoc/docs/types/commerce-plan-json.mdx deleted file mode 100644 index 86b5f126ca1..00000000000 --- a/.typedoc/docs/types/commerce-plan-json.mdx +++ /dev/null @@ -1,40 +0,0 @@ -**`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_fee` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | -| `annual_monthly_amount` | `number` | **`Experimental`** | - | -| `annual_monthly_amount_formatted` | `string` | **`Experimental`** | - | -| `annual_monthly_fee` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | -| `avatar_url` | `string` | **`Experimental`** | - | -| `currency` | `string` | **`Experimental`** | - | -| `currency_symbol` | `string` | **`Experimental`** | - | -| `description` | `string` | **`Experimental`** | - | -| `features` | [CommerceFeatureJSON](commerce-feature-json.mdx)[] | **`Experimental`** | - | -| `fee` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | -| `for_payer_type` | [`CommercePayerResourceType`](commerce-payer-resource-type.mdx) | **`Experimental`** | - | -| `free_trial_days?` | null \| number | **`Experimental`** | - | -| `free_trial_enabled?` | `boolean` | **`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/.typedoc/docs/types/commerce-plan-resource.mdx b/.typedoc/docs/types/commerce-plan-resource.mdx deleted file mode 100644 index a5423beca19..00000000000 --- a/.typedoc/docs/types/commerce-plan-resource.mdx +++ /dev/null @@ -1,52 +0,0 @@ -**`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 | -| ------------------------------------------------ | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `annualFee` | [`CommerceMoneyAmount`](commerce-money-amount.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: ``. | - | -| `annualMonthlyFee` | [`CommerceMoneyAmount`](commerce-money-amount.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: ``. | - | -| `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: ``. | - | -| `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: ``. | - | -| `fee` | [`CommerceMoneyAmount`](commerce-money-amount.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. | - | -| `freeTrialDays` | null \| 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: ``. | - | -| `freeTrialEnabled` | `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: ``. | - | -| `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/.typedoc/docs/types/commerce-product-json.mdx b/.typedoc/docs/types/commerce-product-json.mdx deleted file mode 100644 index 4d26dd18ff6..00000000000 --- a/.typedoc/docs/types/commerce-product-json.mdx +++ /dev/null @@ -1,21 +0,0 @@ -**`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/.typedoc/docs/types/commerce-product-resource.mdx b/.typedoc/docs/types/commerce-product-resource.mdx deleted file mode 100644 index 99ccb9cc2f1..00000000000 --- a/.typedoc/docs/types/commerce-product-resource.mdx +++ /dev/null @@ -1,41 +0,0 @@ -**`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/.typedoc/docs/types/commerce-statement-group-json.mdx b/.typedoc/docs/types/commerce-statement-group-json.mdx deleted file mode 100644 index 1b5c4f9da7d..00000000000 --- a/.typedoc/docs/types/commerce-statement-group-json.mdx +++ /dev/null @@ -1,19 +0,0 @@ -**`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/.typedoc/docs/types/commerce-statement-group.mdx b/.typedoc/docs/types/commerce-statement-group.mdx deleted file mode 100644 index 6b7532d42cc..00000000000 --- a/.typedoc/docs/types/commerce-statement-group.mdx +++ /dev/null @@ -1,17 +0,0 @@ -**`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/.typedoc/docs/types/commerce-statement-json.mdx b/.typedoc/docs/types/commerce-statement-json.mdx deleted file mode 100644 index e5126f13ed8..00000000000 --- a/.typedoc/docs/types/commerce-statement-json.mdx +++ /dev/null @@ -1,21 +0,0 @@ -**`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/.typedoc/docs/types/commerce-statement-resource.mdx b/.typedoc/docs/types/commerce-statement-resource.mdx deleted file mode 100644 index e711fb72de8..00000000000 --- a/.typedoc/docs/types/commerce-statement-resource.mdx +++ /dev/null @@ -1,41 +0,0 @@ -**`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/.typedoc/docs/types/commerce-statement-status.mdx b/.typedoc/docs/types/commerce-statement-status.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/commerce-statement-status.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/commerce-statement-totals-json.mdx b/.typedoc/docs/types/commerce-statement-totals-json.mdx deleted file mode 100644 index b196fc009f9..00000000000 --- a/.typedoc/docs/types/commerce-statement-totals-json.mdx +++ /dev/null @@ -1,19 +0,0 @@ -**`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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | -| `grand_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | -| `subtotal` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | -| `tax_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | diff --git a/.typedoc/docs/types/commerce-statement-totals.mdx b/.typedoc/docs/types/commerce-statement-totals.mdx deleted file mode 100644 index 0056b3e8b60..00000000000 --- a/.typedoc/docs/types/commerce-statement-totals.mdx +++ /dev/null @@ -1,20 +0,0 @@ -**`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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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/.typedoc/docs/types/commerce-subscription-item-json.mdx b/.typedoc/docs/types/commerce-subscription-item-json.mdx deleted file mode 100644 index 94b0ec074fc..00000000000 --- a/.typedoc/docs/types/commerce-subscription-item-json.mdx +++ /dev/null @@ -1,30 +0,0 @@ -**`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?` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | -| `canceled_at` | null \| number | **`Experimental`** | - | -| `created_at` | `number` | **`Experimental`** | - | -| `credit?` | \{ amount: [CommerceMoneyAmountJSON](commerce-money-amount-json.mdx); \} | **`Experimental`** | - | -| `credit.amount` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | - | - | -| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | -| `is_free_trial?` | `boolean` | **`Experimental`** | - | -| `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/.typedoc/docs/types/commerce-subscription-item-resource.mdx b/.typedoc/docs/types/commerce-subscription-item-resource.mdx deleted file mode 100644 index 07480ffc649..00000000000 --- a/.typedoc/docs/types/commerce-subscription-item-resource.mdx +++ /dev/null @@ -1,51 +0,0 @@ -**`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?` | [`CommerceMoneyAmount`](commerce-money-amount.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: [CommerceMoneyAmount](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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) | -| `isFreeTrial` | `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: ``. | - | -| `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/.typedoc/docs/types/commerce-subscription-json.mdx b/.typedoc/docs/types/commerce-subscription-json.mdx deleted file mode 100644 index 374736a1674..00000000000 --- a/.typedoc/docs/types/commerce-subscription-json.mdx +++ /dev/null @@ -1,27 +0,0 @@ -**`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`** | - | -| `eligible_for_free_trial?` | `boolean` | **`Experimental`** | - | -| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | -| `next_payment?` | \{ amount: [CommerceMoneyAmountJSON](commerce-money-amount-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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-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/.typedoc/docs/types/commerce-subscription-plan-period.mdx b/.typedoc/docs/types/commerce-subscription-plan-period.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/commerce-subscription-plan-period.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/commerce-subscription-resource.mdx b/.typedoc/docs/types/commerce-subscription-resource.mdx deleted file mode 100644 index d0b7eac1df6..00000000000 --- a/.typedoc/docs/types/commerce-subscription-resource.mdx +++ /dev/null @@ -1,45 +0,0 @@ -**`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: ``. | - | -| `eligibleForFreeTrial?` | `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` | **`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: [CommerceMoneyAmount](commerce-money-amount.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](/docs/references/javascript/types/commerce-subscription-item-resource)[] | **`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/.typedoc/docs/types/commerce-subscription-status.mdx b/.typedoc/docs/types/commerce-subscription-status.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/commerce-subscription-status.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/confirm-checkout-params.mdx b/.typedoc/docs/types/confirm-checkout-params.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/confirm-checkout-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/create-checkout-params.mdx b/.typedoc/docs/types/create-checkout-params.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/create-checkout-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/create-organization-params.mdx b/.typedoc/docs/types/create-organization-params.mdx deleted file mode 100644 index 77db98c5974..00000000000 --- a/.typedoc/docs/types/create-organization-params.mdx +++ /dev/null @@ -1,4 +0,0 @@ -| Property | Type | Description | -| ------------------------- | -------- | ----------------------------- | -| `name` | `string` | The name of the organization. | -| `slug?` | `string` | The slug of the organization. | diff --git a/.typedoc/docs/types/element-object-key.mdx b/.typedoc/docs/types/element-object-key.mdx deleted file mode 100644 index f5fec844683..00000000000 --- a/.typedoc/docs/types/element-object-key.mdx +++ /dev/null @@ -1 +0,0 @@ -Convert a kebab-cased key from ElementsConfig into a camelCased Elements key diff --git a/.typedoc/docs/types/elements-config.mdx b/.typedoc/docs/types/elements-config.mdx deleted file mode 100644 index 603ae040f48..00000000000 --- a/.typedoc/docs/types/elements-config.mdx +++ /dev/null @@ -1,3 +0,0 @@ -A map that describes the possible combinations we need to generate -for each unique base element -Kebab-case is used to differentiate between the container and child elements diff --git a/.typedoc/docs/types/experimental_checkout-button-props.mdx b/.typedoc/docs/types/experimental_checkout-button-props.mdx deleted file mode 100644 index acc34fcef18..00000000000 --- a/.typedoc/docs/types/experimental_checkout-button-props.mdx +++ /dev/null @@ -1,23 +0,0 @@ -> **\_\_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/.typedoc/docs/types/experimental_plan-details-button-props.mdx b/.typedoc/docs/types/experimental_plan-details-button-props.mdx deleted file mode 100644 index 96bd18fad08..00000000000 --- a/.typedoc/docs/types/experimental_plan-details-button-props.mdx +++ /dev/null @@ -1,22 +0,0 @@ -**`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/.typedoc/docs/types/experimental_subscription-details-button-props.mdx b/.typedoc/docs/types/experimental_subscription-details-button-props.mdx deleted file mode 100644 index 8256b10c77f..00000000000 --- a/.typedoc/docs/types/experimental_subscription-details-button-props.mdx +++ /dev/null @@ -1,23 +0,0 @@ -> **\_\_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/.typedoc/docs/types/for-payer-type.mdx b/.typedoc/docs/types/for-payer-type.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/for-payer-type.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/get-payment-attempts-params.mdx b/.typedoc/docs/types/get-payment-attempts-params.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/get-payment-attempts-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/get-payment-sources-params.mdx b/.typedoc/docs/types/get-payment-sources-params.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/get-payment-sources-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/get-plans-params.mdx b/.typedoc/docs/types/get-plans-params.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/get-plans-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/get-statements-params.mdx b/.typedoc/docs/types/get-statements-params.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/get-statements-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/get-subscription-params.mdx b/.typedoc/docs/types/get-subscription-params.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/get-subscription-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/get-subscriptions-params.mdx b/.typedoc/docs/types/get-subscriptions-params.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/get-subscriptions-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/get-token.mdx b/.typedoc/docs/types/get-token.mdx deleted file mode 100644 index 60dbf10f036..00000000000 --- a/.typedoc/docs/types/get-token.mdx +++ /dev/null @@ -1,9 +0,0 @@ -## Parameters - -| Parameter | Type | -| ---------- | ----------------- | -| `options?` | `GetTokenOptions` | - -## Returns - -`Promise`\<string \| null\> diff --git a/.typedoc/docs/types/id-selectors.mdx b/.typedoc/docs/types/id-selectors.mdx deleted file mode 100644 index 29c20772b88..00000000000 --- a/.typedoc/docs/types/id-selectors.mdx +++ /dev/null @@ -1 +0,0 @@ -Create a type union consisting of the base element with all valid ids appended diff --git a/.typedoc/docs/types/initialize-payment-source-params.mdx b/.typedoc/docs/types/initialize-payment-source-params.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/initialize-payment-source-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/internal_checkout-props.mdx b/.typedoc/docs/types/internal_checkout-props.mdx deleted file mode 100644 index 1c492a6f2d6..00000000000 --- a/.typedoc/docs/types/internal_checkout-props.mdx +++ /dev/null @@ -1,23 +0,0 @@ -> **\_\_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/.typedoc/docs/types/internal_plan-details-props.mdx b/.typedoc/docs/types/internal_plan-details-props.mdx deleted file mode 100644 index 58fb56c481b..00000000000 --- a/.typedoc/docs/types/internal_plan-details-props.mdx +++ /dev/null @@ -1,24 +0,0 @@ -**`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/.typedoc/docs/types/internal_subscription-details-props.mdx b/.typedoc/docs/types/internal_subscription-details-props.mdx deleted file mode 100644 index 1ed9c591f0c..00000000000 --- a/.typedoc/docs/types/internal_subscription-details-props.mdx +++ /dev/null @@ -1,23 +0,0 @@ -> **\_\_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/.typedoc/docs/types/jwt-claims.mdx b/.typedoc/docs/types/jwt-claims.mdx deleted file mode 100644 index 16182c24357..00000000000 --- a/.typedoc/docs/types/jwt-claims.mdx +++ /dev/null @@ -1,27 +0,0 @@ -## Deprecated - -Use `JwtPayload` instead. - -## Indexable - -\[`propName`: `string`\]: `unknown` - -Any other JWT Claim Set member. - -## Properties - -| Property | Type | Description | -| ------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| ~~`__raw`~~ | `string` | Encoded token supporting the `getRawString` method. | -| ~~`act?`~~ | \{ [x: string]: unknown; sub: string; \} | JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). | -| `act.sub` | `string` | - | -| ~~`azp?`~~ | `string` | JWT Authorized party - [RFC7800#section-3](https://tools.ietf.org/html/rfc7800#section-3). | -| ~~`exp`~~ | `number` | JWT Expiration Time - [RFC7519#section-4.1.4](https://tools.ietf.org/html/rfc7519#section-4.1.4). | -| ~~`iat`~~ | `number` | JWT Issued At - [RFC7519#section-4.1.6](https://tools.ietf.org/html/rfc7519#section-4.1.6). | -| ~~`iss`~~ | `string` | JWT Issuer - [RFC7519#section-4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1). | -| ~~`nbf`~~ | `number` | JWT Not Before - [RFC7519#section-4.1.5](https://tools.ietf.org/html/rfc7519#section-4.1.5). | -| ~~`org_id?`~~ | `string` | Active organization ID. | -| ~~`org_role?`~~ | `string` | Active organization role. | -| ~~`org_slug?`~~ | `string` | Active organization slug. | -| ~~`sid`~~ | `string` | Session ID | -| ~~`sub`~~ | `string` | JWT Subject - [RFC7519#section-4.1.2](https://tools.ietf.org/html/rfc7519#section-4.1.2). | diff --git a/.typedoc/docs/types/jwt-header.mdx b/.typedoc/docs/types/jwt-header.mdx deleted file mode 100644 index ad47ca006c3..00000000000 --- a/.typedoc/docs/types/jwt-header.mdx +++ /dev/null @@ -1,3 +0,0 @@ -## Deprecated - -Use `JwtHeader` instead. diff --git a/.typedoc/docs/types/legacy-redirect-props.mdx b/.typedoc/docs/types/legacy-redirect-props.mdx deleted file mode 100644 index 62b50d20394..00000000000 --- a/.typedoc/docs/types/legacy-redirect-props.mdx +++ /dev/null @@ -1,13 +0,0 @@ -> **LegacyRedirectProps** = \{ afterSignInUrl?: string \| null; afterSignUpUrl?: string \| null; redirectUrl?: string \| null; \} - -## Deprecated - -This will be removed in a future release. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------ | -| ~~`afterSignInUrl?`~~ | string \| null | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | -| ~~`afterSignUpUrl?`~~ | string \| null | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | -| ~~`redirectUrl?`~~ | string \| null | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | diff --git a/.typedoc/docs/types/localization-resource.mdx b/.typedoc/docs/types/localization-resource.mdx deleted file mode 100644 index 0c2b7715347..00000000000 --- a/.typedoc/docs/types/localization-resource.mdx +++ /dev/null @@ -1,13 +0,0 @@ -A type containing all the possible localization keys the prebuilt Clerk components support. -Users aiming to customize a few strings can also peak at the `data-localization-key` attribute by inspecting -the DOM and updating the corresponding key. -Users aiming to completely localize the components by providing a complete translation can use -the default english resource object from [Clerk's open source repo](https://github.com/clerk/javascript) -as a starting point. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `roles?` | `DeepPartial`\<`DeepLocalizationWithoutObjects`\<\{ [r: string]: string; \}\>\> | **`Experimental`** Add role keys and their localized values, e.g. `roles: { 'org:teacher': 'Teacher'}`. | -| `socialButtonsBlockButtonManyInView?` | `DeepPartial`\<\`$\{string\}\{\{provider\|titleize\}\}$\{string\}\` & \{ \_\_params: UnionToRecordWithPrimitives\; \}\> | It should be used to provide a shorter variation of `socialButtonsBlockButton`. It is explicitly typed, in order to avoid contributions that use LLM tools to generate translations that misinterpret the correct usage of this property. | diff --git a/.typedoc/docs/types/make-default-payment-source-params.mdx b/.typedoc/docs/types/make-default-payment-source-params.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/make-default-payment-source-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/multi-domain-and-or-proxy.mdx b/.typedoc/docs/types/multi-domain-and-or-proxy.mdx deleted file mode 100644 index fceea3d28db..00000000000 --- a/.typedoc/docs/types/multi-domain-and-or-proxy.mdx +++ /dev/null @@ -1,26 +0,0 @@ -You can configure proxy and satellite domains in a few ways: - -1. none of them are set -2. only `proxyUrl` is set -3. `isSatellite` and `proxyUrl` are set -4. `isSatellite` and `domain` are set - -## Type declaration - -| Name | Type | Description | -| -------------- | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `domain?` | `never` | **Required if your application is a satellite application**. Sets the domain of the satellite application. | -| `isSatellite?` | `never` | A boolean that indicates whether the application is a satellite application. | -| `proxyUrl?` | never \| 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`). | - -| Name | Type | -| ------------- | ----------------------------------------------------------- | -| `domain` | string \| (url) => string | -| `isSatellite` | `Exclude`\<`ClerkOptions`\[`"isSatellite"`\], `undefined`\> | -| `proxyUrl?` | `never` | - -| Name | Type | -| ------------- | ----------------------------------------------------------- | -| `domain?` | `never` | -| `isSatellite` | `Exclude`\<`ClerkOptions`\[`"isSatellite"`\], `undefined`\> | -| `proxyUrl` | string \| (url) => string | diff --git a/.typedoc/docs/types/organization-custom-role-key.mdx b/.typedoc/docs/types/organization-custom-role-key.mdx deleted file mode 100644 index d3729132f8f..00000000000 --- a/.typedoc/docs/types/organization-custom-role-key.mdx +++ /dev/null @@ -1,3 +0,0 @@ -`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/roles-permissions#custom-roles) as well. diff --git a/.typedoc/docs/types/organization-domain-resource.mdx b/.typedoc/docs/types/organization-domain-resource.mdx deleted file mode 100644 index 7e8db7659d8..00000000000 --- a/.typedoc/docs/types/organization-domain-resource.mdx +++ /dev/null @@ -1,28 +0,0 @@ -The `OrganizationDomain` object is the model around an organization domain. - -## 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. | - | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`OrganizationDomainResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-domain-verification-status.mdx b/.typedoc/docs/types/organization-domain-verification-status.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/organization-enrollment-mode.mdx b/.typedoc/docs/types/organization-enrollment-mode.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/organization-invitation-resource.mdx b/.typedoc/docs/types/organization-invitation-resource.mdx deleted file mode 100644 index 514156fa13d..00000000000 --- a/.typedoc/docs/types/organization-invitation-resource.mdx +++ /dev/null @@ -1,28 +0,0 @@ -The `OrganizationInvitation` object is the model around an organization invitation. - -## 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. | - | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`OrganizationInvitationResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-invitation-status.mdx b/.typedoc/docs/types/organization-invitation-status.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/organization-membership-request-resource.mdx b/.typedoc/docs/types/organization-membership-request-resource.mdx deleted file mode 100644 index bdd6dfe997d..00000000000 --- a/.typedoc/docs/types/organization-membership-request-resource.mdx +++ /dev/null @@ -1,28 +0,0 @@ -The `OrganizationMembershipRequest` object is the model that describes the request of a user to join an organization. - -## 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. | - | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`OrganizationMembershipRequestResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-membership-resource.mdx b/.typedoc/docs/types/organization-membership-resource.mdx deleted file mode 100644 index b4dc4fa94e1..00000000000 --- a/.typedoc/docs/types/organization-membership-resource.mdx +++ /dev/null @@ -1,28 +0,0 @@ -The `OrganizationMembership` object is the model around an organization membership entity and describes the relationship between users and organizations. - -## 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. | - | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`OrganizationMembershipResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-permission-key.mdx b/.typedoc/docs/types/organization-permission-key.mdx deleted file mode 100644 index 32332de64d2..00000000000 --- a/.typedoc/docs/types/organization-permission-key.mdx +++ /dev/null @@ -1,2 +0,0 @@ -OrganizationPermissionKey is a combination of system and custom permissions. -System permissions are only accessible from FAPI and client-side operations/utils diff --git a/.typedoc/docs/types/organization-resource.mdx b/.typedoc/docs/types/organization-resource.mdx deleted file mode 100644 index ffdffff3e9f..00000000000 --- a/.typedoc/docs/types/organization-resource.mdx +++ /dev/null @@ -1,34 +0,0 @@ -The `Organization` object holds information about an organization, as well as methods for managing it. - -To use these methods, you must have the **Organizations** feature [enabled in your app's settings in the Clerk Dashboard](/docs/organizations/overview#enable-organizations-in-your-application). - -## Properties - -| 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](/docs/references/javascript/types/commerce-subscription-item-resource)\>\> | **`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 - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`OrganizationResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-suggestion-resource.mdx b/.typedoc/docs/types/organization-suggestion-resource.mdx deleted file mode 100644 index 9ab3fff17b3..00000000000 --- a/.typedoc/docs/types/organization-suggestion-resource.mdx +++ /dev/null @@ -1,28 +0,0 @@ -An interface representing an organization suggestion. - -## 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. | - | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`OrganizationSuggestionResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-suggestion-status.mdx b/.typedoc/docs/types/organization-suggestion-status.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/organizations-jwt-claim.mdx b/.typedoc/docs/types/organizations-jwt-claim.mdx deleted file mode 100644 index cd60c4db281..00000000000 --- a/.typedoc/docs/types/organizations-jwt-claim.mdx +++ /dev/null @@ -1,3 +0,0 @@ -## Deprecated - -This type will be removed in the next major version. diff --git a/.typedoc/docs/types/override.mdx b/.typedoc/docs/types/override.mdx deleted file mode 100644 index 6aec62ed955..00000000000 --- a/.typedoc/docs/types/override.mdx +++ /dev/null @@ -1,4 +0,0 @@ -Overrides the type of existing properties -const obj = { a: string, b: number } as const; -type Value = Override -Value contains: { a:string, b: string } diff --git a/.typedoc/docs/types/path-value.mdx b/.typedoc/docs/types/path-value.mdx deleted file mode 100644 index 6b636990561..00000000000 --- a/.typedoc/docs/types/path-value.mdx +++ /dev/null @@ -1,4 +0,0 @@ -Used to read the value of a string path inside an object defined as const -const obj = { a: { b: 'hello' }} as const; -type Value = PathValue -Value is now a union set containing a single type: 'hello' diff --git a/.typedoc/docs/types/payment-gateway.mdx b/.typedoc/docs/types/payment-gateway.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/payment-gateway.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/pending-session-options.mdx b/.typedoc/docs/types/pending-session-options.mdx deleted file mode 100644 index 3b210e465f2..00000000000 --- a/.typedoc/docs/types/pending-session-options.mdx +++ /dev/null @@ -1,7 +0,0 @@ -> **PendingSessionOptions** = \{ treatPendingAsSignedOut?: boolean; \} - -## Properties - -| Property | Type | Description | -| --------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------- | -| `treatPendingAsSignedOut?` | `boolean` | A boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`. | diff --git a/.typedoc/docs/types/pending-session-resource.mdx b/.typedoc/docs/types/pending-session-resource.mdx deleted file mode 100644 index 44fa113497e..00000000000 --- a/.typedoc/docs/types/pending-session-resource.mdx +++ /dev/null @@ -1,32 +0,0 @@ -Represents a session resource that has completed sign-in but has pending tasks - -## Properties - -| Property | Type | Description | Overrides | -| ---------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `end` | () => Promise\<[SessionResource](/docs/references/javascript/session)\> | Marks the session as ended. The session will no longer be active for this `Client` and its status will become **ended**. | - | -| `factorVerificationAge` | null \| \[number, number\] | An array where each item represents the number of minutes since the last verification of a first or second factor: `[firstFactorAge, secondFactorAge]`. | - | -| `id` | `string` | The unique identifier for the session. | - | -| `pathRoot` | `string` | The root path of the resource. | - | -| `status` | `"pending"` | The current state of the session. | [`SessionResource`](/docs/references/javascript/session).[`status`](/docs/references/javascript/session#status) | -| `user` | [`UserResource`](/docs/references/javascript/user) | The user associated with the session. | [`SessionResource`](/docs/references/javascript/session).[`user`](/docs/references/javascript/session#user) | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`PendingSessionResource`\> - -#### Inherited from - -[`SessionResource`](/docs/references/javascript/session).[`reload`](/docs/references/javascript/session#reload) diff --git a/.typedoc/docs/types/protect-props.mdx b/.typedoc/docs/types/protect-props.mdx deleted file mode 100644 index caa5998e83e..00000000000 --- a/.typedoc/docs/types/protect-props.mdx +++ /dev/null @@ -1,22 +0,0 @@ -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/.typedoc/docs/types/record-to-path.mdx b/.typedoc/docs/types/record-to-path.mdx deleted file mode 100644 index d89089101d1..00000000000 --- a/.typedoc/docs/types/record-to-path.mdx +++ /dev/null @@ -1,4 +0,0 @@ -Used to construct a type union containing all the keys (even if nested) of an object defined as const -const obj = { a: { b: '' }, c: '' } as const; -type Paths = RecordToPath -Paths contains: 'a' | 'a.b' | 'c' diff --git a/.typedoc/docs/types/redirect-options.mdx b/.typedoc/docs/types/redirect-options.mdx deleted file mode 100644 index b505ddb60ce..00000000000 --- a/.typedoc/docs/types/redirect-options.mdx +++ /dev/null @@ -1,2 +0,0 @@ -Redirect URLs for different actions. -Mainly used to be used to type internal Clerk functions. diff --git a/.typedoc/docs/types/remove-payment-source-params.mdx b/.typedoc/docs/types/remove-payment-source-params.mdx deleted file mode 100644 index 62a2c1cba23..00000000000 --- a/.typedoc/docs/types/remove-payment-source-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/reverification-config.mdx b/.typedoc/docs/types/reverification-config.mdx deleted file mode 100644 index 7ca39c1bd5a..00000000000 --- a/.typedoc/docs/types/reverification-config.mdx +++ /dev/null @@ -1,10 +0,0 @@ -The `ReverificationConfig` type has the following properties: - -## Type declaration - -"strict" \| "strict_mfa" \| "moderate" \| "lax" - -| Name | Type | Description | -| -------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `afterMinutes` | `SessionVerificationAfterMinutes` | The age of the factor level to check for. Value should be greater than or equal to 1 and less than 99,999. | -| `level` | "first_factor" \| "second_factor" \| "multi_factor" | The reverification level of credentials to check for. | diff --git a/.typedoc/docs/types/saml-strategy.mdx b/.typedoc/docs/types/saml-strategy.mdx deleted file mode 100644 index a8f26d96d35..00000000000 --- a/.typedoc/docs/types/saml-strategy.mdx +++ /dev/null @@ -1,3 +0,0 @@ -## Deprecated - -Use `EnterpriseSSOStrategy` instead. diff --git a/.typedoc/docs/types/sdk-metadata.mdx b/.typedoc/docs/types/sdk-metadata.mdx deleted file mode 100644 index 42ddd4d54c3..00000000000 --- a/.typedoc/docs/types/sdk-metadata.mdx +++ /dev/null @@ -1,9 +0,0 @@ -> **SDKMetadata** = \{ environment?: string; name: string; version: string; \} - -## Properties - -| Property | Type | Description | -| --------------------------------------- | -------- | --------------------------------------------------------------------------- | -| `environment?` | `string` | Typically this will be the `NODE_ENV` that the SDK is currently running in. | -| `name` | `string` | The npm package name of the SDK. | -| `version` | `string` | The npm package version of the SDK. | diff --git a/.typedoc/docs/types/server-get-token-options.mdx b/.typedoc/docs/types/server-get-token-options.mdx deleted file mode 100644 index a63b221731b..00000000000 --- a/.typedoc/docs/types/server-get-token-options.mdx +++ /dev/null @@ -1,10 +0,0 @@ -> **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/.typedoc/docs/types/server-get-token.mdx b/.typedoc/docs/types/server-get-token.mdx deleted file mode 100644 index b0e14e560a8..00000000000 --- a/.typedoc/docs/types/server-get-token.mdx +++ /dev/null @@ -1,11 +0,0 @@ -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/.typedoc/docs/types/session-resource.mdx b/.typedoc/docs/types/session-resource.mdx deleted file mode 100644 index 2651cffa85b..00000000000 --- a/.typedoc/docs/types/session-resource.mdx +++ /dev/null @@ -1,43 +0,0 @@ -The `Session` object is an abstraction over an HTTP session. It models the period of information exchange between a user and the server. - -The `Session` object includes methods for recording session activity and ending the session client-side. For security reasons, sessions can also expire server-side. - -As soon as a [`User`](/docs/references/javascript/user) signs in, Clerk creates a `Session` for the current [`Client`](/docs/references/javascript/client). Clients can have more than one sessions at any point in time, but only one of those sessions will be **active**. - -In certain scenarios, a session might be replaced by another one. This is often the case with [multi-session applications](/docs/authentication/configuration/session-options#multi-session-applications). - -All sessions that are **expired**, **removed**, **replaced**, **ended** or **abandoned** are not considered valid. - -> [!NOTE] -> For more information regarding the different session states, see the [guide on session management](/docs/authentication/configuration/session-options). - -## Properties - -| Property | Type | Description | Overrides | -| ---------------------------------------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `end` | () => Promise\ | Marks the session as ended. The session will no longer be active for this `Client` and its status will become **ended**. | - | -| `factorVerificationAge` | null \| \[number, number\] | An array where each item represents the number of minutes since the last verification of a first or second factor: `[firstFactorAge, secondFactorAge]`. | - | -| `id` | `string` | The unique identifier for the session. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | -| `pathRoot` | `string` | The root path of the resource. | - | -| `status` | `SessionStatus` | The current state of the session. | - | -| `user` | null \| [UserResource](/docs/references/javascript/user) | The user associated with the session. | - | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`SessionResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/session-status-claim.mdx b/.typedoc/docs/types/session-status-claim.mdx deleted file mode 100644 index de597535472..00000000000 --- a/.typedoc/docs/types/session-status-claim.mdx +++ /dev/null @@ -1 +0,0 @@ -The current state of the session which can only be `active` or `pending`. diff --git a/.typedoc/docs/types/session-task.mdx b/.typedoc/docs/types/session-task.mdx deleted file mode 100644 index 12c0552a25e..00000000000 --- a/.typedoc/docs/types/session-task.mdx +++ /dev/null @@ -1,7 +0,0 @@ -Represents the current pending task of a session. - -## Properties - -| Property | Type | Description | -| ---------------------- | ----------------------- | -------------------------------- | -| `key` | `"choose-organization"` | A unique identifier for the task | diff --git a/.typedoc/docs/types/session-verification-level.mdx b/.typedoc/docs/types/session-verification-level.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/session-verification-types.mdx b/.typedoc/docs/types/session-verification-types.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/set-active-params.mdx b/.typedoc/docs/types/set-active-params.mdx deleted file mode 100644 index 4bd93404d67..00000000000 --- a/.typedoc/docs/types/set-active-params.mdx +++ /dev/null @@ -1,11 +0,0 @@ -The parameters for the `setActive()` method. - -## Properties - -| Property | Type | Description | -| ----------------------------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ~~`beforeEmit?`~~ | `BeforeEmitCallback` | **Deprecated.** Use `redirectUrl` instead. Callback run just before the active session and/or organization is set to the passed object. Can be used to set up for pre-navigation actions. | -| `navigate?` | `SetActiveNavigate` | A custom navigation function to be called just before the session and/or organization is set. When provided, it takes precedence over the `redirectUrl` parameter for navigation. Example: `await clerk.setActive({ session, navigate: async ({ session }) => { const currentTask = session.currentTask; if (currentTask) { await router.push(`./onboarding/${currentTask.key}`) return } router.push('/dashboard'); } });` | -| `organization?` | null \| string \| [OrganizationResource](/docs/references/javascript/organization) | The organization resource or organization ID/slug (string version) to be set as active in the current session. If `null`, the currently active organization is removed as active. | -| `redirectUrl?` | `string` | The full URL or path to redirect to just before the session and/or organization is set. | -| `session?` | null \| string \| [SignedInSessionResource](/docs/references/javascript/session) | The session resource or session ID (string version) to be set as active. If `null`, the current session is deleted. | diff --git a/.typedoc/docs/types/set-active.mdx b/.typedoc/docs/types/set-active.mdx deleted file mode 100644 index ab8cbd7d5c5..00000000000 --- a/.typedoc/docs/types/set-active.mdx +++ /dev/null @@ -1,9 +0,0 @@ -## Parameters - -| Parameter | Type | -| ----------------- | ------------------------------------------ | -| `setActiveParams` | [`SetActiveParams`](set-active-params.mdx) | - -## Returns - -`Promise`\<`void`\> diff --git a/.typedoc/docs/types/sign-in-resource.mdx b/.typedoc/docs/types/sign-in-resource.mdx deleted file mode 100644 index e6aa39d2aa5..00000000000 --- a/.typedoc/docs/types/sign-in-resource.mdx +++ /dev/null @@ -1,30 +0,0 @@ -The `SignIn` object holds the state of the current sign-in and provides helper methods to navigate and complete the sign-in process. It is used to manage the sign-in lifecycle, including the first and second factor verification, and the creation of a new session. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------------------ | --------------------------------- | ------------------------------------------------------------------------- | -| `id?` | `string` | The unique identifier of the resource. | -| `pathRoot` | `string` | The root path of the resource. | -| `status` | null \| SignInStatus | The current status of the sign-in. | -| ~~`supportedIdentifiers`~~ | SignInIdentifier[] | **Deprecated.** This attribute will be removed in the next major version. | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`SignInResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/sign-out.mdx b/.typedoc/docs/types/sign-out.mdx deleted file mode 100644 index 2ec222553cb..00000000000 --- a/.typedoc/docs/types/sign-out.mdx +++ /dev/null @@ -1,24 +0,0 @@ -## Call Signature - -### Parameters - -| Parameter | Type | -| ---------- | ---------------- | -| `options?` | `SignOutOptions` | - -### Returns - -`Promise`\<`void`\> - -## Call Signature - -### Parameters - -| Parameter | Type | -| ------------------ | ----------------- | -| `signOutCallback?` | `SignOutCallback` | -| `options?` | `SignOutOptions` | - -### Returns - -`Promise`\<`void`\> diff --git a/.typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx b/.typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx deleted file mode 100644 index 2ad5ab70fe0..00000000000 --- a/.typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx +++ /dev/null @@ -1,3 +0,0 @@ -## Deprecated - -Use `SignUpAuthenticateWithWeb3Params` instead. diff --git a/.typedoc/docs/types/sign-up-resource.mdx b/.typedoc/docs/types/sign-up-resource.mdx deleted file mode 100644 index 46d56bca3dc..00000000000 --- a/.typedoc/docs/types/sign-up-resource.mdx +++ /dev/null @@ -1,29 +0,0 @@ -The `SignUp` object holds the state of the current sign-up and provides helper methods to navigate and complete the sign-up process. Once a sign-up is complete, a new user is created. - -## Properties - -| Property | Type | Description | -| -------------------------------- | --------------------------------- | -------------------------------------- | -| `id?` | `string` | The unique identifier of the resource. | -| `pathRoot` | `string` | The root path of the resource. | -| `status` | null \| SignUpStatus | The current status of the sign-up. | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`SignUpResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/signed-in-session-resource.mdx b/.typedoc/docs/types/signed-in-session-resource.mdx deleted file mode 100644 index a682dc8b4d8..00000000000 --- a/.typedoc/docs/types/signed-in-session-resource.mdx +++ /dev/null @@ -1,2 +0,0 @@ -Represents session resources for users who have completed -the full sign-in flow diff --git a/.typedoc/docs/types/state-selectors.mdx b/.typedoc/docs/types/state-selectors.mdx deleted file mode 100644 index cecc110aacf..00000000000 --- a/.typedoc/docs/types/state-selectors.mdx +++ /dev/null @@ -1 +0,0 @@ -Create a type union of all state + id combinations diff --git a/.typedoc/docs/types/telemetry-log-entry.mdx b/.typedoc/docs/types/telemetry-log-entry.mdx deleted file mode 100644 index 4b91f4af44f..00000000000 --- a/.typedoc/docs/types/telemetry-log-entry.mdx +++ /dev/null @@ -1 +0,0 @@ -Debug log entry interface for telemetry collector diff --git a/.typedoc/docs/types/use-auth-return.mdx b/.typedoc/docs/types/use-auth-return.mdx deleted file mode 100644 index 10bb56dd987..00000000000 --- a/.typedoc/docs/types/use-auth-return.mdx +++ /dev/null @@ -1,61 +0,0 @@ -## Type declaration - -| Name | Type | Description | -| --------------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `actor` | `undefined` | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | -| `getToken` | [`GetToken`](get-token.mdx) | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | -| `has` | \{ \} | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | -| `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. | -| `orgId` | `undefined` | The ID of the user's active organization. | -| `orgRole` | `undefined` | The current user's role in their active organization. | -| `orgSlug` | `undefined` | The URL-friendly identifier of the user's active organization. | -| `sessionClaims` | `undefined` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | -| `sessionId` | `undefined` | The ID for the current session. | -| `signOut` | [`SignOut`](sign-out.mdx) | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | -| `userId` | `undefined` | The ID of the current user. | - -| Name | Type | -| --------------- | ------------------------------ | -| `actor` | `null` | -| `getToken` | [`GetToken`](get-token.mdx) | -| `has()` | (params) => false | -| `isLoaded` | `true` | -| `isSignedIn` | `false` | -| `orgId` | `null` | -| `orgRole` | `null` | -| `orgSlug` | `null` | -| `sessionClaims` | `null` | -| `sessionId` | `null` | -| `signOut` | [`SignOut`](sign-out.mdx) | -| `userId` | `null` | - -| Name | Type | -| --------------- | -------------------------------------------------------------------------------------------- | -| `actor` | [ActClaim](act-claim.mdx) \| null | -| `getToken` | [`GetToken`](get-token.mdx) | -| `has` | [`CheckAuthorizationWithCustomPermissions`](check-authorization-with-custom-permissions.mdx) | -| `isLoaded` | `true` | -| `isSignedIn` | `true` | -| `orgId` | `null` | -| `orgRole` | `null` | -| `orgSlug` | `null` | -| `sessionClaims` | `JwtPayload` | -| `sessionId` | `string` | -| `signOut` | [`SignOut`](sign-out.mdx) | -| `userId` | `string` | - -| Name | Type | -| --------------- | -------------------------------------------------------------------------------------------- | -| `actor` | [ActClaim](act-claim.mdx) \| null | -| `getToken` | [`GetToken`](get-token.mdx) | -| `has` | [`CheckAuthorizationWithCustomPermissions`](check-authorization-with-custom-permissions.mdx) | -| `isLoaded` | `true` | -| `isSignedIn` | `true` | -| `orgId` | `string` | -| `orgRole` | [`OrganizationCustomRoleKey`](organization-custom-role-key.mdx) | -| `orgSlug` | string \| null | -| `sessionClaims` | `JwtPayload` | -| `sessionId` | `string` | -| `signOut` | [`SignOut`](sign-out.mdx) | -| `userId` | `string` | diff --git a/.typedoc/docs/types/use-session-list-return.mdx b/.typedoc/docs/types/use-session-list-return.mdx deleted file mode 100644 index d5e0943a356..00000000000 --- a/.typedoc/docs/types/use-session-list-return.mdx +++ /dev/null @@ -1,13 +0,0 @@ -## Type declaration - -| Name | Type | Description | -| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `sessions` | `undefined` | A list of sessions that have been registered on the client device. | -| `setActive` | `undefined` | A function that sets the active session and/or organization. | - -| Name | Type | -| ----------- | --------------------------------------------------------------------- | -| `isLoaded` | `true` | -| `sessions` | [SessionResource](/docs/references/javascript/session)[] | -| `setActive` | [`SetActive`](set-active.mdx) | diff --git a/.typedoc/docs/types/use-session-return.mdx b/.typedoc/docs/types/use-session-return.mdx deleted file mode 100644 index 58f615aad81..00000000000 --- a/.typedoc/docs/types/use-session-return.mdx +++ /dev/null @@ -1,19 +0,0 @@ -## Type declaration - -| Name | Type | Description | -| ------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------ | -| `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 session for the user. | - -| Name | Type | -| ------------ | ------- | -| `isLoaded` | `true` | -| `isSignedIn` | `false` | -| `session` | `null` | - -| Name | Type | -| ------------ | ---------------------------------------------------------------- | -| `isLoaded` | `true` | -| `isSignedIn` | `boolean` | -| `session` | [`SignedInSessionResource`](/docs/references/javascript/session) | diff --git a/.typedoc/docs/types/use-sign-in-return.mdx b/.typedoc/docs/types/use-sign-in-return.mdx deleted file mode 100644 index 5da1828dd90..00000000000 --- a/.typedoc/docs/types/use-sign-in-return.mdx +++ /dev/null @@ -1,13 +0,0 @@ -## Type declaration - -| Name | Type | Description | -| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `setActive` | `undefined` | A function that sets the active session. | -| `signIn` | `undefined` | An object that contains the current sign-in attempt status and methods to create a new sign-in attempt. | - -| Name | Type | -| ----------- | ---------------------------------------- | -| `isLoaded` | `true` | -| `setActive` | [`SetActive`](set-active.mdx) | -| `signIn` | [`SignInResource`](sign-in-resource.mdx) | diff --git a/.typedoc/docs/types/use-sign-up-return.mdx b/.typedoc/docs/types/use-sign-up-return.mdx deleted file mode 100644 index df2caffca81..00000000000 --- a/.typedoc/docs/types/use-sign-up-return.mdx +++ /dev/null @@ -1,13 +0,0 @@ -## Type declaration - -| Name | Type | Description | -| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `setActive` | `undefined` | A function that sets the active session. | -| `signUp` | `undefined` | An object that contains the current sign-up attempt status and methods to create a new sign-up attempt. | - -| Name | Type | -| ----------- | ------------------------------------------------------- | -| `isLoaded` | `true` | -| `setActive` | [`SetActive`](set-active.mdx) | -| `signUp` | [`SignUpResource`](/docs/references/javascript/sign-up) | diff --git a/.typedoc/docs/types/use-user-return.mdx b/.typedoc/docs/types/use-user-return.mdx deleted file mode 100644 index 960725f16ab..00000000000 --- a/.typedoc/docs/types/use-user-return.mdx +++ /dev/null @@ -1,19 +0,0 @@ -## Type declaration - -| Name | Type | Description | -| ------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `isSignedIn` | `undefined` | A boolean that returns `true` if the user is signed in. | -| `user` | `undefined` | The `User` object for the current user. | - -| Name | Type | -| ------------ | ------- | -| `isLoaded` | `true` | -| `isSignedIn` | `false` | -| `user` | `null` | - -| Name | Type | -| ------------ | -------------------------------------------------- | -| `isLoaded` | `true` | -| `isSignedIn` | `true` | -| `user` | [`UserResource`](/docs/references/javascript/user) | diff --git a/.typedoc/docs/types/user-organization-invitation-resource.mdx b/.typedoc/docs/types/user-organization-invitation-resource.mdx deleted file mode 100644 index 78976cef403..00000000000 --- a/.typedoc/docs/types/user-organization-invitation-resource.mdx +++ /dev/null @@ -1,28 +0,0 @@ -The `OrganizationInvitation` object is the model around an organization invitation. - -## 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. | - | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`UserOrganizationInvitationResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/user-resource.mdx b/.typedoc/docs/types/user-resource.mdx deleted file mode 100644 index 385cf6b9539..00000000000 --- a/.typedoc/docs/types/user-resource.mdx +++ /dev/null @@ -1,38 +0,0 @@ -The `User` object holds all of the information for a single user of your application and provides a set of methods to manage their account. Each `User` has at least one authentication [identifier](/docs/authentication/configuration/sign-up-sign-in-options#identifiers), which might be their email address, phone number, or a username. - -A user can be contacted at their primary email address or primary phone number. They can have more than one registered email address, but only one of them will be their primary email address. This goes for phone numbers as well; a user can have more than one, but only one phone number will be their primary. At the same time, a user can also have one or more external accounts by connecting to [social providers](/docs/authentication/social-connections/oauth) such as Google, Apple, Facebook, and many more. - -Finally, a `User` object holds profile data like the user's name, profile picture, and a set of [metadata](/docs/users/metadata) that can be used internally to store arbitrary information. The metadata are split into `publicMetadata` and `privateMetadata`. Both types are set from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}, but public metadata can also be accessed from the [Frontend API](/docs/reference/frontend-api){{ target: '_blank' }}. - -The ClerkJS SDK provides some helper [methods](#methods) on the `User` object to help retrieve and update user information and authentication status. - -## Properties - -| 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 - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`UserResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/without.mdx b/.typedoc/docs/types/without.mdx deleted file mode 100644 index a4185e8e647..00000000000 --- a/.typedoc/docs/types/without.mdx +++ /dev/null @@ -1 +0,0 @@ -Omit without union flattening From b0378799472eaf1ce1fa829bb653c8890170f991 Mon Sep 17 00:00:00 2001 From: panteliselef Date: Wed, 27 Aug 2025 22:31:42 +0300 Subject: [PATCH 06/22] typedoc files --- .gitignore | 2 +- .prettierignore | 1 + .../docs/backend/allowlist-identifier.mdx | 13 + .typedoc/docs/backend/auth-object.mdx | 8 + .../backend/authenticate-request-options.mdx | 24 ++ .typedoc/docs/backend/client.mdx | 14 + ...rce-payment-attempt-webhook-event-json.mdx | 8 + .typedoc/docs/backend/commerce-plan-json.mdx | 24 ++ .typedoc/docs/backend/commerce-plan.mdx | 68 ++++ .../commerce-subscription-item-json.mdx | 27 ++ ...e-subscription-item-webhook-event-json.mdx | 8 + .../backend/commerce-subscription-item.mdx | 74 ++++ ...mmerce-subscription-webhook-event-json.mdx | 8 + .../docs/backend/commerce-subscription.mdx | 60 ++++ .typedoc/docs/backend/email-address.mdx | 14 + .typedoc/docs/backend/external-account.mdx | 22 ++ .typedoc/docs/backend/get-auth-fn.mdx | 101 ++++++ .typedoc/docs/backend/identification-link.mdx | 8 + .../infer-auth-object-from-token-array.mdx | 5 + .../backend/infer-auth-object-from-token.mdx | 2 + .typedoc/docs/backend/invitation-status.mdx | 0 .typedoc/docs/backend/invitation.mdx | 14 + .typedoc/docs/backend/o-auth-application.mdx | 26 ++ .../organization-invitation-status.mdx | 0 .../docs/backend/organization-invitation.mdx | 19 + ...ganization-membership-public-user-data.mdx | 8 + .../docs/backend/organization-membership.mdx | 15 + .../backend/organization-sync-options.mdx | 8 + .../docs/backend/organization-sync-target.mdx | 2 + .typedoc/docs/backend/organization.mdx | 19 + .../backend/paginated-resource-response.mdx | 14 + .typedoc/docs/backend/phone-number.mdx | 16 + .../backend/public-organization-data-json.mdx | 8 + .typedoc/docs/backend/redirect-url.mdx | 12 + .typedoc/docs/backend/saml-account.mdx | 15 + .typedoc/docs/backend/saml-connection.mdx | 27 ++ .typedoc/docs/backend/session-activity.mdx | 14 + .typedoc/docs/backend/session.mdx | 18 + .typedoc/docs/backend/user.mdx | 47 +++ .typedoc/docs/backend/verification.mdx | 13 + .../backend/verify-machine-auth-token.mdx | 12 + .../docs/backend/verify-token-options.mdx | 11 + .typedoc/docs/backend/verify-token.mdx | 91 +++++ .../docs/backend/verify-webhook-options.mdx | 7 + .typedoc/docs/backend/verify-webhook.mdx | 42 +++ .typedoc/docs/backend/web3-wallet.mdx | 11 + .typedoc/docs/clerk-react/api-keys.mdx | 19 + .../docs/clerk-react/clerk-provider-props.mdx | 43 +++ .typedoc/docs/clerk-react/protect.mdx | 21 ++ .../redirect-to-create-organization.mdx | 13 + .../redirect-to-organization-profile.mdx | 13 + .../clerk-react/redirect-to-user-profile.mdx | 13 + .typedoc/docs/clerk-react/use-auth.mdx | 176 ++++++++++ .typedoc/docs/clerk-react/use-clerk.mdx | 43 +++ .../clerk-react/use-organization-list.mdx | 150 ++++++++ .../docs/clerk-react/use-organization.mdx | 130 +++++++ .../docs/clerk-react/use-reverification.mdx | 55 +++ .../docs/clerk-react/use-session-list.mdx | 77 ++++ .typedoc/docs/clerk-react/use-session.mdx | 98 ++++++ .typedoc/docs/clerk-react/use-sign-in.mdx | 73 ++++ .typedoc/docs/clerk-react/use-sign-up.mdx | 73 ++++ .typedoc/docs/clerk-react/use-user.mdx | 211 +++++++++++ .typedoc/docs/nextjs/auth.mdx | 5 + .typedoc/docs/nextjs/build-clerk-props.mdx | 38 ++ .../nextjs/clerk-middleware-auth-object.mdx | 3 + .../docs/nextjs/clerk-middleware-options.mdx | 29 ++ .typedoc/docs/nextjs/clerk-middleware.mdx | 1 + .../docs/nextjs/create-async-get-auth.mdx | 23 ++ .typedoc/docs/nextjs/create-sync-get-auth.mdx | 24 ++ .typedoc/docs/nextjs/current-user.mdx | 25 ++ .typedoc/docs/nextjs/get-auth.mdx | 86 +++++ .../shared/api-url-from-publishable-key.mdx | 11 + .../build-clerk-js-script-attributes.mdx | 11 + .../docs/shared/build-publishable-key.mdx | 11 + .typedoc/docs/shared/camel-to-snake.mdx | 11 + .typedoc/docs/shared/clerk-js-script-url.mdx | 18 + .typedoc/docs/shared/clerk-runtime-error.mdx | 26 ++ .../create-dev-or-staging-url-cache.mdx | 10 + .typedoc/docs/shared/create-path-matcher.mdx | 21 ++ .typedoc/docs/shared/deep-camel-to-snake.mdx | 13 + .typedoc/docs/shared/deep-snake-to-camel.mdx | 13 + .../shared/deprecated-object-property.mdx | 21 ++ .typedoc/docs/shared/derive-state.mdx | 29 ++ .../extract-dev-browser-jwt-from-url.mdx | 13 + .../shared/fast-deep-merge-and-replace.mdx | 14 + .../get-clerk-js-major-version-or-tag.mdx | 14 + .typedoc/docs/shared/get-cookie-suffix.mdx | 13 + .typedoc/docs/shared/get-env-variable.mdx | 12 + .../docs/shared/get-non-undefined-values.mdx | 11 + .typedoc/docs/shared/get-script-url.mdx | 14 + .../docs/shared/get-suffixed-cookie-name.mdx | 13 + .typedoc/docs/shared/icon-image-url.mdx | 13 + .typedoc/docs/shared/in-browser.mdx | 5 + .typedoc/docs/shared/is-browser-online.mdx | 5 + .../docs/shared/is-clerk-runtime-error.mdx | 24 ++ .../is-development-from-publishable-key.mdx | 12 + .../shared/is-development-from-secret-key.mdx | 12 + .typedoc/docs/shared/is-ipv4-address.mdx | 11 + .../is-production-from-publishable-key.mdx | 12 + .../shared/is-production-from-secret-key.mdx | 12 + .typedoc/docs/shared/is-publishable-key.mdx | 11 + .typedoc/docs/shared/is-staging.mdx | 11 + .typedoc/docs/shared/is-truthy.mdx | 11 + .../docs/shared/is-valid-browser-online.mdx | 5 + .typedoc/docs/shared/is-valid-browser.mdx | 5 + .typedoc/docs/shared/isomorphic-atob.mdx | 12 + .typedoc/docs/shared/load-clerk-js-script.mdx | 26 ++ .../docs/shared/pages-or-infinite-options.mdx | 4 + .../docs/shared/paginated-hook-config.mdx | 4 + .typedoc/docs/shared/paginated-resources.mdx | 17 + .../docs/shared/parse-publishable-key.mdx | 47 +++ .typedoc/docs/shared/read-json-file.mdx | 14 + ...et-clerk-js-loading-error-package-name.mdx | 17 + .typedoc/docs/shared/snake-to-camel.mdx | 11 + .typedoc/docs/shared/titleize.mdx | 17 + .typedoc/docs/shared/to-sentence.mdx | 11 + .typedoc/docs/shared/use-clerk.mdx | 43 +++ .../shared/use-organization-list-params.mdx | 5 + .../shared/use-organization-list-return.mdx | 8 + .../docs/shared/use-organization-list.mdx | 150 ++++++++ .../docs/shared/use-organization-params.mdx | 7 + .../docs/shared/use-organization-return.mdx | 10 + .typedoc/docs/shared/use-organization.mdx | 130 +++++++ .typedoc/docs/shared/use-reverification.mdx | 55 +++ .typedoc/docs/shared/use-session-list.mdx | 77 ++++ .typedoc/docs/shared/use-session.mdx | 98 ++++++ .typedoc/docs/shared/use-user.mdx | 211 +++++++++++ .typedoc/docs/shared/user-agent-is-robot.mdx | 11 + .typedoc/docs/shared/version-selector.mdx | 17 + .typedoc/docs/types/act-claim.mdx | 1 + .typedoc/docs/types/act-jwt-claim.mdx | 5 + .../docs/types/active-session-resource.mdx | 33 ++ .../docs/types/add-payment-source-params.mdx | 10 + .../docs/types/cancel-subscription-params.mdx | 10 + .../docs/types/check-authorization-fn.mdx | 9 + ...heck-authorization-from-session-claims.mdx | 13 + ...thorization-params-from-session-claims.mdx | 9 + ...-authorization-with-custom-permissions.mdx | 0 .typedoc/docs/types/clerk-api-error.mdx | 24 ++ .../docs/types/clerk-api-response-error.mdx | 1 + .typedoc/docs/types/clerk-host-router.mdx | 1 + .typedoc/docs/types/clerk-jwt-claims.mdx | 28 ++ .../docs/types/clerk-paginated-response.mdx | 11 + .../docs/types/clerk-pagination-params.mdx | 6 + .../docs/types/clerk-pagination-request.mdx | 8 + .typedoc/docs/types/clerk-resource.mdx | 24 ++ .typedoc/docs/types/clerk-status.mdx | 0 .typedoc/docs/types/clerk.mdx | 332 ++++++++++++++++++ .../docs/types/commerce-billing-namespace.mdx | 24 ++ .../docs/types/commerce-checkout-json.mdx | 27 ++ .../docs/types/commerce-checkout-resource.mdx | 48 +++ .../types/commerce-checkout-totals-json.mdx | 20 ++ .../docs/types/commerce-checkout-totals.mdx | 21 ++ .typedoc/docs/types/commerce-feature-json.mdx | 21 ++ .../docs/types/commerce-feature-resource.mdx | 42 +++ ...mmerce-initialized-payment-source-json.mdx | 20 ++ ...ce-initialized-payment-source-resource.mdx | 40 +++ .../docs/types/commerce-money-amount-json.mdx | 19 + .typedoc/docs/types/commerce-money-amount.mdx | 19 + .../types/commerce-payer-resource-type.mdx | 10 + .../types/commerce-payment-charge-type.mdx | 10 + .typedoc/docs/types/commerce-payment-json.mdx | 26 ++ .../docs/types/commerce-payment-resource.mdx | 46 +++ .../types/commerce-payment-source-json.mdx | 24 ++ .../types/commerce-payment-source-methods.mdx | 18 + .../commerce-payment-source-resource.mdx | 46 +++ .../types/commerce-payment-source-status.mdx | 10 + .../docs/types/commerce-payment-status.mdx | 10 + .typedoc/docs/types/commerce-plan-json.mdx | 40 +++ .../docs/types/commerce-plan-resource.mdx | 52 +++ .typedoc/docs/types/commerce-product-json.mdx | 21 ++ .../docs/types/commerce-product-resource.mdx | 41 +++ .../types/commerce-statement-group-json.mdx | 19 + .../docs/types/commerce-statement-group.mdx | 17 + .../docs/types/commerce-statement-json.mdx | 21 ++ .../types/commerce-statement-resource.mdx | 41 +++ .../docs/types/commerce-statement-status.mdx | 10 + .../types/commerce-statement-totals-json.mdx | 19 + .../docs/types/commerce-statement-totals.mdx | 20 ++ .../types/commerce-subscription-item-json.mdx | 30 ++ .../commerce-subscription-item-resource.mdx | 51 +++ .../docs/types/commerce-subscription-json.mdx | 27 ++ .../commerce-subscription-plan-period.mdx | 10 + .../types/commerce-subscription-resource.mdx | 45 +++ .../types/commerce-subscription-status.mdx | 10 + .../docs/types/confirm-checkout-params.mdx | 10 + .../docs/types/create-checkout-params.mdx | 10 + .../docs/types/create-organization-params.mdx | 4 + .typedoc/docs/types/element-object-key.mdx | 1 + .typedoc/docs/types/elements-config.mdx | 3 + .../experimental_checkout-button-props.mdx | 23 ++ ...experimental_plan-details-button-props.mdx | 22 ++ ...ntal_subscription-details-button-props.mdx | 23 ++ .typedoc/docs/types/for-payer-type.mdx | 10 + .../types/get-payment-attempts-params.mdx | 10 + .../docs/types/get-payment-sources-params.mdx | 10 + .typedoc/docs/types/get-plans-params.mdx | 10 + .typedoc/docs/types/get-statements-params.mdx | 10 + .../docs/types/get-subscription-params.mdx | 10 + .../docs/types/get-subscriptions-params.mdx | 10 + .typedoc/docs/types/get-token.mdx | 9 + .typedoc/docs/types/id-selectors.mdx | 1 + .../initialize-payment-source-params.mdx | 10 + .../docs/types/internal_checkout-props.mdx | 23 ++ .../types/internal_plan-details-props.mdx | 24 ++ .../internal_subscription-details-props.mdx | 23 ++ .typedoc/docs/types/jwt-claims.mdx | 27 ++ .typedoc/docs/types/jwt-header.mdx | 3 + .typedoc/docs/types/legacy-redirect-props.mdx | 13 + .typedoc/docs/types/localization-resource.mdx | 13 + .../make-default-payment-source-params.mdx | 10 + .../docs/types/multi-domain-and-or-proxy.mdx | 26 ++ .../types/organization-custom-role-key.mdx | 3 + .../types/organization-domain-resource.mdx | 28 ++ ...rganization-domain-verification-status.mdx | 0 .../types/organization-enrollment-mode.mdx | 0 .../organization-invitation-resource.mdx | 28 ++ .../types/organization-invitation-status.mdx | 0 ...ganization-membership-request-resource.mdx | 28 ++ .../organization-membership-resource.mdx | 28 ++ .../types/organization-permission-key.mdx | 2 + .typedoc/docs/types/organization-resource.mdx | 34 ++ .../organization-suggestion-resource.mdx | 28 ++ .../types/organization-suggestion-status.mdx | 0 .../docs/types/organizations-jwt-claim.mdx | 3 + .typedoc/docs/types/override.mdx | 4 + .typedoc/docs/types/path-value.mdx | 4 + .typedoc/docs/types/payment-gateway.mdx | 10 + .../docs/types/pending-session-options.mdx | 7 + .../docs/types/pending-session-resource.mdx | 32 ++ .typedoc/docs/types/protect-props.mdx | 22 ++ .typedoc/docs/types/record-to-path.mdx | 4 + .typedoc/docs/types/redirect-options.mdx | 2 + .../types/remove-payment-source-params.mdx | 10 + .typedoc/docs/types/reverification-config.mdx | 10 + .typedoc/docs/types/saml-strategy.mdx | 3 + .typedoc/docs/types/sdk-metadata.mdx | 9 + .../docs/types/server-get-token-options.mdx | 10 + .typedoc/docs/types/server-get-token.mdx | 11 + .typedoc/docs/types/session-resource.mdx | 43 +++ .typedoc/docs/types/session-status-claim.mdx | 1 + .typedoc/docs/types/session-task.mdx | 7 + .../docs/types/session-verification-level.mdx | 0 .../docs/types/session-verification-types.mdx | 0 .typedoc/docs/types/set-active-params.mdx | 11 + .typedoc/docs/types/set-active.mdx | 9 + .typedoc/docs/types/sign-in-resource.mdx | 30 ++ .typedoc/docs/types/sign-out.mdx | 24 ++ ...n-up-authenticate-with-metamask-params.mdx | 3 + .typedoc/docs/types/sign-up-resource.mdx | 29 ++ .../docs/types/signed-in-session-resource.mdx | 2 + .typedoc/docs/types/state-selectors.mdx | 1 + .typedoc/docs/types/telemetry-log-entry.mdx | 1 + .typedoc/docs/types/use-auth-return.mdx | 61 ++++ .../docs/types/use-session-list-return.mdx | 13 + .typedoc/docs/types/use-session-return.mdx | 19 + .typedoc/docs/types/use-sign-in-return.mdx | 13 + .typedoc/docs/types/use-sign-up-return.mdx | 13 + .typedoc/docs/types/use-user-return.mdx | 19 + .../user-organization-invitation-resource.mdx | 28 ++ .typedoc/docs/types/user-resource.mdx | 38 ++ .typedoc/docs/types/without.mdx | 1 + 262 files changed, 6385 insertions(+), 1 deletion(-) create mode 100644 .typedoc/docs/backend/allowlist-identifier.mdx create mode 100644 .typedoc/docs/backend/auth-object.mdx create mode 100644 .typedoc/docs/backend/authenticate-request-options.mdx create mode 100644 .typedoc/docs/backend/client.mdx create mode 100644 .typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx create mode 100644 .typedoc/docs/backend/commerce-plan-json.mdx create mode 100644 .typedoc/docs/backend/commerce-plan.mdx create mode 100644 .typedoc/docs/backend/commerce-subscription-item-json.mdx create mode 100644 .typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx create mode 100644 .typedoc/docs/backend/commerce-subscription-item.mdx create mode 100644 .typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx create mode 100644 .typedoc/docs/backend/commerce-subscription.mdx create mode 100644 .typedoc/docs/backend/email-address.mdx create mode 100644 .typedoc/docs/backend/external-account.mdx create mode 100644 .typedoc/docs/backend/get-auth-fn.mdx create mode 100644 .typedoc/docs/backend/identification-link.mdx create mode 100644 .typedoc/docs/backend/infer-auth-object-from-token-array.mdx create mode 100644 .typedoc/docs/backend/infer-auth-object-from-token.mdx create mode 100644 .typedoc/docs/backend/invitation-status.mdx create mode 100644 .typedoc/docs/backend/invitation.mdx create mode 100644 .typedoc/docs/backend/o-auth-application.mdx create mode 100644 .typedoc/docs/backend/organization-invitation-status.mdx create mode 100644 .typedoc/docs/backend/organization-invitation.mdx create mode 100644 .typedoc/docs/backend/organization-membership-public-user-data.mdx create mode 100644 .typedoc/docs/backend/organization-membership.mdx create mode 100644 .typedoc/docs/backend/organization-sync-options.mdx create mode 100644 .typedoc/docs/backend/organization-sync-target.mdx create mode 100644 .typedoc/docs/backend/organization.mdx create mode 100644 .typedoc/docs/backend/paginated-resource-response.mdx create mode 100644 .typedoc/docs/backend/phone-number.mdx create mode 100644 .typedoc/docs/backend/public-organization-data-json.mdx create mode 100644 .typedoc/docs/backend/redirect-url.mdx create mode 100644 .typedoc/docs/backend/saml-account.mdx create mode 100644 .typedoc/docs/backend/saml-connection.mdx create mode 100644 .typedoc/docs/backend/session-activity.mdx create mode 100644 .typedoc/docs/backend/session.mdx create mode 100644 .typedoc/docs/backend/user.mdx create mode 100644 .typedoc/docs/backend/verification.mdx create mode 100644 .typedoc/docs/backend/verify-machine-auth-token.mdx create mode 100644 .typedoc/docs/backend/verify-token-options.mdx create mode 100644 .typedoc/docs/backend/verify-token.mdx create mode 100644 .typedoc/docs/backend/verify-webhook-options.mdx create mode 100644 .typedoc/docs/backend/verify-webhook.mdx create mode 100644 .typedoc/docs/backend/web3-wallet.mdx create mode 100644 .typedoc/docs/clerk-react/api-keys.mdx create mode 100644 .typedoc/docs/clerk-react/clerk-provider-props.mdx create mode 100644 .typedoc/docs/clerk-react/protect.mdx create mode 100644 .typedoc/docs/clerk-react/redirect-to-create-organization.mdx create mode 100644 .typedoc/docs/clerk-react/redirect-to-organization-profile.mdx create mode 100644 .typedoc/docs/clerk-react/redirect-to-user-profile.mdx create mode 100644 .typedoc/docs/clerk-react/use-auth.mdx create mode 100644 .typedoc/docs/clerk-react/use-clerk.mdx create mode 100644 .typedoc/docs/clerk-react/use-organization-list.mdx create mode 100644 .typedoc/docs/clerk-react/use-organization.mdx create mode 100644 .typedoc/docs/clerk-react/use-reverification.mdx create mode 100644 .typedoc/docs/clerk-react/use-session-list.mdx create mode 100644 .typedoc/docs/clerk-react/use-session.mdx create mode 100644 .typedoc/docs/clerk-react/use-sign-in.mdx create mode 100644 .typedoc/docs/clerk-react/use-sign-up.mdx create mode 100644 .typedoc/docs/clerk-react/use-user.mdx create mode 100644 .typedoc/docs/nextjs/auth.mdx create mode 100644 .typedoc/docs/nextjs/build-clerk-props.mdx create mode 100644 .typedoc/docs/nextjs/clerk-middleware-auth-object.mdx create mode 100644 .typedoc/docs/nextjs/clerk-middleware-options.mdx create mode 100644 .typedoc/docs/nextjs/clerk-middleware.mdx create mode 100644 .typedoc/docs/nextjs/create-async-get-auth.mdx create mode 100644 .typedoc/docs/nextjs/create-sync-get-auth.mdx create mode 100644 .typedoc/docs/nextjs/current-user.mdx create mode 100644 .typedoc/docs/nextjs/get-auth.mdx create mode 100644 .typedoc/docs/shared/api-url-from-publishable-key.mdx create mode 100644 .typedoc/docs/shared/build-clerk-js-script-attributes.mdx create mode 100644 .typedoc/docs/shared/build-publishable-key.mdx create mode 100644 .typedoc/docs/shared/camel-to-snake.mdx create mode 100644 .typedoc/docs/shared/clerk-js-script-url.mdx create mode 100644 .typedoc/docs/shared/clerk-runtime-error.mdx create mode 100644 .typedoc/docs/shared/create-dev-or-staging-url-cache.mdx create mode 100644 .typedoc/docs/shared/create-path-matcher.mdx create mode 100644 .typedoc/docs/shared/deep-camel-to-snake.mdx create mode 100644 .typedoc/docs/shared/deep-snake-to-camel.mdx create mode 100644 .typedoc/docs/shared/deprecated-object-property.mdx create mode 100644 .typedoc/docs/shared/derive-state.mdx create mode 100644 .typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx create mode 100644 .typedoc/docs/shared/fast-deep-merge-and-replace.mdx create mode 100644 .typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx create mode 100644 .typedoc/docs/shared/get-cookie-suffix.mdx create mode 100644 .typedoc/docs/shared/get-env-variable.mdx create mode 100644 .typedoc/docs/shared/get-non-undefined-values.mdx create mode 100644 .typedoc/docs/shared/get-script-url.mdx create mode 100644 .typedoc/docs/shared/get-suffixed-cookie-name.mdx create mode 100644 .typedoc/docs/shared/icon-image-url.mdx create mode 100644 .typedoc/docs/shared/in-browser.mdx create mode 100644 .typedoc/docs/shared/is-browser-online.mdx create mode 100644 .typedoc/docs/shared/is-clerk-runtime-error.mdx create mode 100644 .typedoc/docs/shared/is-development-from-publishable-key.mdx create mode 100644 .typedoc/docs/shared/is-development-from-secret-key.mdx create mode 100644 .typedoc/docs/shared/is-ipv4-address.mdx create mode 100644 .typedoc/docs/shared/is-production-from-publishable-key.mdx create mode 100644 .typedoc/docs/shared/is-production-from-secret-key.mdx create mode 100644 .typedoc/docs/shared/is-publishable-key.mdx create mode 100644 .typedoc/docs/shared/is-staging.mdx create mode 100644 .typedoc/docs/shared/is-truthy.mdx create mode 100644 .typedoc/docs/shared/is-valid-browser-online.mdx create mode 100644 .typedoc/docs/shared/is-valid-browser.mdx create mode 100644 .typedoc/docs/shared/isomorphic-atob.mdx create mode 100644 .typedoc/docs/shared/load-clerk-js-script.mdx create mode 100644 .typedoc/docs/shared/pages-or-infinite-options.mdx create mode 100644 .typedoc/docs/shared/paginated-hook-config.mdx create mode 100644 .typedoc/docs/shared/paginated-resources.mdx create mode 100644 .typedoc/docs/shared/parse-publishable-key.mdx create mode 100644 .typedoc/docs/shared/read-json-file.mdx create mode 100644 .typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx create mode 100644 .typedoc/docs/shared/snake-to-camel.mdx create mode 100644 .typedoc/docs/shared/titleize.mdx create mode 100644 .typedoc/docs/shared/to-sentence.mdx create mode 100644 .typedoc/docs/shared/use-clerk.mdx create mode 100644 .typedoc/docs/shared/use-organization-list-params.mdx create mode 100644 .typedoc/docs/shared/use-organization-list-return.mdx create mode 100644 .typedoc/docs/shared/use-organization-list.mdx create mode 100644 .typedoc/docs/shared/use-organization-params.mdx create mode 100644 .typedoc/docs/shared/use-organization-return.mdx create mode 100644 .typedoc/docs/shared/use-organization.mdx create mode 100644 .typedoc/docs/shared/use-reverification.mdx create mode 100644 .typedoc/docs/shared/use-session-list.mdx create mode 100644 .typedoc/docs/shared/use-session.mdx create mode 100644 .typedoc/docs/shared/use-user.mdx create mode 100644 .typedoc/docs/shared/user-agent-is-robot.mdx create mode 100644 .typedoc/docs/shared/version-selector.mdx create mode 100644 .typedoc/docs/types/act-claim.mdx create mode 100644 .typedoc/docs/types/act-jwt-claim.mdx create mode 100644 .typedoc/docs/types/active-session-resource.mdx create mode 100644 .typedoc/docs/types/add-payment-source-params.mdx create mode 100644 .typedoc/docs/types/cancel-subscription-params.mdx create mode 100644 .typedoc/docs/types/check-authorization-fn.mdx create mode 100644 .typedoc/docs/types/check-authorization-from-session-claims.mdx create mode 100644 .typedoc/docs/types/check-authorization-params-from-session-claims.mdx create mode 100644 .typedoc/docs/types/check-authorization-with-custom-permissions.mdx create mode 100644 .typedoc/docs/types/clerk-api-error.mdx create mode 100644 .typedoc/docs/types/clerk-api-response-error.mdx create mode 100644 .typedoc/docs/types/clerk-host-router.mdx create mode 100644 .typedoc/docs/types/clerk-jwt-claims.mdx create mode 100644 .typedoc/docs/types/clerk-paginated-response.mdx create mode 100644 .typedoc/docs/types/clerk-pagination-params.mdx create mode 100644 .typedoc/docs/types/clerk-pagination-request.mdx create mode 100644 .typedoc/docs/types/clerk-resource.mdx create mode 100644 .typedoc/docs/types/clerk-status.mdx create mode 100644 .typedoc/docs/types/clerk.mdx create mode 100644 .typedoc/docs/types/commerce-billing-namespace.mdx create mode 100644 .typedoc/docs/types/commerce-checkout-json.mdx create mode 100644 .typedoc/docs/types/commerce-checkout-resource.mdx create mode 100644 .typedoc/docs/types/commerce-checkout-totals-json.mdx create mode 100644 .typedoc/docs/types/commerce-checkout-totals.mdx create mode 100644 .typedoc/docs/types/commerce-feature-json.mdx create mode 100644 .typedoc/docs/types/commerce-feature-resource.mdx create mode 100644 .typedoc/docs/types/commerce-initialized-payment-source-json.mdx create mode 100644 .typedoc/docs/types/commerce-initialized-payment-source-resource.mdx create mode 100644 .typedoc/docs/types/commerce-money-amount-json.mdx create mode 100644 .typedoc/docs/types/commerce-money-amount.mdx create mode 100644 .typedoc/docs/types/commerce-payer-resource-type.mdx create mode 100644 .typedoc/docs/types/commerce-payment-charge-type.mdx create mode 100644 .typedoc/docs/types/commerce-payment-json.mdx create mode 100644 .typedoc/docs/types/commerce-payment-resource.mdx create mode 100644 .typedoc/docs/types/commerce-payment-source-json.mdx create mode 100644 .typedoc/docs/types/commerce-payment-source-methods.mdx create mode 100644 .typedoc/docs/types/commerce-payment-source-resource.mdx create mode 100644 .typedoc/docs/types/commerce-payment-source-status.mdx create mode 100644 .typedoc/docs/types/commerce-payment-status.mdx create mode 100644 .typedoc/docs/types/commerce-plan-json.mdx create mode 100644 .typedoc/docs/types/commerce-plan-resource.mdx create mode 100644 .typedoc/docs/types/commerce-product-json.mdx create mode 100644 .typedoc/docs/types/commerce-product-resource.mdx create mode 100644 .typedoc/docs/types/commerce-statement-group-json.mdx create mode 100644 .typedoc/docs/types/commerce-statement-group.mdx create mode 100644 .typedoc/docs/types/commerce-statement-json.mdx create mode 100644 .typedoc/docs/types/commerce-statement-resource.mdx create mode 100644 .typedoc/docs/types/commerce-statement-status.mdx create mode 100644 .typedoc/docs/types/commerce-statement-totals-json.mdx create mode 100644 .typedoc/docs/types/commerce-statement-totals.mdx create mode 100644 .typedoc/docs/types/commerce-subscription-item-json.mdx create mode 100644 .typedoc/docs/types/commerce-subscription-item-resource.mdx create mode 100644 .typedoc/docs/types/commerce-subscription-json.mdx create mode 100644 .typedoc/docs/types/commerce-subscription-plan-period.mdx create mode 100644 .typedoc/docs/types/commerce-subscription-resource.mdx create mode 100644 .typedoc/docs/types/commerce-subscription-status.mdx create mode 100644 .typedoc/docs/types/confirm-checkout-params.mdx create mode 100644 .typedoc/docs/types/create-checkout-params.mdx create mode 100644 .typedoc/docs/types/create-organization-params.mdx create mode 100644 .typedoc/docs/types/element-object-key.mdx create mode 100644 .typedoc/docs/types/elements-config.mdx create mode 100644 .typedoc/docs/types/experimental_checkout-button-props.mdx create mode 100644 .typedoc/docs/types/experimental_plan-details-button-props.mdx create mode 100644 .typedoc/docs/types/experimental_subscription-details-button-props.mdx create mode 100644 .typedoc/docs/types/for-payer-type.mdx create mode 100644 .typedoc/docs/types/get-payment-attempts-params.mdx create mode 100644 .typedoc/docs/types/get-payment-sources-params.mdx create mode 100644 .typedoc/docs/types/get-plans-params.mdx create mode 100644 .typedoc/docs/types/get-statements-params.mdx create mode 100644 .typedoc/docs/types/get-subscription-params.mdx create mode 100644 .typedoc/docs/types/get-subscriptions-params.mdx create mode 100644 .typedoc/docs/types/get-token.mdx create mode 100644 .typedoc/docs/types/id-selectors.mdx create mode 100644 .typedoc/docs/types/initialize-payment-source-params.mdx create mode 100644 .typedoc/docs/types/internal_checkout-props.mdx create mode 100644 .typedoc/docs/types/internal_plan-details-props.mdx create mode 100644 .typedoc/docs/types/internal_subscription-details-props.mdx create mode 100644 .typedoc/docs/types/jwt-claims.mdx create mode 100644 .typedoc/docs/types/jwt-header.mdx create mode 100644 .typedoc/docs/types/legacy-redirect-props.mdx create mode 100644 .typedoc/docs/types/localization-resource.mdx create mode 100644 .typedoc/docs/types/make-default-payment-source-params.mdx create mode 100644 .typedoc/docs/types/multi-domain-and-or-proxy.mdx create mode 100644 .typedoc/docs/types/organization-custom-role-key.mdx create mode 100644 .typedoc/docs/types/organization-domain-resource.mdx create mode 100644 .typedoc/docs/types/organization-domain-verification-status.mdx create mode 100644 .typedoc/docs/types/organization-enrollment-mode.mdx create mode 100644 .typedoc/docs/types/organization-invitation-resource.mdx create mode 100644 .typedoc/docs/types/organization-invitation-status.mdx create mode 100644 .typedoc/docs/types/organization-membership-request-resource.mdx create mode 100644 .typedoc/docs/types/organization-membership-resource.mdx create mode 100644 .typedoc/docs/types/organization-permission-key.mdx create mode 100644 .typedoc/docs/types/organization-resource.mdx create mode 100644 .typedoc/docs/types/organization-suggestion-resource.mdx create mode 100644 .typedoc/docs/types/organization-suggestion-status.mdx create mode 100644 .typedoc/docs/types/organizations-jwt-claim.mdx create mode 100644 .typedoc/docs/types/override.mdx create mode 100644 .typedoc/docs/types/path-value.mdx create mode 100644 .typedoc/docs/types/payment-gateway.mdx create mode 100644 .typedoc/docs/types/pending-session-options.mdx create mode 100644 .typedoc/docs/types/pending-session-resource.mdx create mode 100644 .typedoc/docs/types/protect-props.mdx create mode 100644 .typedoc/docs/types/record-to-path.mdx create mode 100644 .typedoc/docs/types/redirect-options.mdx create mode 100644 .typedoc/docs/types/remove-payment-source-params.mdx create mode 100644 .typedoc/docs/types/reverification-config.mdx create mode 100644 .typedoc/docs/types/saml-strategy.mdx create mode 100644 .typedoc/docs/types/sdk-metadata.mdx create mode 100644 .typedoc/docs/types/server-get-token-options.mdx create mode 100644 .typedoc/docs/types/server-get-token.mdx create mode 100644 .typedoc/docs/types/session-resource.mdx create mode 100644 .typedoc/docs/types/session-status-claim.mdx create mode 100644 .typedoc/docs/types/session-task.mdx create mode 100644 .typedoc/docs/types/session-verification-level.mdx create mode 100644 .typedoc/docs/types/session-verification-types.mdx create mode 100644 .typedoc/docs/types/set-active-params.mdx create mode 100644 .typedoc/docs/types/set-active.mdx create mode 100644 .typedoc/docs/types/sign-in-resource.mdx create mode 100644 .typedoc/docs/types/sign-out.mdx create mode 100644 .typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx create mode 100644 .typedoc/docs/types/sign-up-resource.mdx create mode 100644 .typedoc/docs/types/signed-in-session-resource.mdx create mode 100644 .typedoc/docs/types/state-selectors.mdx create mode 100644 .typedoc/docs/types/telemetry-log-entry.mdx create mode 100644 .typedoc/docs/types/use-auth-return.mdx create mode 100644 .typedoc/docs/types/use-session-list-return.mdx create mode 100644 .typedoc/docs/types/use-session-return.mdx create mode 100644 .typedoc/docs/types/use-sign-in-return.mdx create mode 100644 .typedoc/docs/types/use-sign-up-return.mdx create mode 100644 .typedoc/docs/types/use-user-return.mdx create mode 100644 .typedoc/docs/types/user-organization-invitation-resource.mdx create mode 100644 .typedoc/docs/types/user-resource.mdx create mode 100644 .typedoc/docs/types/without.mdx diff --git a/.gitignore b/.gitignore index dd5f9738fb7..082710d3a61 100644 --- a/.gitignore +++ b/.gitignore @@ -97,5 +97,5 @@ scripts/.env !scripts/.env.example # typedoc -.typedoc/docs +# .typedoc/docs .typedoc/docs.json diff --git a/.prettierignore b/.prettierignore index 51265795595..8ac2a50af29 100644 --- a/.prettierignore +++ b/.prettierignore @@ -22,3 +22,4 @@ playground packages/backend/tests/**/*.js /**/CHANGELOG.md renovate.json5 +.typedoc/docs \ No newline at end of file diff --git a/.typedoc/docs/backend/allowlist-identifier.mdx b/.typedoc/docs/backend/allowlist-identifier.mdx new file mode 100644 index 00000000000..bb250e6833a --- /dev/null +++ b/.typedoc/docs/backend/allowlist-identifier.mdx @@ -0,0 +1,13 @@ +The Backend `AllowlistIdentifier` object represents an identifier that has been added to the allowlist of your application. The Backend `AllowlistIdentifier` object is used in the [Backend API](/docs/reference/backend-api/tag/Allow-list-Block-list#operation/ListAllowlistIdentifiers) and is not directly accessible from the Frontend API. + +## Properties + +| Property | Type | Description | +| -------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `createdAt` | `number` | The date when the allowlist identifier was first created. | +| `id` | `string` | A unique ID for the allowlist identifier. | +| `identifier` | `string` | The [identifier](/docs/authentication/configuration/sign-up-sign-in-options#identifiers) that was added to the allowlist. | +| `identifierType` | "email_address" \| "phone_number" \| "web3_wallet" | The type of the allowlist identifier. | +| `instanceId?` | `string` | The ID of the instance that this allowlist identifier belongs to. | +| `invitationId?` | `string` | The ID of the invitation sent to the identifier. | +| `updatedAt` | `number` | The date when the allowlist identifier was last updated. | diff --git a/.typedoc/docs/backend/auth-object.mdx b/.typedoc/docs/backend/auth-object.mdx new file mode 100644 index 00000000000..06d1716405b --- /dev/null +++ b/.typedoc/docs/backend/auth-object.mdx @@ -0,0 +1,8 @@ +## Properties + +| 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/.typedoc/docs/backend/authenticate-request-options.mdx b/.typedoc/docs/backend/authenticate-request-options.mdx new file mode 100644 index 00000000000..b28fe984305 --- /dev/null +++ b/.typedoc/docs/backend/authenticate-request-options.mdx @@ -0,0 +1,24 @@ +| 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/.typedoc/docs/backend/client.mdx b/.typedoc/docs/backend/client.mdx new file mode 100644 index 00000000000..f9c1d5dc0d9 --- /dev/null +++ b/.typedoc/docs/backend/client.mdx @@ -0,0 +1,14 @@ +The Backend `Client` object is similar to the [`Client`](/docs/references/javascript/client) object as it holds information about the authenticated sessions in the current device. However, the Backend `Client` object is different from the `Client` object in that it is used in the [Backend API](/docs/reference/backend-api/tag/Clients#operation/GetClient) and is not directly accessible from the Frontend API. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------------ | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- | +| `createdAt` | `number` | The date when the `Client` was first created. | +| `id` | `string` | The unique identifier for the `Client`. | +| `lastActiveSessionId` | null \| string | The ID of the last active [Session](/docs/references/backend/types/backend-session). | +| `sessionIds` | string[] | An array of [Session](/docs/references/backend/types/backend-session){{ target: '_blank' }} IDs associated with the `Client`. | +| `sessions` | [Session](/docs/references/backend/types/backend-session)[] | An array of [Session](/docs/references/backend/types/backend-session){{ target: '_blank' }} objects associated with the `Client`. | +| `signInId` | null \| string | The ID of the [`SignIn`](/docs/references/javascript/sign-in){{ target: '_blank' }}. | +| `signUpId` | null \| string | The ID of the [`SignUp`](/docs/references/javascript/sign-up){{ target: '_blank' }}. | +| `updatedAt` | `number` | The date when the `Client` was last updated. | diff --git a/.typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx b/.typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx new file mode 100644 index 00000000000..5cf86956ee7 --- /dev/null +++ b/.typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx @@ -0,0 +1,8 @@ +Webhooks specific interface for CommercePaymentAttempt. + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------- | ---------------------------- | --------------------------------------- | -------------------------- | +| `id` | `string` | The unique identifier for the resource. | - | +| `object` | `"commerce_payment_attempt"` | The type of the resource. | `ClerkResourceJSON.object` | diff --git a/.typedoc/docs/backend/commerce-plan-json.mdx b/.typedoc/docs/backend/commerce-plan-json.mdx new file mode 100644 index 00000000000..da74022198c --- /dev/null +++ b/.typedoc/docs/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` | `CommerceMoneyAmountJSON` | **`Experimental`** | - | +| `annual_monthly_fee` | `CommerceMoneyAmountJSON` | **`Experimental`** | - | +| `description?` | `string` | **`Experimental`** | - | +| `features` | FeatureJSON[] | **`Experimental`** | - | +| `fee` | `CommerceMoneyAmountJSON` | **`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/.typedoc/docs/backend/commerce-plan.mdx b/.typedoc/docs/backend/commerce-plan.mdx new file mode 100644 index 00000000000..f43e80be19f --- /dev/null +++ b/.typedoc/docs/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` | `CommerceMoneyAmount` | The monthly fee of the plan. | +| `annualFee` | `CommerceMoneyAmount` | The annual fee of the plan. | +| `annualMonthlyFee` | `CommerceMoneyAmount` | 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` | `CommerceMoneyAmount` | **`Experimental`** The annual fee of the plan. | +| `annualMonthlyFee` | `CommerceMoneyAmount` | **`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` | `CommerceMoneyAmount` | **`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/.typedoc/docs/backend/commerce-subscription-item-json.mdx b/.typedoc/docs/backend/commerce-subscription-item-json.mdx new file mode 100644 index 00000000000..adb3ec596ea --- /dev/null +++ b/.typedoc/docs/backend/commerce-subscription-item-json.mdx @@ -0,0 +1,27 @@ +**`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 | +| ------------------------------------------- | -------------------------------------------------------- | ---------------------------------------------------------- | -------------------------- | +| `amount` | null \| CommerceMoneyAmountJSON | **`Experimental`** | - | +| `canceled_at` | null \| number | **`Experimental`** | - | +| `created_at` | `number` | **`Experimental`** | - | +| `ended_at` | null \| number | **`Experimental`** | - | +| `id` | `string` | **`Experimental`** The unique identifier for the resource. | - | +| `is_free_trial?` | `boolean` | **`Experimental`** | - | +| `lifetime_paid` | `CommerceMoneyAmountJSON` | **`Experimental`** | - | +| `next_payment` | null \| \{ amount: number; date: number; \} | **`Experimental`** | - | +| `object` | `"commerce_subscription_item"` | **`Experimental`** The type of the resource. | `ClerkResourceJSON.object` | +| `past_due_at` | null \| number | **`Experimental`** | - | +| `payer_id` | `string` | **`Experimental`** | - | +| `period_end` | null \| number | **`Experimental`** | - | +| `period_start` | `number` | **`Experimental`** | - | +| `plan` | [`CommercePlanJSON`](commerce-plan-json.mdx) | **`Experimental`** | - | +| `plan_id` | `string` | **`Experimental`** | - | +| `plan_period` | "month" \| "annual" | **`Experimental`** | - | +| `status` | `CommerceSubscriptionItemStatus` | **`Experimental`** | - | +| `updated_at` | `number` | **`Experimental`** | - | diff --git a/.typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx b/.typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx new file mode 100644 index 00000000000..103e78c0efe --- /dev/null +++ b/.typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx @@ -0,0 +1,8 @@ +Webhooks specific interface for CommerceSubscriptionItem. + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------- | ------------------------------ | --------------------------------------- | -------------------------- | +| `id` | `string` | The unique identifier for the resource. | - | +| `object` | `"commerce_subscription_item"` | The type of the resource. | `ClerkResourceJSON.object` | diff --git a/.typedoc/docs/backend/commerce-subscription-item.mdx b/.typedoc/docs/backend/commerce-subscription-item.mdx new file mode 100644 index 00000000000..152a89b9219 --- /dev/null +++ b/.typedoc/docs/backend/commerce-subscription-item.mdx @@ -0,0 +1,74 @@ +**`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 subscription item. | +| `status` | `CommerceSubscriptionItemStatus` | The status of the subscription item. | +| `planPeriod` | "month" \| "annual" | The plan period for the subscription item. | +| `periodStart` | `number` | The start of the current period. | +| `nextPayment` | null \| \{ amount: number; date: number; \} | The next payment information. | +| `amount` | undefined \| null \| CommerceMoneyAmount | The current amount for the subscription item. | +| `plan` | [`CommercePlan`](commerce-plan.mdx) | The plan associated with this subscription item. | +| `planId` | `string` | The plan ID. | +| `createdAt` | `number` | The date and time the subscription item was created. | +| `updatedAt` | `number` | The date and time the subscription item was last updated. | +| `periodEnd` | null \| number | The end of the current period. | +| `canceledAt` | null \| number | When the subscription item was canceled. | +| `pastDueAt` | null \| number | When the subscription item became past due. | +| `endedAt` | null \| number | When the subscription item ended. | +| `payerId` | `string` | The payer ID. | +| `isFreeTrial?` | `boolean` | Whether this subscription item is currently in a free trial period. | +| `lifetimePaid?` | null \| CommerceMoneyAmount | The lifetime amount paid for this subscription item. | + +#### Returns + +`CommerceSubscriptionItem` + +## Properties + +| Property | Type | Description | +| ----------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `amount` | undefined \| null \| CommerceMoneyAmount | **`Experimental`** The current amount for the subscription item. | +| `canceledAt` | null \| number | **`Experimental`** When the subscription item was canceled. | +| `createdAt` | `number` | **`Experimental`** The date and time the subscription item was created. | +| `endedAt` | null \| number | **`Experimental`** When the subscription item ended. | +| `id` | `string` | **`Experimental`** The unique identifier for the subscription item. | +| `isFreeTrial?` | `boolean` | **`Experimental`** Whether this subscription item is currently in a free trial period. | +| `lifetimePaid?` | null \| CommerceMoneyAmount | **`Experimental`** The lifetime amount paid for this subscription item. | +| `nextPayment` | null \| \{ amount: number; date: number; \} | **`Experimental`** The next payment information. | +| `pastDueAt` | null \| number | **`Experimental`** When the subscription item became past due. | +| `payerId` | `string` | **`Experimental`** The payer ID. | +| `periodEnd` | null \| number | **`Experimental`** The end of the current period. | +| `periodStart` | `number` | **`Experimental`** The start of the current period. | +| `plan` | [`CommercePlan`](commerce-plan.mdx) | **`Experimental`** The plan associated with this subscription item. | +| `planId` | `string` | **`Experimental`** The plan ID. | +| `planPeriod` | "month" \| "annual" | **`Experimental`** The plan period for the subscription item. | +| `status` | `CommerceSubscriptionItemStatus` | **`Experimental`** The status of the subscription item. | +| `updatedAt` | `number` | **`Experimental`** The date and time the subscription item was last updated. | + +## Methods + +### fromJSON() + +**`Experimental`** + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------------------------- | +| `data` | [`CommerceSubscriptionItemJSON`](commerce-subscription-item-json.mdx) | + +#### Returns + +`CommerceSubscriptionItem` diff --git a/.typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx b/.typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx new file mode 100644 index 00000000000..587f9b985a1 --- /dev/null +++ b/.typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx @@ -0,0 +1,8 @@ +Webhooks specific interface for CommerceSubscription. + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------- | ------------------------- | --------------------------------------- | -------------------------- | +| `id` | `string` | The unique identifier for the resource. | - | +| `object` | `"commerce_subscription"` | The type of the resource. | `ClerkResourceJSON.object` | diff --git a/.typedoc/docs/backend/commerce-subscription.mdx b/.typedoc/docs/backend/commerce-subscription.mdx new file mode 100644 index 00000000000..9343e46b5f0 --- /dev/null +++ b/.typedoc/docs/backend/commerce-subscription.mdx @@ -0,0 +1,60 @@ +**`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 commerce subscription. | +| `status` | "abandoned" \| "active" \| "ended" \| "canceled" \| "incomplete" \| "past_due" | The current status of the subscription. | +| `payerId` | `string` | The ID of the payer for this subscription. | +| `createdAt` | `number` | Unix timestamp (milliseconds) of creation. | +| `updatedAt` | `number` | Unix timestamp (milliseconds) of last update. | +| `activeAt` | null \| number | Unix timestamp (milliseconds) when the subscription became active. | +| `pastDueAt` | null \| number | Unix timestamp (milliseconds) when the subscription became past due. | +| `subscriptionItems` | [CommerceSubscriptionItem](commerce-subscription-item.mdx)[] | Array of subscription items in this subscription. | +| `nextPayment` | null \| \{ amount: CommerceMoneyAmount; date: number; \} | Information about the next scheduled payment. | +| `eligibleForFreeTrial` | `boolean` | Whether the payer is eligible for a free trial. | + +#### Returns + +`CommerceSubscription` + +## Properties + +| Property | Type | Description | +| -------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `activeAt` | null \| number | **`Experimental`** Unix timestamp (milliseconds) when the subscription became active. | +| `createdAt` | `number` | **`Experimental`** Unix timestamp (milliseconds) of creation. | +| `eligibleForFreeTrial` | `boolean` | **`Experimental`** Whether the payer is eligible for a free trial. | +| `id` | `string` | **`Experimental`** The unique identifier for the commerce subscription. | +| `nextPayment` | null \| \{ amount: CommerceMoneyAmount; date: number; \} | **`Experimental`** Information about the next scheduled payment. | +| `pastDueAt` | null \| number | **`Experimental`** Unix timestamp (milliseconds) when the subscription became past due. | +| `payerId` | `string` | **`Experimental`** The ID of the payer for this subscription. | +| `status` | "abandoned" \| "active" \| "ended" \| "canceled" \| "incomplete" \| "past_due" | **`Experimental`** The current status of the subscription. | +| `subscriptionItems` | [CommerceSubscriptionItem](commerce-subscription-item.mdx)[] | **`Experimental`** Array of subscription items in this subscription. | +| `updatedAt` | `number` | **`Experimental`** Unix timestamp (milliseconds) of last update. | + +## Methods + +### fromJSON() + +**`Experimental`** + +#### Parameters + +| Parameter | Type | +| --------- | -------------------------- | +| `data` | `CommerceSubscriptionJSON` | + +#### Returns + +`CommerceSubscription` diff --git a/.typedoc/docs/backend/email-address.mdx b/.typedoc/docs/backend/email-address.mdx new file mode 100644 index 00000000000..f4ddfe2caf9 --- /dev/null +++ b/.typedoc/docs/backend/email-address.mdx @@ -0,0 +1,14 @@ +The Backend `EmailAddress` object is a model around an email address. Email addresses are one of the [identifiers](/docs/authentication/configuration/sign-up-sign-in-options#identifiers) used to provide identification for users. + +Email addresses must be **verified** to ensure that they are assigned to their rightful owners. The `EmailAddress` object holds all necessary state around the verification process. + +For implementation examples for adding and verifying email addresses, see the [email link custom flow](/docs/custom-flows/email-links) and [email code custom flow](/docs/custom-flows/add-email) guides. + +## Properties + +| Property | Type | Description | +| ---------------------------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `emailAddress` | `string` | The value of the email address. | +| `id` | `string` | The unique identifier for the email address. | +| `linkedTo` | [IdentificationLink](/docs/references/backend/types/backend-identification-link)[] | An array of objects containing information about any identifications that might be linked to the email address. | +| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of the email address. | diff --git a/.typedoc/docs/backend/external-account.mdx b/.typedoc/docs/backend/external-account.mdx new file mode 100644 index 00000000000..278b9fdae4d --- /dev/null +++ b/.typedoc/docs/backend/external-account.mdx @@ -0,0 +1,22 @@ +The Backend `ExternalAccount` object is a model around an identification obtained by an external provider (e.g. a social provider such as Google). + +External account must be verified, so that you can make sure they can be assigned to their rightful owners. The `ExternalAccount` object holds all necessary state around the verification process. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------ | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `approvedScopes` | `string` | The scopes that the user has granted access to. | +| `emailAddress` | `string` | The user's email address. | +| `externalId` | `string` | The unique ID of the user in the provider. | +| `firstName` | `string` | The user's first name. | +| `id` | `string` | The unique identifier for this external account. | +| `identificationId` | `string` | The identification with which this external account is associated. | +| `imageUrl` | `string` | The user's image URL. | +| `label` | null \| string | A descriptive label to differentiate multiple external accounts of the same user for the same provider. | +| `lastName` | `string` | The user's last name. | +| `phoneNumber` | null \| string | The phone number related to this specific external account. | +| `provider` | `string` | The provider name (e.g., `google`). | +| `publicMetadata` | null \| Record\ | Metadata that can be read from the Frontend API and Backend API and can be set only from the Backend API. | +| `username` | null \| string | The user's username. | +| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of this external account. | diff --git a/.typedoc/docs/backend/get-auth-fn.mdx b/.typedoc/docs/backend/get-auth-fn.mdx new file mode 100644 index 00000000000..d2d8f208d67 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/backend/identification-link.mdx b/.typedoc/docs/backend/identification-link.mdx new file mode 100644 index 00000000000..5ed1b59fce1 --- /dev/null +++ b/.typedoc/docs/backend/identification-link.mdx @@ -0,0 +1,8 @@ +Contains information about any identifications that might be linked to the email address. + +## Properties + +| Property | Type | Description | +| ------------------------ | -------- | ------------------------------------------------------------------------------------ | +| `id` | `string` | The unique identifier for the identification link. | +| `type` | `string` | The type of the identification link, e.g., `"email_address"`, `"phone_number"`, etc. | diff --git a/.typedoc/docs/backend/infer-auth-object-from-token-array.mdx b/.typedoc/docs/backend/infer-auth-object-from-token-array.mdx new file mode 100644 index 00000000000..a7421ad97d0 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/backend/infer-auth-object-from-token.mdx b/.typedoc/docs/backend/infer-auth-object-from-token.mdx new file mode 100644 index 00000000000..09a78f383a0 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/backend/invitation-status.mdx b/.typedoc/docs/backend/invitation-status.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/backend/invitation.mdx b/.typedoc/docs/backend/invitation.mdx new file mode 100644 index 00000000000..f7581ba48cd --- /dev/null +++ b/.typedoc/docs/backend/invitation.mdx @@ -0,0 +1,14 @@ +The Backend `Invitation` object represents an invitation to join your application. + +## Properties + +| Property | Type | Description | +| -------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `createdAt` | `number` | The date when the `Invitation` was first created. | +| `emailAddress` | `string` | The email address that the invitation was sent to. | +| `id` | `string` | The unique identifier for the `Invitation`. | +| `publicMetadata` | null \| Record\ | [Metadata](/docs/references/javascript/types/metadata#user-public-metadata){{ target: '_blank' }} that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. Once the user accepts the invitation and signs up, these metadata will end up in the user's public metadata. | +| `revoked?` | `boolean` | Whether the `Invitation` has been revoked. | +| `status` | "expired" \| "revoked" \| "pending" \| "accepted" | The status of the `Invitation`. | +| `updatedAt` | `number` | The date when the `Invitation` was last updated. | +| `url?` | `string` | The URL that the user can use to accept the invitation. | diff --git a/.typedoc/docs/backend/o-auth-application.mdx b/.typedoc/docs/backend/o-auth-application.mdx new file mode 100644 index 00000000000..030d68ff7b0 --- /dev/null +++ b/.typedoc/docs/backend/o-auth-application.mdx @@ -0,0 +1,26 @@ +The Backend `OAuthApplication` object holds information about an OAuth application. + +## Properties + +| Property | Type | Description | +| ---------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `authorizeUrl` | `string` | The URL used to authorize the user and obtain an authorization code. | +| `clientId` | `string` | The ID of the client associated with the OAuth application. | +| `clientImageUrl` | null \| string | The URL of the image or logo representing the OAuth application. | +| `clientSecret?` | `string` | The client secret associated with the OAuth application. Empty if public client. | +| `clientUri` | null \| string | The public-facing URL of the OAuth application, often shown on consent screens. | +| `consentScreenEnabled` | `boolean` | Specifies whether the consent screen should be displayed in the authentication flow. Cannot be disabled for dynamically registered OAuth applications. | +| `createdAt` | `number` | The date when the OAuth application was first created. | +| `discoveryUrl` | `string` | The OpenID Connect discovery endpoint URL for this OAuth application. | +| `dynamicallyRegistered` | `boolean` | Specifies whether the OAuth application is dynamically registered. | +| `id` | `string` | The unique identifier for the OAuth application. | +| `instanceId` | `string` | The ID of the instance that this OAuth application belongs to. | +| `isPublic` | `boolean` | Indicates whether the client is public. If true, the Proof Key of Code Exchange (PKCE) flow can be used. | +| `name` | `string` | The name of the new OAuth application. | +| `pkceRequired` | `boolean` | Specifies whether the Proof Key of Code Exchange (PKCE) flow should be required in the authentication flow. | +| `redirectUris` | string[] | An array of redirect URIs of the new OAuth application. | +| `scopes` | `string` | Scopes for the new OAuth application. | +| `tokenFetchUrl` | `string` | The URL used by the client to exchange an authorization code for an access token. | +| `tokenIntrospectionUrl` | `string` | The URL used to introspect and validate issued access tokens. | +| `updatedAt` | `number` | The date when the OAuth application was last updated. | +| `userInfoUrl` | `string` | The URL where the client can retrieve user information using an access token. | diff --git a/.typedoc/docs/backend/organization-invitation-status.mdx b/.typedoc/docs/backend/organization-invitation-status.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/backend/organization-invitation.mdx b/.typedoc/docs/backend/organization-invitation.mdx new file mode 100644 index 00000000000..41b8a55b0a7 --- /dev/null +++ b/.typedoc/docs/backend/organization-invitation.mdx @@ -0,0 +1,19 @@ +The Backend `OrganizationInvitation` object is similar to the [`OrganizationInvitation`](/docs/references/javascript/types/organization-invitation) object as it's the model around an organization invitation. However, the Backend `OrganizationInvitation` object is different in that it's used in the [Backend API](/docs/reference/backend-api/tag/Organization-Invitations#operation/CreateOrganizationInvitation){{ target: '_blank' }} and is not directly accessible from the Frontend API. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `createdAt` | `number` | The date when the invitation was first created. | +| `emailAddress` | `string` | The email address of the user who is invited to the [`Organization`](/docs/references/backend/types/backend-organization). | +| `expiresAt` | `number` | The date when the invitation expires. | +| `id` | `string` | The unique identifier for the `OrganizationInvitation`. | +| `organizationId` | `string` | The ID of the [`Organization`](/docs/references/backend/types/backend-organization) that the user is invited to. | +| `privateMetadata` | [`OrganizationInvitationPrivateMetadata`](/docs/references/javascript/types/metadata#organization-invitation-private-metadata) | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | +| `publicMetadata` | [`OrganizationInvitationPublicMetadata`](/docs/references/javascript/types/metadata#organization-invitation-public-metadata) | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | +| `publicOrganizationData?` | null \| [PublicOrganizationDataJSON](#public-organization-data-json) | Public data about the organization that the user is invited to. | +| `role` | `string` | The role of the invited user. | +| `roleName` | `string` | The name of the role of the invited user. | +| `status?` | "expired" \| "revoked" \| "pending" \| "accepted" | The status of the invitation. | +| `updatedAt` | `number` | The date when the invitation was last updated. | +| `url` | null \| string | The URL that the user can use to accept the invitation. | diff --git a/.typedoc/docs/backend/organization-membership-public-user-data.mdx b/.typedoc/docs/backend/organization-membership-public-user-data.mdx new file mode 100644 index 00000000000..0c5cc72dbcd --- /dev/null +++ b/.typedoc/docs/backend/organization-membership-public-user-data.mdx @@ -0,0 +1,8 @@ +| Property | Type | Description | +| ------------------------------------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `firstName` | null \| string | The first name of the user. | +| `hasImage` | `boolean` | Whether the user has a profile picture. | +| `identifier` | `string` | The [identifier](/docs/authentication/configuration/sign-up-sign-in-options#identifiers) of the user. | +| `imageUrl` | `string` | Holds the default avatar or user's uploaded profile image. Compatible with Clerk's [Image Optimization](/docs/guides/image-optimization). | +| `lastName` | null \| string | The last name of the user. | +| `userId` | `string` | The ID of the user that this public data belongs to. | diff --git a/.typedoc/docs/backend/organization-membership.mdx b/.typedoc/docs/backend/organization-membership.mdx new file mode 100644 index 00000000000..585912c6ef4 --- /dev/null +++ b/.typedoc/docs/backend/organization-membership.mdx @@ -0,0 +1,15 @@ +The Backend `OrganizationMembership` object is similar to the [`OrganizationMembership`](/docs/references/javascript/types/organization-membership) object as it's the model around an organization membership entity and describes the relationship between users and organizations. However, the Backend `OrganizationMembership` object is different in that it's used in the [Backend API](/docs/reference/backend-api/tag/Organization-Memberships#operation/CreateOrganizationMembership){{ target: '_blank' }} and is not directly accessible from the Frontend API. + +## Properties + +| Property | Type | Description | +| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `createdAt` | `number` | The date when the membership was first created. | +| `id` | `string` | The unique identifier for the membership. | +| `organization` | [`Organization`](/docs/references/backend/types/backend-organization) | The organization that the user is a member of. | +| `permissions` | string[] | The permissions granted to the user in the organization. | +| `privateMetadata` | [`OrganizationMembershipPrivateMetadata`](/docs/references/javascript/types/metadata#organization-membership-private-metadata) | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | +| `publicMetadata` | [`OrganizationMembershipPublicMetadata`](/docs/references/javascript/types/metadata#organization-membership-public-metadata) | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | +| `publicUserData?` | null \| [OrganizationMembershipPublicUserData](#organization-membership-public-user-data) | Public information about the user that this membership belongs to. | +| `role` | `string` | The role of the user. | +| `updatedAt` | `number` | The date when the membership was last updated. | diff --git a/.typedoc/docs/backend/organization-sync-options.mdx b/.typedoc/docs/backend/organization-sync-options.mdx new file mode 100644 index 00000000000..5a3609e438f --- /dev/null +++ b/.typedoc/docs/backend/organization-sync-options.mdx @@ -0,0 +1,8 @@ +> **OrganizationSyncOptions** = \{ organizationPatterns?: Pattern[]; personalAccountPatterns?: Pattern[]; \} + +## Properties + +| Property | Type | Description | +| --------------------------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `organizationPatterns?` | Pattern[] | 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/(.*)"]`. | +| `personalAccountPatterns?` | Pattern[] | 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/.typedoc/docs/backend/organization-sync-target.mdx b/.typedoc/docs/backend/organization-sync-target.mdx new file mode 100644 index 00000000000..42fb0f448bb --- /dev/null +++ b/.typedoc/docs/backend/organization-sync-target.mdx @@ -0,0 +1,2 @@ +Represents an organization or a personal account - e.g. an +entity that can be activated by the handshake API. diff --git a/.typedoc/docs/backend/organization.mdx b/.typedoc/docs/backend/organization.mdx new file mode 100644 index 00000000000..4da8acac205 --- /dev/null +++ b/.typedoc/docs/backend/organization.mdx @@ -0,0 +1,19 @@ +The Backend `Organization` object is similar to the [`Organization`](/docs/references/javascript/organization) object as it holds information about an organization, as well as methods for managing it. However, the Backend `Organization` object is different in that it is used in the [Backend API](/docs/reference/backend-api/tag/Organizations#operation/ListOrganizations){{ target: '_blank' }} and is not directly accessible from the Frontend API. + +## Properties + +| Property | Type | Description | +| ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `adminDeleteEnabled` | `boolean` | Whether the organization allows admins to delete users. | +| `createdAt` | `number` | The date when the organization was first created. | +| `createdBy?` | `string` | The ID of the user who created the organization. | +| `hasImage` | `boolean` | Whether the organization has an image. | +| `id` | `string` | The unique identifier for the organization. | +| `imageUrl` | `string` | Holds the organization's logo. Compatible with Clerk's [Image Optimization](/docs/guides/image-optimization). | +| `maxAllowedMemberships` | `number` | The maximum number of memberships allowed in the organization. | +| `membersCount?` | `number` | The number of members in the organization. | +| `name` | `string` | The name of the organization. | +| `privateMetadata` | [`OrganizationPrivateMetadata`](/docs/references/javascript/types/metadata#organization-private-metadata) | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | +| `publicMetadata` | null \| [OrganizationPublicMetadata](/docs/references/javascript/types/metadata#organization-public-metadata) | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | +| `slug` | `string` | The URL-friendly identifier of the user's active organization. If supplied, it must be unique for the instance. | +| `updatedAt` | `number` | The date when the organization was last updated. | diff --git a/.typedoc/docs/backend/paginated-resource-response.mdx b/.typedoc/docs/backend/paginated-resource-response.mdx new file mode 100644 index 00000000000..1603ff21b4e --- /dev/null +++ b/.typedoc/docs/backend/paginated-resource-response.mdx @@ -0,0 +1,14 @@ +An interface that describes the response of a method that returns a paginated list of resources. + +If the promise resolves, you will get back the [properties](#properties) listed below. `data` will be an array of the resource type you requested. You can use the `totalCount` property to determine how many total items exist remotely. + +Some methods that return this type allow pagination with the `limit` and `offset` parameters, in which case the first 10 items will be returned by default. For methods such as [`getAllowlistIdentifierList()`](/docs/references/backend/allowlist/get-allowlist-identifier-list), which do not take a `limit` or `offset`, all items will be returned. + +If the promise is rejected, you will receive a `ClerkAPIResponseError` or network error. + +## Properties + +| Property | Type | Description | +| ------------------------------------ | -------- | -------------------------------------------- | +| `data` | `T` | An array that contains the fetched data. | +| `totalCount` | `number` | The total count of data that exist remotely. | diff --git a/.typedoc/docs/backend/phone-number.mdx b/.typedoc/docs/backend/phone-number.mdx new file mode 100644 index 00000000000..01d074308db --- /dev/null +++ b/.typedoc/docs/backend/phone-number.mdx @@ -0,0 +1,16 @@ +The Backend `PhoneNumber` object describes a phone number. Phone numbers can be used as a proof of identification for users, or simply as a means of contacting users. + +Phone numbers must be **verified** to ensure that they can be assigned to their rightful owners. The `PhoneNumber` object holds all the necessary state around the verification process. + +Finally, phone numbers can be used as part of [multi-factor authentication](/docs/authentication/configuration/sign-up-sign-in-options#multi-factor-authentication). During sign in, users can opt in to an extra verification step where they will receive an SMS message with a one-time code. This code must be entered to complete the sign in process. + +## Properties + +| Property | Type | Description | +| -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `defaultSecondFactor` | `boolean` | Set to `true` if this phone number is the default second factor. Set to `false` otherwise. A user must have exactly one default second factor, if multi-factor authentication (2FA) is enabled. | +| `id` | `string` | The unique identifier for this phone number. | +| `linkedTo` | [IdentificationLink](/docs/references/backend/types/backend-identification-link)[] | An object containing information about any other identification that might be linked to this phone number. | +| `phoneNumber` | `string` | The value of this phone number, in [E.164 format](https://en.wikipedia.org/wiki/E.164). | +| `reservedForSecondFactor` | `boolean` | Set to `true` if this phone number is reserved for multi-factor authentication (2FA). Set to `false` otherwise. | +| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of this phone number. | diff --git a/.typedoc/docs/backend/public-organization-data-json.mdx b/.typedoc/docs/backend/public-organization-data-json.mdx new file mode 100644 index 00000000000..4a509f0f1b1 --- /dev/null +++ b/.typedoc/docs/backend/public-organization-data-json.mdx @@ -0,0 +1,8 @@ +| Property | Type | Description | +| ----------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------- | +| `has_image` | `boolean` | Whether the organization has a profile image. | +| `id` | `string` | The unique identifier for the resource. | +| `image_url?` | `string` | Holds the default organization profile image. Compatible with Clerk's [Image Optimization](/docs/guides/image-optimization). | +| `name` | `string` | The name of the organization. | +| `object` | `ObjectType` | The type of the resource. | +| `slug` | `string` | The slug of the organization. | diff --git a/.typedoc/docs/backend/redirect-url.mdx b/.typedoc/docs/backend/redirect-url.mdx new file mode 100644 index 00000000000..1b128348cea --- /dev/null +++ b/.typedoc/docs/backend/redirect-url.mdx @@ -0,0 +1,12 @@ +Redirect URLs are whitelisted URLs that facilitate secure authentication flows in native applications (e.g. React Native, Expo). In these contexts, Clerk ensures that security-critical nonces are passed only to the whitelisted URLs. + +The Backend `RedirectUrl` object represents a redirect URL in your application. This object is used in the Backend API. + +## Properties + +| Property | Type | Description | +| ---------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `createdAt` | `number` | The date when the redirect URL was first created. | +| `id` | `string` | The unique identifier for the redirect URL. | +| `updatedAt` | `number` | The date when the redirect URL was last updated. | +| `url` | `string` | The full URL value prefixed with `https://` or a custom scheme. Examples: `https://my-app.com/oauth-callback`, `my-app://oauth-callback`. | diff --git a/.typedoc/docs/backend/saml-account.mdx b/.typedoc/docs/backend/saml-account.mdx new file mode 100644 index 00000000000..9099ed83ecc --- /dev/null +++ b/.typedoc/docs/backend/saml-account.mdx @@ -0,0 +1,15 @@ +The Backend `SamlAccount` object describes a SAML account. + +## Properties + +| Property | Type | Description | +| -------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------ | +| `active` | `boolean` | A boolean that indicates whether the SAML account is active. | +| `emailAddress` | `string` | The email address of the SAML account. | +| `firstName` | `string` | The first name of the SAML account. | +| `id` | `string` | The unique identifier for the SAML account. | +| `lastName` | `string` | The last name of the SAML account. | +| `provider` | `string` | The provider of the SAML account. | +| `providerUserId` | null \| string | The user's ID as used in the provider. | +| `samlConnection` | null \| SamlAccountConnection | The SAML connection of the SAML account. | +| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | The verification of the SAML account. | diff --git a/.typedoc/docs/backend/saml-connection.mdx b/.typedoc/docs/backend/saml-connection.mdx new file mode 100644 index 00000000000..d55d90126bd --- /dev/null +++ b/.typedoc/docs/backend/saml-connection.mdx @@ -0,0 +1,27 @@ +The Backend `SamlConnection` object holds information about a SAML connection for an organization. + +## Properties + +| Property | Type | Description | +| ---------------------------------------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `acsUrl` | `string` | The Assertion Consumer Service (ACS) URL of the connection. | +| `active` | `boolean` | Indicates whether the connection is active or not. | +| `allowIdpInitiated` | `boolean` | Indicates whether the connection allows Identity Provider (IdP) initiated flows or not. | +| `allowSubdomains` | `boolean` | Indicates whether users with an email address subdomain are allowed to use this connection in order to authenticate or not. | +| `attributeMapping` | `AttributeMapping` | Defines the attribute name mapping between the Identity Provider (IdP) and Clerk's [`User`](/docs/references/javascript/user) properties. | +| `createdAt` | `number` | The date when the connection was first created. | +| `domain` | `string` | The domain of your organization. Sign in flows using an email with this domain will use the connection. | +| `id` | `string` | The unique identifier for the connection. | +| `idpCertificate` | null \| string | The X.509 certificate as provided by the Identity Provider (IdP). | +| `idpEntityId` | null \| string | The Entity ID as provided by the Identity Provider (IdP). | +| `idpMetadata` | null \| string | The XML content of the Identity Provider (IdP) metadata file. If present, it takes priority over the corresponding individual properties. | +| `idpMetadataUrl` | null \| string | The URL which serves the Identity Provider (IdP) metadata. If present, it takes priority over the corresponding individual properties. | +| `idpSsoUrl` | null \| string | The Single-Sign On URL as provided by the Identity Provider (IdP). | +| `name` | `string` | The name to use as a label for the connection. | +| `organizationId` | null \| string | The organization ID of the organization. | +| `provider` | `string` | The Identity Provider (IdP) of the connection. | +| `spEntityId` | `string` | The Entity ID as provided by the Service Provider (Clerk). | +| `spMetadataUrl` | `string` | The metadata URL as provided by the Service Provider (Clerk). | +| `syncUserAttributes` | `boolean` | Indicates whether the connection syncs user attributes between the Service Provider (SP) and Identity Provider (IdP) or not. | +| `updatedAt` | `number` | The date when the SAML connection was last updated. | +| `userCount` | `number` | The number of users associated with the connection. | diff --git a/.typedoc/docs/backend/session-activity.mdx b/.typedoc/docs/backend/session-activity.mdx new file mode 100644 index 00000000000..b6a304b26e0 --- /dev/null +++ b/.typedoc/docs/backend/session-activity.mdx @@ -0,0 +1,14 @@ +The Backend `SessionActivity` object models the activity of a user session, capturing details such as the device type, browser information, and geographical location. + +## Properties + +| Property | Type | Description | +| --------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------- | +| `browserName?` | `string` | The name of the browser from which this session activity occurred. | +| `browserVersion?` | `string` | The version of the browser from which this session activity occurred. | +| `city?` | `string` | The city from which this session activity occurred. Resolved by IP address geo-location. | +| `country?` | `string` | The country from which this session activity occurred. Resolved by IP address geo-location. | +| `deviceType?` | `string` | The type of the device which was used in this session activity. | +| `id` | `string` | The unique identifier for the session activity record. | +| `ipAddress?` | `string` | The IP address from which this session activity originated. | +| `isMobile` | `boolean` | Will be set to `true` if the session activity came from a mobile device. Set to `false` otherwise. | diff --git a/.typedoc/docs/backend/session.mdx b/.typedoc/docs/backend/session.mdx new file mode 100644 index 00000000000..6cf5fa2e50b --- /dev/null +++ b/.typedoc/docs/backend/session.mdx @@ -0,0 +1,18 @@ +The Backend `Session` object is similar to the [`Session`](/docs/references/javascript/session) object as it is an abstraction over an HTTP session and models the period of information exchange between a user and the server. However, the Backend `Session` object is different as it is used in the [Backend API](/docs/reference/backend-api/tag/Sessions#operation/GetSessionList) and is not directly accessible from the Frontend API. + +## Properties + +| Property | Type | Description | +| ----------------------------------------------------------------- | ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `abandonAt` | `number` | The date when the `Session` will be abandoned. | +| `actor` | null \| Record\ | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | +| `clientId` | `string` | The ID of the client associated with the `Session`. | +| `createdAt` | `number` | The date when the `Session` was first created. | +| `expireAt` | `number` | The date when the `Session` will expire. | +| `id` | `string` | The unique identifier for the `Session`. | +| `lastActiveAt` | `number` | The time the session was last active on the [`Client`](/docs/references/backend/types/backend-client). | +| `lastActiveOrganizationId?` | `string` | The ID of the last active organization. | +| `latestActivity?` | [`SessionActivity`](/docs/references/backend/types/backend-session-activity) | An object that provides additional information about this session, focused around user activity data. | +| `status` | `string` | The current state of the `Session`. | +| `updatedAt` | `number` | The date when the `Session` was last updated. | +| `userId` | `string` | The ID of the user associated with the `Session`. | diff --git a/.typedoc/docs/backend/user.mdx b/.typedoc/docs/backend/user.mdx new file mode 100644 index 00000000000..9847d75c136 --- /dev/null +++ b/.typedoc/docs/backend/user.mdx @@ -0,0 +1,47 @@ +The Backend `User` object is similar to the `User` object as it holds information about a user of your application, such as their unique identifier, name, email addresses, phone numbers, and more. However, the Backend `User` object is different from the `User` object in that it is used in the [Backend API](/docs/reference/backend-api/tag/Users#operation/GetUser){{ target: '_blank' }} and is not directly accessible from the Frontend API. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `backupCodeEnabled` | `boolean` | A boolean indicating whether the user has enabled Backup codes. | +| `banned` | `boolean` | A boolean indicating whether the user is banned or not. | +| `createdAt` | `number` | The date when the user was first created. | +| `createOrganizationEnabled` | `boolean` | A boolean indicating whether the organization creation is enabled for the user or not. | +| `createOrganizationsLimit` | null \| number | An integer indicating the number of organizations that can be created by the user. If the value is `0`, then the user can create unlimited organizations. Default is `null`. | +| `deleteSelfEnabled` | `boolean` | A boolean indicating whether the user can delete their own account. | +| `emailAddresses` | [EmailAddress](/docs/references/backend/types/backend-email-address)[] | An array of all the `EmailAddress` objects associated with the user. Includes the primary. | +| `externalAccounts` | [ExternalAccount](/docs/references/backend/types/backend-external-account)[] | An array of all the `ExternalAccount` objects associated with the user via OAuth. **Note**: This includes both verified & unverified external accounts. | +| `externalId` | null \| string | The ID of the user as used in your external systems. Must be unique across your instance. | +| `firstName` | null \| string | The user's first name. | +| `hasImage` | `boolean` | A getter boolean to check if the user has uploaded an image or one was copied from OAuth. Returns `false` if Clerk is displaying an avatar for the user. | +| `id` | `string` | The unique identifier for the user. | +| `imageUrl` | `string` | The URL of the user's profile image. | +| `lastActiveAt` | null \| number | Date when the user was last active. | +| `lastName` | null \| string | The user's last name. | +| `lastSignInAt` | null \| number | The date when the user last signed in. May be empty if the user has never signed in. | +| `legalAcceptedAt` | null \| number | The unix timestamp of when the user accepted the legal requirements. `null` if [**Require express consent to legal documents**](/docs/authentication/configuration/legal-compliance) is not enabled. | +| `locked` | `boolean` | A boolean indicating whether the user is banned or not. | +| `passwordEnabled` | `boolean` | A boolean indicating whether the user has a password on their account. | +| `phoneNumbers` | [PhoneNumber](/docs/references/backend/types/backend-phone-number)[] | An array of all the `PhoneNumber` objects associated with the user. Includes the primary. | +| `primaryEmailAddressId` | null \| string | The ID for the `EmailAddress` that the user has set as primary. | +| `primaryPhoneNumberId` | null \| string | The ID for the `PhoneNumber` that the user has set as primary. | +| `primaryWeb3WalletId` | null \| string | The ID for the [`Web3Wallet`](/docs/references/backend/types/backend-web3-wallet) that the user signed up with. | +| `privateMetadata` | `UserPrivateMetadata` | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | +| `publicMetadata` | `UserPublicMetadata` | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | +| `samlAccounts` | [SamlAccount](/docs/references/backend/types/backend-saml-account)[] | An array of all the `SamlAccount` objects associated with the user via SAML. | +| `totpEnabled` | `boolean` | A boolean indicating whether the user has enabled TOTP by generating a TOTP secret and verifying it via an authenticator app. | +| `twoFactorEnabled` | `boolean` | A boolean indicating whether the user has enabled two-factor authentication. | +| `unsafeMetadata` | `UserUnsafeMetadata` | Metadata that can be read and set from the Frontend API. It's considered unsafe because it can be modified from the frontend. | +| `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 + +| Property | Type | Description | +| ------------------------------------------------------ | ----------------------------------------------------------------------------------------- | -------------------------------------- | +| `fullName` | null \| string | The full name of the user. | +| `primaryEmailAddress` | null \| [EmailAddress](/docs/references/backend/types/backend-email-address) | The primary email address of the user. | +| `primaryPhoneNumber` | null \| [PhoneNumber](/docs/references/backend/types/backend-phone-number) | The primary phone number of the user. | +| `primaryWeb3Wallet` | null \| [Web3Wallet](/docs/references/backend/types/backend-web3-wallet) | The primary web3 wallet of the user. | diff --git a/.typedoc/docs/backend/verification.mdx b/.typedoc/docs/backend/verification.mdx new file mode 100644 index 00000000000..0abc5338e0e --- /dev/null +++ b/.typedoc/docs/backend/verification.mdx @@ -0,0 +1,13 @@ +The Backend `Verification` object describes the state of the verification process of a sign-in or sign-up attempt. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------------------------------------ | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `attempts` | null \| number | The number of attempts related to the verification. | +| `expireAt` | null \| number | The time the verification will expire at. | +| `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` | `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/.typedoc/docs/backend/verify-machine-auth-token.mdx b/.typedoc/docs/backend/verify-machine-auth-token.mdx new file mode 100644 index 00000000000..3c6cc9d35c7 --- /dev/null +++ b/.typedoc/docs/backend/verify-machine-auth-token.mdx @@ -0,0 +1,12 @@ +Verifies any type of machine token by detecting its type from the prefix. + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------- | ------------------------------------------------------------------------- | +| `token` | `string` | The token to verify (e.g. starts with "m2m*", "oauth*", "api*key*", etc.) | +| `options` | [`VerifyTokenOptions`](#verify-token-options) | Options including secretKey for BAPI authorization | + +## Returns + +`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"; \} \| \{ data: APIKey; errors?: undefined; tokenType: "api_key" \| "m2m_token" \| "oauth_token"; \}\> diff --git a/.typedoc/docs/backend/verify-token-options.mdx b/.typedoc/docs/backend/verify-token-options.mdx new file mode 100644 index 00000000000..e35c5fa20b3 --- /dev/null +++ b/.typedoc/docs/backend/verify-token-options.mdx @@ -0,0 +1,11 @@ +| Property | Type | Description | +| ----------------------------------------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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`. | +| ~~`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). | +| `secretKey?` | `string` | The Clerk Secret Key from the [**API keys**](https://dashboard.clerk.com/last-active?path=api-keys) page in the Clerk Dashboard. | +| `skipJwksCache?` | `boolean` | A flag to ignore the JWKS cache and always fetch JWKS before each JWT verification. | diff --git a/.typedoc/docs/backend/verify-token.mdx b/.typedoc/docs/backend/verify-token.mdx new file mode 100644 index 00000000000..151d30ea2e6 --- /dev/null +++ b/.typedoc/docs/backend/verify-token.mdx @@ -0,0 +1,91 @@ +> [!WARNING] +> This is a lower-level method intended for more advanced use-cases. It's recommended to use [`authenticateRequest()`](/docs/references/backend/authenticate-request), which fully authenticates a token passed from the `request` object. + +```ts +function verifyToken( + token, + options, +): Promise>; +``` + +Verifies a Clerk-generated token signature. Networkless if the `jwtKey` is provided. Otherwise, performs a network call to retrieve the JWKS from the [Backend API](/docs/reference/backend-api/tag/JWKS#operation/GetJWKS){{ target: '_blank' }}. + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------------------------------- | -------------------------------- | +| `token` | `string` | The token to verify. | +| `options` | [`VerifyTokenOptions`](#verify-token-options) | Options for verifying the token. | + +### `VerifyTokenOptions` + +It is recommended to set these options as [environment variables](/docs/deployments/clerk-environment-variables#api-and-sdk-configuration) where possible, and then pass them to the function. For example, you can set the `secretKey` option using the `CLERK_SECRET_KEY` environment variable, and then pass it to the function like this: `createClerkClient({ secretKey: process.env.CLERK_SECRET_KEY })`. + +> [!WARNING] +> You must provide either `jwtKey` or `secretKey`. + + + +## Returns + +`Promise`\<`JwtReturnType`\<`JwtPayload`, `TokenVerificationError`\>\> + +## Example + +The following example demonstrates how to use the [JavaScript Backend SDK](/docs/references/backend/overview) to verify the token signature. + +In the following example: + +1. The **JWKS Public Key** from the Clerk Dashboard is set in the environment variable `CLERK_JWT_KEY`. +1. The session token is retrieved from the `__session` cookie or the Authorization header. +1. The token is verified in a networkless manner by passing the `jwtKey` prop. +1. The `authorizedParties` prop is passed to verify that the session token is generated from the expected frontend application. +1. If the token is valid, the response contains the verified token. + +```ts +import { verifyToken } from "@clerk/backend"; +import { cookies } from "next/headers"; + +export async function GET(request: Request) { + const cookieStore = cookies(); + const sessToken = cookieStore.get("__session")?.value; + const bearerToken = request.headers + .get("Authorization") + ?.replace("Bearer ", ""); + const token = sessToken || bearerToken; + + if (!token) { + return Response.json( + { error: "Token not found. User must sign in." }, + { status: 401 }, + ); + } + + try { + const verifiedToken = await verifyToken(token, { + jwtKey: process.env.CLERK_JWT_KEY, + authorizedParties: ["http://localhost:3001", "api.example.com"], // Replace with your authorized parties + }); + + return Response.json({ verifiedToken }); + } catch (error) { + return Response.json({ error: "Token not verified." }, { status: 401 }); + } +} +``` + +If the token is valid, the response will contain a JSON object that looks something like this: + +```json +{ + "verifiedToken": { + "azp": "http://localhost:3000", + "exp": 1687906422, + "iat": 1687906362, + "iss": "https://magical-marmoset-51.clerk.accounts.dev", + "nbf": 1687906352, + "sid": "sess_2Ro7e2IxrffdqBboq8KfB6eGbIy", + "sub": "user_2RfWKJREkjKbHZy0Wqa5qrHeAnb" + } +} +``` diff --git a/.typedoc/docs/backend/verify-webhook-options.mdx b/.typedoc/docs/backend/verify-webhook-options.mdx new file mode 100644 index 00000000000..c0bc04c4ae2 --- /dev/null +++ b/.typedoc/docs/backend/verify-webhook-options.mdx @@ -0,0 +1,7 @@ +> **VerifyWebhookOptions** = \{ signingSecret?: string; \} + +## Properties + +| Property | Type | Description | +| ------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `signingSecret?` | `string` | The signing secret for the webhook. It's recommended to use the [`CLERK_WEBHOOK_SIGNING_SECRET` environment variable](/docs/deployments/clerk-environment-variables#webhooks) instead. | diff --git a/.typedoc/docs/backend/verify-webhook.mdx b/.typedoc/docs/backend/verify-webhook.mdx new file mode 100644 index 00000000000..dc336b51356 --- /dev/null +++ b/.typedoc/docs/backend/verify-webhook.mdx @@ -0,0 +1,42 @@ +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; +``` + +## Parameters + +| Parameter | Type | Description | +| ------------------------ | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `request` | `Request` | The request object. | +| `options` | \{ signingSecret?: string; \} | Optional configuration object. | +| `options.signingSecret?` | `string` | The signing secret for the webhook. It's recommended to use the [`CLERK_WEBHOOK_SIGNING_SECRET` environment variable](/docs/deployments/clerk-environment-variables#webhooks) instead. | + +## Returns + +`Promise`\<`WebhookEvent`\> + +## Example + +See the [guide on syncing data](/docs/webhooks/sync-data) for more comprehensive and framework-specific examples that you can copy and paste into your app. + +```ts +try { + const evt = await verifyWebhook(request); + + // Access the event data + const { id } = evt.data; + const eventType = evt.type; + + // Handle specific event types + if (evt.type === "user.created") { + console.log("New user created:", evt.data.id); + // Handle user creation + } + + return new Response("Success", { status: 200 }); +} catch (err) { + console.error("Webhook verification failed:", err); + return new Response("Webhook verification failed", { status: 400 }); +} +``` diff --git a/.typedoc/docs/backend/web3-wallet.mdx b/.typedoc/docs/backend/web3-wallet.mdx new file mode 100644 index 00000000000..d0eeb11bfbf --- /dev/null +++ b/.typedoc/docs/backend/web3-wallet.mdx @@ -0,0 +1,11 @@ +The Backend `Web3Wallet` object describes a Web3 wallet address. The address can be used as a proof of identification for users. + +Web3 addresses must be verified to ensure that they can be assigned to their rightful owners. The verification is completed via Web3 wallet browser extensions, such as [Metamask](https://metamask.io/), [Coinbase Wallet](https://www.coinbase.com/wallet), and [OKX Wallet](https://www.okx.com/help/section/faq-web3-wallet). The `Web3Wallet3` object holds all the necessary state around the verification process. + +## Properties + +| Property | Type | Description | +| ---------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `id` | `string` | The unique ID for the Web3 wallet. | +| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of this Web3 wallet. | +| `web3Wallet` | `string` | The Web3 wallet address, made up of 0x + 40 hexadecimal characters. | diff --git a/.typedoc/docs/clerk-react/api-keys.mdx b/.typedoc/docs/clerk-react/api-keys.mdx new file mode 100644 index 00000000000..4147bc55f14 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/clerk-react/clerk-provider-props.mdx b/.typedoc/docs/clerk-react/clerk-provider-props.mdx new file mode 100644 index 00000000000..e157d089a4f --- /dev/null +++ b/.typedoc/docs/clerk-react/clerk-provider-props.mdx @@ -0,0 +1,43 @@ +## Properties + +| Property | Type | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `afterMultiSessionSingleSignOutUrl?` | null \| string | The full URL or path to navigate to after signing out the current user is complete. This option applies to [multi-session applications](/docs/authentication/configuration/session-options#multi-session-applications). | +| ~~`afterSignInUrl?`~~ | null \| string | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | +| `afterSignOutUrl?` | null \| string | Full URL or path to navigate to after successful sign out. | +| ~~`afterSignUpUrl?`~~ | null \| string | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | +| `allowedRedirectOrigins?` | (string \| RegExp)[] | An optional array of domains to validate user-provided redirect URLs against. If no match is made, the redirect is considered unsafe and the default redirect will be used with a warning logged in the console. | +| `allowedRedirectProtocols?` | string[] | An optional array of protocols to validate user-provided redirect URLs against. If no match is made, the redirect is considered unsafe and the default redirect will be used with a warning logged in the console. | +| `appearance?` | `Appearance` | Optional object to style your components. Will only affect [Clerk Components](/docs/components/overview) and not [Account Portal](/docs/account-portal/overview) pages. | +| `clerkJSUrl?` | `string` | The URL that `@clerk/clerk-js` should be hot-loaded from. | +| `clerkJSVariant?` | "" \| "headless" | If your web application only uses [Control Components](/docs/components/overview#control-components), you can set this value to `'headless'` and load a minimal ClerkJS bundle for optimal page performance. | +| `clerkJSVersion?` | `string` | The npm version for `@clerk/clerk-js`. | +| `domain?` | string \| (url) => string | **Required if your application is a satellite application**. Sets the domain of the satellite application. | +| `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?` | [`LocalizationResource`](/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. | +| `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`). | +| `publishableKey` | `string` | The Clerk Publishable Key for your instance. This can be found on the [API keys](https://dashboard.clerk.com/last-active?path=api-keys) page in the Clerk Dashboard. | +| ~~`redirectUrl?`~~ | null \| string | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | +| `routerPush?` | (to, metadata?) => unknown | A function which takes the destination path as an argument and performs a "push" navigation. | +| `routerReplace?` | (to, metadata?) => unknown | A function which takes the destination path as an argument and performs a "replace" navigation. | +| `sdkMetadata?` | \{ environment?: string; name: string; version: string; \} | Contains information about the SDK that the host application is using. You don't need to set this value yourself unless you're [developing an SDK](/docs/references/sdk/overview). | +| `sdkMetadata.environment?` | `string` | Typically this will be the `NODE_ENV` that the SDK is currently running in. | +| `sdkMetadata.name` | `string` | The npm package name of the SDK. | +| `sdkMetadata.version` | `string` | The npm package version of the SDK. | +| `selectInitialSession?` | (client) => null \| [SignedInSessionResource](/docs/references/javascript/session) | By default, the last signed-in session is used during client initialization. This option allows you to override that behavior, e.g. by selecting a specific session. | +| `signInFallbackRedirectUrl?` | null \| string | The fallback URL to redirect to after the user signs in, if there's no `redirect_url` in the path already. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. Defaults to `'/'`. | +| `signInForceRedirectUrl?` | null \| string | This URL will always be redirected to after the user signs in. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. | +| `signInUrl?` | `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. **It is required to 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. | +| `signUpFallbackRedirectUrl?` | null \| string | The fallback URL to redirect to after the user signs up, if there's no `redirect_url` in the path already. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. Defaults to `'/'`. | +| `signUpForceRedirectUrl?` | null \| string | This URL will always be redirected to after the user signs up. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. | +| `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. | +| `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/.typedoc/docs/clerk-react/protect.mdx b/.typedoc/docs/clerk-react/protect.mdx new file mode 100644 index 00000000000..4d3c56c30f0 --- /dev/null +++ b/.typedoc/docs/clerk-react/protect.mdx @@ -0,0 +1,21 @@ +Use `` in order to prevent unauthenticated or unauthorized users from accessing the children passed to the component. + +Examples: + +``` + + + has({permission:"a_permission_key"})} /> + has({role:"a_role_key"})} /> +Unauthorized

} /> +``` + +## Parameters + +| Parameter | Type | +| ------------------- | -------------- | +| `__namedParameters` | `ProtectProps` | + +## Returns + +`ReactNode` diff --git a/.typedoc/docs/clerk-react/redirect-to-create-organization.mdx b/.typedoc/docs/clerk-react/redirect-to-create-organization.mdx new file mode 100644 index 00000000000..002c69ba5c1 --- /dev/null +++ b/.typedoc/docs/clerk-react/redirect-to-create-organization.mdx @@ -0,0 +1,13 @@ +## Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------- | +| `props` | [`Without`](../types/without.mdx)\<`P`, `"clerk"`\> | + +## Returns + +null \| Element + +## Deprecated + +Use [`redirectToCreateOrganization()`](/docs/references/javascript/clerk#redirect-to-create-organization) instead. diff --git a/.typedoc/docs/clerk-react/redirect-to-organization-profile.mdx b/.typedoc/docs/clerk-react/redirect-to-organization-profile.mdx new file mode 100644 index 00000000000..1bb05bc69e5 --- /dev/null +++ b/.typedoc/docs/clerk-react/redirect-to-organization-profile.mdx @@ -0,0 +1,13 @@ +## Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------- | +| `props` | [`Without`](../types/without.mdx)\<`P`, `"clerk"`\> | + +## Returns + +null \| Element + +## Deprecated + +Use [`redirectToOrganizationProfile()`](/docs/references/javascript/clerk#redirect-to-organization-profile) instead. diff --git a/.typedoc/docs/clerk-react/redirect-to-user-profile.mdx b/.typedoc/docs/clerk-react/redirect-to-user-profile.mdx new file mode 100644 index 00000000000..f8e8364b5a6 --- /dev/null +++ b/.typedoc/docs/clerk-react/redirect-to-user-profile.mdx @@ -0,0 +1,13 @@ +## Parameters + +| Parameter | Type | +| --------- | --------------------------------------------------- | +| `props` | [`Without`](../types/without.mdx)\<`P`, `"clerk"`\> | + +## Returns + +null \| Element + +## Deprecated + +Use [`redirectToUserProfile()`](/docs/references/javascript/clerk#redirect-to-user-profile) instead. diff --git a/.typedoc/docs/clerk-react/use-auth.mdx b/.typedoc/docs/clerk-react/use-auth.mdx new file mode 100644 index 00000000000..01f1051a69b --- /dev/null +++ b/.typedoc/docs/clerk-react/use-auth.mdx @@ -0,0 +1,176 @@ +The `useAuth()` hook provides access to the current user's authentication state and methods to manage the active session. + +> [!NOTE] +> To access auth data server-side, see the [`Auth` object reference doc](/docs/references/backend/types/auth-object). + + +By default, Next.js opts all routes into static rendering. If you need to opt a route or routes into dynamic rendering because you need to access the authentication data at request time, you can create a boundary by passing the `dynamic` prop to ``. See the [guide on rendering modes](/docs/references/nextjs/rendering-modes) for more information, including code examples. + + +## Parameters + +| Parameter | Type | Description | +| ---------------------------- | -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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 + +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. + + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `actor` | `undefined` | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | +| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | +| `has` | `undefined` | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | +| `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. | +| `orgId` | `undefined` | The ID of the user's active organization. | +| `orgRole` | `undefined` | The current user's role in their active organization. | +| `orgSlug` | `undefined` | The URL-friendly identifier of the user's active organization. | +| `sessionClaims` | `undefined` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | +| `sessionId` | `undefined` | The ID for the current session. | +| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | +| `userId` | `undefined` | The ID of the current user. | + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `actor` | `null` | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | +| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | +| `has()` | (params) => false | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | +| `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. | +| `orgId` | `null` | The ID of the user's active organization. | +| `orgRole` | `null` | The current user's role in their active organization. | +| `orgSlug` | `null` | The URL-friendly identifier of the user's active organization. | +| `sessionClaims` | `null` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | +| `sessionId` | `null` | The ID for the current session. | +| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | +| `userId` | `null` | The ID of the current user. | + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `actor` | null \| \{ [x: string]: unknown; sub: string; \} | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | +| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | +| `has()` | (isAuthorizedParams) => boolean | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | +| `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. | +| `orgId` | `null` | The ID of the user's active organization. | +| `orgRole` | `null` | The current user's role in their active organization. | +| `orgSlug` | `null` | The URL-friendly identifier of the user's active organization. | +| `sessionClaims` | `JwtPayload` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | +| `sessionId` | `string` | The ID for the current session. | +| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | +| `userId` | `string` | The ID of the current user. | + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `actor` | null \| \{ [x: string]: unknown; sub: string; \} | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | +| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | +| `has()` | (isAuthorizedParams) => boolean | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | +| `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. | +| `orgId` | `string` | The ID of the user's active organization. | +| `orgRole` | `OrganizationCustomRoleKey` | The current user's role in their active organization. | +| `orgSlug` | null \| string | The URL-friendly identifier of the user's active organization. | +| `sessionClaims` | `JwtPayload` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | +| `sessionId` | `string` | The ID for the current session. | +| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | +| `userId` | `string` | The ID of the current user. | + + + +## Example + +The following example demonstrates how to use the `useAuth()` hook to access the current auth state, like whether the user is signed in or not. It also includes a basic example for using the `getToken()` method to retrieve a session token for fetching data from an external resource. + + + + +```tsx {{ filename: 'src/pages/ExternalDataPage.tsx' }} +import { useAuth } from "@clerk/clerk-react"; + +export default function ExternalDataPage() { + const { userId, sessionId, getToken, isLoaded, isSignedIn } = useAuth(); + + const fetchExternalData = async () => { + const token = await getToken(); + + // Fetch data from an external API + const response = await fetch("https://api.example.com/data", { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + + return response.json(); + }; + + if (!isLoaded) { + return
Loading...
; + } + + if (!isSignedIn) { + return
Sign in to view this page
; + } + + return ( +
+

+ Hello, {userId}! Your current active session is {sessionId}. +

+ +
+ ); +} +``` + +
+ + +```tsx {{ filename: 'app/external-data/page.tsx' }} +"use client"; + +import { useAuth } from "@clerk/nextjs"; + +export default function ExternalDataPage() { + const { userId, sessionId, getToken, isLoaded, isSignedIn } = useAuth(); + + const fetchExternalData = async () => { + const token = await getToken(); + + // Fetch data from an external API + const response = await fetch("https://api.example.com/data", { + headers: { + Authorization: `Bearer ${token}`, + }, + }); + + return response.json(); + }; + + if (!isLoaded) { + return
Loading...
; + } + + if (!isSignedIn) { + return
Sign in to view this page
; + } + + return ( +
+

+ Hello, {userId}! Your current active session is {sessionId}. +

+ +
+ ); +} +``` + +
+
diff --git a/.typedoc/docs/clerk-react/use-clerk.mdx b/.typedoc/docs/clerk-react/use-clerk.mdx new file mode 100644 index 00000000000..074e0243ca1 --- /dev/null +++ b/.typedoc/docs/clerk-react/use-clerk.mdx @@ -0,0 +1,43 @@ +> [!WARNING] +> This hook should only be used for advanced use cases, such as building a completely custom OAuth flow or as an escape hatch to access to the `Clerk` object. + +The `useClerk()` hook provides access to the [`Clerk`](/docs/references/javascript/clerk) object, allowing you to build alternatives to any Clerk Component. + +## Returns + +[Clerk](/docs/references/javascript/clerk) — The `useClerk()` hook returns the `Clerk` object, which includes all the methods and properties listed in the [`Clerk` reference](/docs/references/javascript/clerk). + +## Example + +The following example uses the `useClerk()` hook to access the `clerk` object. The `clerk` object is used to call the [`openSignIn()`](/docs/references/javascript/clerk#sign-in) method to open the sign-in modal. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useClerk } from "@clerk/clerk-react"; + +export default function Home() { + const clerk = useClerk(); + + return ; +} +``` + + + + +```tsx {{ filename: 'app/page.tsx' }} +"use client"; + +import { useClerk } from "@clerk/nextjs"; + +export default function HomePage() { + const clerk = useClerk(); + + return ; +} +``` + + + diff --git a/.typedoc/docs/clerk-react/use-organization-list.mdx b/.typedoc/docs/clerk-react/use-organization-list.mdx new file mode 100644 index 00000000000..c6f8b6d93cb --- /dev/null +++ b/.typedoc/docs/clerk-react/use-organization-list.mdx @@ -0,0 +1,150 @@ +The `useOrganizationList()` hook provides access to the current user's organization memberships, invitations, and suggestions. It also includes methods for creating new organizations and managing the active organization. + +## Parameters + +| Parameter | Type | +| --------- | ---- | +| `params?` | `T` | + +## Returns + +[`UseOrganizationListReturn`](../shared/use-organization-list-return.mdx)\<`T`\> + +## Examples + +### Expanding and paginating attributes + +To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. So by default, the `userMemberships`, `userInvitations`, and `userSuggestions` attributes are not populated. You must pass true or an object with the desired properties to fetch and paginate the data. + +```tsx +// userMemberships.data will never be populated +const { userMemberships } = useOrganizationList(); + +// Use default values to fetch userMemberships, such as initialPage = 1 and pageSize = 10 +const { userMemberships } = useOrganizationList({ + userMemberships: true, +}); + +// Pass your own values to fetch userMemberships +const { userMemberships } = useOrganizationList({ + userMemberships: { + pageSize: 20, + initialPage: 2, // skips the first page + }, +}); + +// Aggregate pages in order to render an infinite list +const { userMemberships } = useOrganizationList({ + userMemberships: { + infinite: true, + }, +}); +``` + +### Infinite pagination + +The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `userMemberships` attribute will be populated with the first page of the user's organization memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. + +```tsx {{ filename: 'src/components/JoinedOrganizations.tsx' }} +import { useOrganizationList } from "@clerk/clerk-react"; +import React from "react"; + +const JoinedOrganizations = () => { + const { isLoaded, setActive, userMemberships } = useOrganizationList({ + userMemberships: { + infinite: true, + }, + }); + + if (!isLoaded) { + return <>Loading; + } + + return ( + <> +
    + {userMemberships.data?.map((mem) => ( +
  • + {mem.organization.name} + +
  • + ))} +
+ + + + ); +}; + +export default JoinedOrganizations; +``` + +### Simple pagination + +The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `userInvitations` attribute will be populated with the first page of invitations. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of invitations. + +Notice the difference between this example's pagination and the infinite pagination example above. + +```tsx {{ filename: 'src/components/UserInvitationsTable.tsx' }} +import { useOrganizationList } from "@clerk/clerk-react"; +import React from "react"; + +const UserInvitationsTable = () => { + const { isLoaded, userInvitations } = useOrganizationList({ + userInvitations: { + infinite: true, + keepPreviousData: true, + }, + }); + + if (!isLoaded || userInvitations.isLoading) { + return <>Loading; + } + + return ( + <> + + + + + + + + + + {userInvitations.data?.map((inv) => ( + + + + + ))} + +
EmailOrg name
{inv.emailAddress}{inv.publicOrganizationData.name}
+ + + + + ); +}; + +export default UserInvitationsTable; +``` diff --git a/.typedoc/docs/clerk-react/use-organization.mdx b/.typedoc/docs/clerk-react/use-organization.mdx new file mode 100644 index 00000000000..d37be2324cb --- /dev/null +++ b/.typedoc/docs/clerk-react/use-organization.mdx @@ -0,0 +1,130 @@ +The `useOrganization()` hook retrieves attributes of the currently active organization. + +## Parameters + +| Parameter | Type | +| --------- | ---- | +| `params?` | `T` | + +## Returns + +[`UseOrganizationReturn`](../shared/use-organization-return.mdx)\<`T`\> + +## Examples + +### Expand and paginate attributes + +To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. By default, the `memberships`, `invitations`, `membershipRequests`, and `domains` attributes are not populated. You must pass `true` or an object with the desired properties to fetch and paginate the data. + +```tsx +// invitations.data will never be populated. +const { invitations } = useOrganization(); + +// Use default values to fetch invitations, such as initialPage = 1 and pageSize = 10 +const { invitations } = useOrganization({ + invitations: true, +}); + +// Pass your own values to fetch invitations +const { invitations } = useOrganization({ + invitations: { + pageSize: 20, + initialPage: 2, // skips the first page + }, +}); + +// Aggregate pages in order to render an infinite list +const { invitations } = useOrganization({ + invitations: { + infinite: true, + }, +}); +``` + +### Infinite pagination + +The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. + +```tsx +import { useOrganization } from '@clerk/clerk-react' + +export default function MemberList() { + const { memberships } = useOrganization({ + memberships: { + infinite: true, // Append new data to the existing list + keepPreviousData: true, // Persist the cached data until the new data has been fetched + }, + }) + + if (!memberships) { + // Handle loading state + return null + } + + return ( +
+

Organization members

+
    + {memberships.data?.map((membership) => ( +
  • + {membership.publicUserData.firstName} {membership.publicUserData.lastName} < + {membership.publicUserData.identifier}> :: {membership.role} +
  • + ))} +
+ + +
+ ) +} +``` + +### Simple pagination + +The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of memberships. + +Notice the difference between this example's pagination and the infinite pagination example above. + +```tsx +import { useOrganization } from '@clerk/clerk-react' + +export default function MemberList() { + const { memberships } = useOrganization({ + memberships: { + keepPreviousData: true, // Persist the cached data until the new data has been fetched + }, + }) + + if (!memberships) { + // Handle loading state + return null + } + + return ( +
+

Organization members

+
    + {memberships.data?.map((membership) => ( +
  • + {membership.publicUserData.firstName} {membership.publicUserData.lastName} < + {membership.publicUserData.identifier}> :: {membership.role} +
  • + ))} +
+ + + + +
+ ) +} +``` diff --git a/.typedoc/docs/clerk-react/use-reverification.mdx b/.typedoc/docs/clerk-react/use-reverification.mdx new file mode 100644 index 00000000000..f307df52533 --- /dev/null +++ b/.typedoc/docs/clerk-react/use-reverification.mdx @@ -0,0 +1,55 @@ +> [!WARNING] +> +> Depending on the SDK you're using, this feature requires `@clerk/nextjs@6.12.7` or later, `@clerk/clerk-react@5.25.1` or later, and `@clerk/clerk-js@5.57.1` or later. + +The `useReverification()` hook is used to handle a session's reverification flow. If a request requires reverification, a modal will display, prompting the user to verify their credentials. Upon successful verification, the original request will automatically retry. + +## Parameters + +| Parameter | Type | +| ---------- | --------- | +| `fetcher` | `Fetcher` | +| `options?` | `Options` | + +## Returns + +`UseReverificationResult`\<`Fetcher`\> — The `useReverification()` hook returns an array with the "enhanced" fetcher. + +## Example + +### Handle cancellation of the reverification process + +The following example demonstrates how to handle scenarios where a user cancels the reverification flow, such as closing the modal, which might result in `myData` being `null`. + +In the following example, `myFetcher` would be a function in your backend that fetches data from the route that requires reverification. See the [guide on how to require reverification](/docs/guides/reverification) for more information. + +```tsx {{ filename: 'src/components/MyButton.tsx' }} +import { useReverification } from "@clerk/clerk-react"; +import { isReverificationCancelledError } from "@clerk/clerk-react/error"; + +type MyData = { + balance: number; +}; + +export function MyButton() { + const fetchMyData = () => + fetch("/api/balance").then((res) => res.json() as Promise); + const enhancedFetcher = useReverification(fetchMyData); + + const handleClick = async () => { + try { + const myData = await enhancedFetcher(); + // ^ is types as `MyData` + } catch (e) { + // Handle error returned from the fetcher here + + // You can also handle cancellation with the following + if (isReverificationCancelledError(err)) { + // Handle the cancellation error here + } + } + }; + + return ; +} +``` diff --git a/.typedoc/docs/clerk-react/use-session-list.mdx b/.typedoc/docs/clerk-react/use-session-list.mdx new file mode 100644 index 00000000000..6602a87d186 --- /dev/null +++ b/.typedoc/docs/clerk-react/use-session-list.mdx @@ -0,0 +1,77 @@ +The `useSessionList()` hook returns an array of [`Session`](/docs/references/javascript/session) objects that have been registered on the client device. + +## 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. + + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `sessions` | `undefined` | A list of sessions that have been registered on the client device. | +| `setActive` | `undefined` | A function that sets the active session and/or organization. | + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `sessions` | [SessionResource](/docs/references/javascript/session)[] | A list of sessions that have been registered on the client device. | +| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session and/or organization. | + + + +## Example + +### Get a list of sessions + +The following example uses `useSessionList()` to get a list of sessions that have been registered on the client device. The `sessions` property is used to show the number of times the user has visited the page. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useSessionList } from "@clerk/clerk-react"; + +export default function Home() { + const { isLoaded, sessions } = useSessionList(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return ( +
+

Welcome back. You've been here {sessions.length} times before.

+
+ ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +"use client"; + +import { useSessionList } from "@clerk/nextjs"; + +export default function HomePage() { + const { isLoaded, sessions } = useSessionList(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return ( +
+

Welcome back. You've been here {sessions.length} times before.

+
+ ); +} +``` + +
+
diff --git a/.typedoc/docs/clerk-react/use-session.mdx b/.typedoc/docs/clerk-react/use-session.mdx new file mode 100644 index 00000000000..1abbc16b9b6 --- /dev/null +++ b/.typedoc/docs/clerk-react/use-session.mdx @@ -0,0 +1,98 @@ +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. + +## 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. + + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `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 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 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` | `boolean` | A boolean that indicates whether a user is currently signed in. | +| `session` | [`SignedInSessionResource`](/docs/references/javascript/session) | The current session for the user. | + + + +## Example + +### Access the `Session` object + +The following example uses the `useSession()` hook to access the `Session` object, which has the `lastActiveAt` property. The `lastActiveAt` property is a `Date` object used to show the time the session was last active. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useSession } from "@clerk/clerk-react"; + +export default function Home() { + const { isLoaded, session, isSignedIn } = useSession(); + + if (!isLoaded) { + // Handle loading state + return null; + } + if (!isSignedIn) { + // Handle signed out state + return null; + } + + return ( +
+

+ This session has been active since{" "} + {session.lastActiveAt.toLocaleString()} +

+
+ ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +"use client"; + +import { useSession } from "@clerk/nextjs"; + +export default function HomePage() { + const { isLoaded, session, isSignedIn } = useSession(); + + if (!isLoaded) { + // Handle loading state + return null; + } + if (!isSignedIn) { + // Handle signed out state + return null; + } + + return ( +
+

+ This session has been active since{" "} + {session.lastActiveAt.toLocaleString()} +

+
+ ); +} +``` + +
+
diff --git a/.typedoc/docs/clerk-react/use-sign-in.mdx b/.typedoc/docs/clerk-react/use-sign-in.mdx new file mode 100644 index 00000000000..a94556a8390 --- /dev/null +++ b/.typedoc/docs/clerk-react/use-sign-in.mdx @@ -0,0 +1,73 @@ +The `useSignIn()` hook provides access to the [`SignIn`](/docs/references/javascript/sign-in) object, which allows you to check the current state of a sign-in attempt and manage the sign-in flow. You can use this to create a [custom sign-in flow](/docs/custom-flows/overview#sign-in-flow). + +## 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. + + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `setActive` | `undefined` | A function that sets the active session. | +| `signIn` | `undefined` | An object that contains the current sign-in attempt status and methods to create a new sign-in attempt. | + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session. | +| `signIn` | [SignInResource](/docs/references/javascript/sign-in) | An object that contains the current sign-in attempt status and methods to create a new sign-in attempt. | + + + +## Examples + +### Check the current state of a sign-in + +The following example uses the `useSignIn()` hook to access the [`SignIn`](/docs/references/javascript/sign-in) object, which contains the current sign-in attempt status and methods to create a new sign-in attempt. The `isLoaded` property is used to handle the loading state. + + + + +```tsx {{ filename: 'src/pages/SignInPage.tsx' }} +import { useSignIn } from "@clerk/clerk-react"; + +export default function SignInPage() { + const { isLoaded, signIn } = useSignIn(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return
The current sign-in attempt status is {signIn?.status}.
; +} +``` + +
+ + +```tsx {{ filename: 'app/sign-in/page.tsx' }} +"use client"; + +import { useSignIn } from "@clerk/nextjs"; + +export default function SignInPage() { + const { isLoaded, signIn } = useSignIn(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return
The current sign-in attempt status is {signIn?.status}.
; +} +``` + +
+
+ +### Create a custom sign-in flow with `useSignIn()` + +The `useSignIn()` hook can also be used to build fully custom sign-in flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-in flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignIn()` hook to create custom flows, see the [custom flow guides](/docs/custom-flows/overview). diff --git a/.typedoc/docs/clerk-react/use-sign-up.mdx b/.typedoc/docs/clerk-react/use-sign-up.mdx new file mode 100644 index 00000000000..be1cee60c46 --- /dev/null +++ b/.typedoc/docs/clerk-react/use-sign-up.mdx @@ -0,0 +1,73 @@ +The `useSignUp()` hook provides access to the [`SignUp`](/docs/references/javascript/sign-up) object, which allows you to check the current state of a sign-up attempt and manage the sign-up flow. You can use this to create a [custom sign-up flow](/docs/custom-flows/overview#sign-up-flow). + +## 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. + + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `setActive` | `undefined` | A function that sets the active session. | +| `signUp` | `undefined` | An object that contains the current sign-up attempt status and methods to create a new sign-up attempt. | + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session. | +| `signUp` | [`SignUpResource`](/docs/references/javascript/sign-up) | An object that contains the current sign-up attempt status and methods to create a new sign-up attempt. | + + + +## Examples + +### Check the current state of a sign-up + +The following example uses the `useSignUp()` hook to access the [`SignUp`](/docs/references/javascript/sign-up) object, which contains the current sign-up attempt status and methods to create a new sign-up attempt. The `isLoaded` property is used to handle the loading state. + + + + +```tsx {{ filename: 'src/pages/SignUpPage.tsx' }} +import { useSignUp } from "@clerk/clerk-react"; + +export default function SignUpPage() { + const { isLoaded, signUp } = useSignUp(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return
The current sign-up attempt status is {signUp?.status}.
; +} +``` + +
+ + +```tsx {{ filename: 'app/sign-up/page.tsx' }} +"use client"; + +import { useSignUp } from "@clerk/nextjs"; + +export default function SignUpPage() { + const { isLoaded, signUp } = useSignUp(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return
The current sign-up attempt status is {signUp?.status}.
; +} +``` + +
+
+ +### Create a custom sign-up flow with `useSignUp()` + +The `useSignUp()` hook can also be used to build fully custom sign-up flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-up flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignUp()` hook to create custom flows, see the [custom flow guides](/docs/custom-flows/overview). diff --git a/.typedoc/docs/clerk-react/use-user.mdx b/.typedoc/docs/clerk-react/use-user.mdx new file mode 100644 index 00000000000..a89b31c4fae --- /dev/null +++ b/.typedoc/docs/clerk-react/use-user.mdx @@ -0,0 +1,211 @@ +The `useUser()` hook provides access to the current user's [`User`](/docs/references/javascript/user) object, which contains all the data for a single user in your application and provides methods to manage their account. This hook also allows you to check if the user is signed in and if Clerk has loaded and initialized. + +## 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. + + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `isSignedIn` | `undefined` | A boolean that returns `true` if the user is signed in. | +| `user` | `undefined` | The `User` object for the current 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 returns `true` if the user is signed in. | +| `user` | `null` | The `User` object for the current 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 returns `true` if the user is signed in. | +| `user` | [`UserResource`](/docs/references/javascript/user) | The `User` object for the current user. | + + + +## Examples + +### Get the current user + +The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which contains the current user's data such as their full name. The `isLoaded` and `isSignedIn` properties are used to handle the loading state and to check if the user is signed in, respectively. + +```tsx {{ filename: 'src/Example.tsx' }} +export default function Example() { + const { isSignedIn, user, isLoaded } = useUser(); + + if (!isLoaded) { + return
Loading...
; + } + + if (!isSignedIn) { + return
Sign in to view this page
; + } + + return
Hello {user.firstName}!
; +} +``` + +### Update user data + +The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`update()`](/docs/references/javascript/user#update) method to update the current user's information. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useUser } from "@clerk/clerk-react"; + +export default function Home() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + await user.update({ + firstName: "John", + lastName: "Doe", + }); + }; + + return ( + <> + +

user.firstName: {user?.firstName}

+

user.lastName: {user?.lastName}

+ + ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +"use client"; + +import { useUser } from "@clerk/nextjs"; + +export default function HomePage() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + await user.update({ + firstName: "John", + lastName: "Doe", + }); + }; + + return ( + <> + +

user.firstName: {user?.firstName}

+

user.lastName: {user?.lastName}

+ + ); +} +``` + +
+
+ +### Reload user data + +The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`reload()`](/docs/references/javascript/user#reload) method to get the latest user's information. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useUser } from "@clerk/clerk-react"; + +export default function Home() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + // Update data via an API endpoint + const updateMetadata = await fetch("/api/updateMetadata"); + + // Check if the update was successful + if (updateMetadata.message !== "success") { + throw new Error("Error updating"); + } + + // If the update was successful, reload the user data + await user.reload(); + }; + + return ( + <> + +

user role: {user?.publicMetadata.role}

+ + ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +"use client"; + +import { useUser } from "@clerk/nextjs"; + +export default function HomePage() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + // Update data via an API endpoint + const updateMetadata = await fetch("/api/updateMetadata"); + + // Check if the update was successful + if (updateMetadata.message !== "success") { + throw new Error("Error updating"); + } + + // If the update was successful, reload the user data + await user.reload(); + }; + + return ( + <> + +

user role: {user?.publicMetadata.role}

+ + ); +} +``` + +
+
diff --git a/.typedoc/docs/nextjs/auth.mdx b/.typedoc/docs/nextjs/auth.mdx new file mode 100644 index 00000000000..c19bd0e7c4a --- /dev/null +++ b/.typedoc/docs/nextjs/auth.mdx @@ -0,0 +1,5 @@ +The `auth()` helper returns the [`Auth`](/docs/references/backend/types/auth-object) object of the currently active user, as well as the [`redirectToSignIn()`](/docs/references/nextjs/auth#redirect-to-sign-in) method. + +- Only available for App Router. +- Only works on the server-side, such as in Server Components, Route Handlers, and Server Actions. +- Requires [`clerkMiddleware()`](/docs/references/nextjs/clerk-middleware) to be configured. diff --git a/.typedoc/docs/nextjs/build-clerk-props.mdx b/.typedoc/docs/nextjs/build-clerk-props.mdx new file mode 100644 index 00000000000..9059525d586 --- /dev/null +++ b/.typedoc/docs/nextjs/build-clerk-props.mdx @@ -0,0 +1,38 @@ +Clerk uses `buildClerkProps` to inform the client-side helpers of the authentication state of the user. This function is used SSR in the `getServerSideProps` function of your Next.js application. + +## Examples + +### Basic usage + +```tsx {{ filename: 'pages/myServerSidePage.tsx' }} +import { getAuth, buildClerkProps } from "@clerk/nextjs/server"; +import { GetServerSideProps } from "next"; + +export const getServerSideProps: GetServerSideProps = async (ctx) => { + const { userId } = getAuth(ctx.req); + + if (!userId) { + // handle user is not signed in. + } + + // Load any data your application needs for the page using the userId + return { props: { ...buildClerkProps(ctx.req) } }; +}; +``` + +### Usage with `clerkClient` + +The `clerkClient` allows you to access the Clerk API. You can use this to retrieve or update data. + +```tsx {{ filename: 'pages/api/example.ts' }} +import { getAuth, buildClerkProps, clerkClient } from "@clerk/nextjs/server"; +import { GetServerSideProps } from "next"; + +export const getServerSideProps: GetServerSideProps = async (ctx) => { + const { userId } = getAuth(ctx.req); + + const user = userId ? await clerkClient().users.getUser(userId) : undefined; + + return { props: { ...buildClerkProps(ctx.req, { user }) } }; +}; +``` diff --git a/.typedoc/docs/nextjs/clerk-middleware-auth-object.mdx b/.typedoc/docs/nextjs/clerk-middleware-auth-object.mdx new file mode 100644 index 00000000000..c66ae2fec8d --- /dev/null +++ b/.typedoc/docs/nextjs/clerk-middleware-auth-object.mdx @@ -0,0 +1,3 @@ +## Deprecated + +Use `ClerkMiddlewareSessionAuthObject` instead. diff --git a/.typedoc/docs/nextjs/clerk-middleware-options.mdx b/.typedoc/docs/nextjs/clerk-middleware-options.mdx new file mode 100644 index 00000000000..9514009e75d --- /dev/null +++ b/.typedoc/docs/nextjs/clerk-middleware-options.mdx @@ -0,0 +1,29 @@ +The `clerkMiddleware()` function accepts an optional object. The following options are available. + +## Properties + +| Property | Type | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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`. | +| `contentSecurityPolicy?` | `ContentSecurityPolicyOptions` | When set, automatically injects a Content-Security-Policy header(s) compatible with Clerk. | +| `debug?` | `boolean` | If true, additional debug information will be logged to the console. | +| `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/.typedoc/docs/nextjs/clerk-middleware.mdx b/.typedoc/docs/nextjs/clerk-middleware.mdx new file mode 100644 index 00000000000..a1913f86cd4 --- /dev/null +++ b/.typedoc/docs/nextjs/clerk-middleware.mdx @@ -0,0 +1 @@ +The `clerkMiddleware()` helper integrates Clerk authentication into your Next.js application through Middleware. `clerkMiddleware()` is compatible with both the App and Pages routers. diff --git a/.typedoc/docs/nextjs/create-async-get-auth.mdx b/.typedoc/docs/nextjs/create-async-get-auth.mdx new file mode 100644 index 00000000000..e598027e2ba --- /dev/null +++ b/.typedoc/docs/nextjs/create-async-get-auth.mdx @@ -0,0 +1,23 @@ +The async variant of our old `createGetAuth` allows for asynchronous code inside its callback. +Should be used with function like `auth()` that are already asynchronous. + +## Parameters + +| Parameter | Type | +| --------------------------------------- | ------------------------------------------------------------------------ | +| `__namedParameters` | \{ debugLoggerName: string; noAuthStatusMessage: string; \} | +| `__namedParameters.debugLoggerName` | `string` | +| `__namedParameters.noAuthStatusMessage` | `string` | + +## Returns + +### Parameters + +| 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 + +`Promise`\<[`AuthObject`](../backend/auth-object.mdx)\> diff --git a/.typedoc/docs/nextjs/create-sync-get-auth.mdx b/.typedoc/docs/nextjs/create-sync-get-auth.mdx new file mode 100644 index 00000000000..36f2647a57e --- /dev/null +++ b/.typedoc/docs/nextjs/create-sync-get-auth.mdx @@ -0,0 +1,24 @@ +Previous known as `createGetAuth`. We needed to create a sync and async variant in order to allow for improvements +that required dynamic imports (using `require` would not work). +It powers the synchronous top-level api `getAuth()`. + +## Parameters + +| Parameter | Type | +| --------------------------------------- | ------------------------------------------------------------------------ | +| `__namedParameters` | \{ debugLoggerName: string; noAuthStatusMessage: string; \} | +| `__namedParameters.debugLoggerName` | `string` | +| `__namedParameters.noAuthStatusMessage` | `string` | + +## Returns + +### Parameters + +| 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 + +SignedInAuthObject \| SignedOutAuthObject diff --git a/.typedoc/docs/nextjs/current-user.mdx b/.typedoc/docs/nextjs/current-user.mdx new file mode 100644 index 00000000000..268ac18bb80 --- /dev/null +++ b/.typedoc/docs/nextjs/current-user.mdx @@ -0,0 +1,25 @@ +The `currentUser` helper returns the [Backend User](/docs/references/backend/types/backend-user) object of the currently active user. It can be used in Server Components, Route Handlers, and Server Actions. + +Under the hood, this helper: + +- calls `fetch()`, so it is automatically deduped per request. +- uses the [`GET /v1/users/{user_id}`](/docs/reference/backend-api/tag/Users#operation/GetUser) endpoint. +- counts towards the [Backend API request rate limit](/docs/backend-requests/resources/rate-limits). + +## Returns + +`Promise`\<null \| [User](../backend/user.mdx)\> + +## Example + +```tsx {{ filename: 'app/page.tsx' }} +import { currentUser } from "@clerk/nextjs/server"; + +export default async function Page() { + const user = await currentUser(); + + if (!user) return
Not signed in
; + + return
Hello {user?.firstName}
; +} +``` diff --git a/.typedoc/docs/nextjs/get-auth.mdx b/.typedoc/docs/nextjs/get-auth.mdx new file mode 100644 index 00000000000..1312a0929e0 --- /dev/null +++ b/.typedoc/docs/nextjs/get-auth.mdx @@ -0,0 +1,86 @@ +The `getAuth()` helper retrieves authentication state from the request object. + +> [!NOTE] +> If you are using App Router, use the [`auth()` helper](/docs/references/nextjs/auth) instead. + +## Parameters + +| 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 + +SignedInAuthObject \| SignedOutAuthObject — The `Auth` object. See the [Auth reference](/docs/references/backend/types/auth-object) for more information. + +## Examples + +### Protect API routes + +The following example demonstrates how to protect an API route by checking if the `userId` is present in the `getAuth()` response. + +```tsx {{ filename: 'app/api/example/route.ts' }} +import { getAuth } from "@clerk/nextjs/server"; +import type { NextApiRequest, NextApiResponse } from "next"; + +export default async function handler( + req: NextApiRequest, + res: NextApiResponse, +) { + const { userId } = getAuth(req); + + if (!userId) { + return res.status(401).json({ error: "Not authenticated" }); + } + + // Add logic that retrieves the data for the API route + + return res.status(200).json({ userId: userId }); +} +``` + +### Usage with `getToken()` + +`getAuth()` returns [`getToken()`](/docs/references/backend/types/auth-object#get-token), which is a method that returns the current user's session token or a custom JWT template. + +```tsx {{ filename: 'app/api/example/route.ts' }} +import { getAuth } from "@clerk/nextjs/server"; +import type { NextApiRequest, NextApiResponse } from "next"; + +export default async function handler( + req: NextApiRequest, + res: NextApiResponse, +) { + const { getToken } = getAuth(req); + + const token = await getToken({ template: "supabase" }); + + // Add logic that retrieves the data + // from your database using the token + + return res.status(200).json({}); +} +``` + +### Usage with `clerkClient` + +`clerkClient` is used to access the [Backend SDK](/docs/references/backend/overview), which exposes Clerk's Backend API resources. You can use `getAuth()` to pass authentication information that many of the Backend SDK methods require, like the user's ID. + +```tsx {{ filename: 'app/api/example/route.ts' }} +import { clerkClient, getAuth } from "@clerk/nextjs/server"; +import type { NextApiRequest, NextApiResponse } from "next"; + +export default async function handler( + req: NextApiRequest, + res: NextApiResponse, +) { + const { userId } = getAuth(req); + + const client = await clerkClient(); + + const user = userId ? await client.users.getUser(userId) : null; + + return res.status(200).json({}); +} +``` diff --git a/.typedoc/docs/shared/api-url-from-publishable-key.mdx b/.typedoc/docs/shared/api-url-from-publishable-key.mdx new file mode 100644 index 00000000000..0bb0c86f121 --- /dev/null +++ b/.typedoc/docs/shared/api-url-from-publishable-key.mdx @@ -0,0 +1,11 @@ +Get the correct API url based on the publishable key. + +## Parameters + +| Parameter | Type | Description | +| ---------------- | -------- | ----------------------------- | +| `publishableKey` | `string` | The publishable key to parse. | + +## Returns + +"https://api.lclclerk.com" \| "https://api.clerkstage.dev" \| "https://api.clerk.com" — One of Clerk's API URLs. diff --git a/.typedoc/docs/shared/build-clerk-js-script-attributes.mdx b/.typedoc/docs/shared/build-clerk-js-script-attributes.mdx new file mode 100644 index 00000000000..eb0fbc9ae76 --- /dev/null +++ b/.typedoc/docs/shared/build-clerk-js-script-attributes.mdx @@ -0,0 +1,11 @@ +Builds an object of Clerk JS script attributes based on the provided options. + +## Parameters + +| Parameter | Type | Description | +| --------- | -------------------------- | -------------------------------------------------------- | +| `options` | `LoadClerkJsScriptOptions` | The options containing the values for script attributes. | + +## Returns + +`Record`\<`string`, `string`\> — An object containing data attributes to be applied to the script element. diff --git a/.typedoc/docs/shared/build-publishable-key.mdx b/.typedoc/docs/shared/build-publishable-key.mdx new file mode 100644 index 00000000000..2cd1ea56cbe --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/camel-to-snake.mdx b/.typedoc/docs/shared/camel-to-snake.mdx new file mode 100644 index 00000000000..8164e16a4df --- /dev/null +++ b/.typedoc/docs/shared/camel-to-snake.mdx @@ -0,0 +1,11 @@ +Converts a string from camelCase to snake_case. + +## Parameters + +| Parameter | Type | +| --------- | -------------------------------- | +| `str` | undefined \| string | + +## Returns + +`string` diff --git a/.typedoc/docs/shared/clerk-js-script-url.mdx b/.typedoc/docs/shared/clerk-js-script-url.mdx new file mode 100644 index 00000000000..abbd4d3b37d --- /dev/null +++ b/.typedoc/docs/shared/clerk-js-script-url.mdx @@ -0,0 +1,18 @@ +Generates a Clerk JS script URL based on the provided options. + +## Parameters + +| Parameter | Type | Description | +| --------- | -------------------------- | --------------------------------------------------------- | +| `opts` | `LoadClerkJsScriptOptions` | The options to use when building the Clerk JS script URL. | + +## Returns + +`string` — The complete URL to the Clerk JS script. + +## Example + +```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/.typedoc/docs/shared/clerk-runtime-error.mdx b/.typedoc/docs/shared/clerk-runtime-error.mdx new file mode 100644 index 00000000000..d61df8592e2 --- /dev/null +++ b/.typedoc/docs/shared/clerk-runtime-error.mdx @@ -0,0 +1,26 @@ +Custom error class for representing Clerk runtime errors. + +ClerkRuntimeError + +## Example + +```ts +throw new ClerkRuntimeError("An error occurred", { code: "password_invalid" }); +``` + +## Properties + +| Property | Type | Description | Overrides | +| ------------------------------ | -------- | ------------------------------------------------------------------ | --------------- | +| `code` | `string` | A unique code identifying the error, can be used for localization. | - | +| `message` | `string` | The error message. | `Error.message` | + +## Methods + +### toString() + +Returns a string representation of the error. + +#### Returns + +`string` — A formatted string with the error name and message. diff --git a/.typedoc/docs/shared/create-dev-or-staging-url-cache.mdx b/.typedoc/docs/shared/create-dev-or-staging-url-cache.mdx new file mode 100644 index 00000000000..d0f1aeaeda3 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/create-path-matcher.mdx b/.typedoc/docs/shared/create-path-matcher.mdx new file mode 100644 index 00000000000..5fcfc7fed75 --- /dev/null +++ b/.typedoc/docs/shared/create-path-matcher.mdx @@ -0,0 +1,21 @@ +Creates a function that matches paths against a set of patterns. + +## Parameters + +| Parameter | Type | Description | +| ---------- | ------------------ | ------------------------------------------------------- | +| `patterns` | `PathMatcherParam` | A string, RegExp, or array of patterns to match against | + +## Returns + +A function that takes a pathname and returns true if it matches any of the patterns + +### Parameters + +| Parameter | Type | +| ---------- | -------- | +| `pathname` | `string` | + +### Returns + +`boolean` diff --git a/.typedoc/docs/shared/deep-camel-to-snake.mdx b/.typedoc/docs/shared/deep-camel-to-snake.mdx new file mode 100644 index 00000000000..08cd236e036 --- /dev/null +++ b/.typedoc/docs/shared/deep-camel-to-snake.mdx @@ -0,0 +1,13 @@ +Transforms camelCased objects/ arrays to snake_cased. +This function recursively traverses all objects and arrays of the passed value +camelCased keys are removed. + +## Parameters + +| Parameter | Type | +| --------- | ----- | +| `obj` | `any` | + +## Returns + +`any` diff --git a/.typedoc/docs/shared/deep-snake-to-camel.mdx b/.typedoc/docs/shared/deep-snake-to-camel.mdx new file mode 100644 index 00000000000..3ad646a85be --- /dev/null +++ b/.typedoc/docs/shared/deep-snake-to-camel.mdx @@ -0,0 +1,13 @@ +Transforms snake_cased objects/ arrays to camelCased. +This function recursively traverses all objects and arrays of the passed value +camelCased keys are removed. + +## Parameters + +| Parameter | Type | +| --------- | ----- | +| `obj` | `any` | + +## Returns + +`any` diff --git a/.typedoc/docs/shared/deprecated-object-property.mdx b/.typedoc/docs/shared/deprecated-object-property.mdx new file mode 100644 index 00000000000..611635bfb00 --- /dev/null +++ b/.typedoc/docs/shared/deprecated-object-property.mdx @@ -0,0 +1,21 @@ +Mark object property as deprecated. + +A console WARNING will be displayed when object property is being accessed. + +1. Deprecate object property + const obj = { something: 'aloha' }; + +deprecatedObjectProperty(obj, 'something', 'Use `somethingElse` instead.'); + +## Parameters + +| Parameter | Type | +| ---------- | --------------------------- | +| `obj` | `Record`\<`string`, `any`\> | +| `propName` | `string` | +| `warning` | `string` | +| `key?` | `string` | + +## Returns + +`void` diff --git a/.typedoc/docs/shared/derive-state.mdx b/.typedoc/docs/shared/derive-state.mdx new file mode 100644 index 00000000000..c5a89ed30bd --- /dev/null +++ b/.typedoc/docs/shared/derive-state.mdx @@ -0,0 +1,29 @@ +Derives authentication state based on the current rendering context (SSR or client-side). + +## Parameters + +| Parameter | Type | +| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `clerkOperational` | `boolean` | +| `state` | `Resources` | +| `initialState` | undefined \| 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; \}\> | + +## Returns + +\{ actor: undefined \| null \| \{ [x: string]: unknown; sub: string; \}; factorVerificationAge: null \| \[number, number\]; organization: undefined \| null \| [OrganizationResource](/docs/references/javascript/organization); orgId: undefined \| null \| string; orgPermissions: undefined \| null \| Autocomplete\[]; orgRole: undefined \| null \| string; orgSlug: undefined \| null \| string; session: undefined \| null \| [SignedInSessionResource](/docs/references/javascript/session); sessionClaims: undefined \| null \| JwtPayload; sessionId: undefined \| null \| string; sessionStatus: undefined \| "active" \| "pending"; user: undefined \| null \| [UserResource](/docs/references/javascript/user); userId: undefined \| null \| string; \} + +| Name | Type | +| ----------------------- | -------------------------------------------------------------------------------------------------- | +| `actor` | undefined \| null \| \{ [x: string]: unknown; sub: string; \} | +| `factorVerificationAge` | null \| \[number, number\] | +| `organization` | undefined \| null \| [OrganizationResource](/docs/references/javascript/organization) | +| `orgId` | undefined \| null \| string | +| `orgPermissions` | undefined \| null \| Autocomplete\[] | +| `orgRole` | undefined \| null \| string | +| `orgSlug` | undefined \| null \| string | +| `session` | undefined \| null \| [SignedInSessionResource](/docs/references/javascript/session) | +| `sessionClaims` | undefined \| null \| JwtPayload | +| `sessionId` | undefined \| null \| string | +| `sessionStatus` | undefined \| "active" \| "pending" | +| `user` | undefined \| null \| [UserResource](/docs/references/javascript/user) | +| `userId` | undefined \| null \| string | diff --git a/.typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx b/.typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx new file mode 100644 index 00000000000..3f8f20906e7 --- /dev/null +++ b/.typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx @@ -0,0 +1,13 @@ +Gets the **clerk_db_jwt JWT from either the hash or the search +Side effect: +Removes **clerk_db_jwt JWT from the URL (hash and searchParams) and updates the browser history + +## Parameters + +| Parameter | Type | +| --------- | ----- | +| `url` | `URL` | + +## Returns + +`string` diff --git a/.typedoc/docs/shared/fast-deep-merge-and-replace.mdx b/.typedoc/docs/shared/fast-deep-merge-and-replace.mdx new file mode 100644 index 00000000000..b07891dbf5c --- /dev/null +++ b/.typedoc/docs/shared/fast-deep-merge-and-replace.mdx @@ -0,0 +1,14 @@ +Merges 2 objects without creating new object references +The merged props will appear on the `target` object +If `target` already has a value for a given key it will not be overwritten + +## Parameters + +| Parameter | Type | +| --------- | ---------------------------------------------------- | +| `source` | undefined \| null \| Record\ | +| `target` | undefined \| null \| Record\ | + +## Returns + +`void` diff --git a/.typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx b/.typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx new file mode 100644 index 00000000000..4c846eea8c0 --- /dev/null +++ b/.typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx @@ -0,0 +1,14 @@ +Retrieve the clerk-js major tag using the major version from the pkgVersion +param or use the frontendApi to determine if the canary tag should be used. +The default tag is `latest`. + +## Parameters + +| Parameter | Type | +| ------------- | -------- | +| `frontendApi` | `string` | +| `version?` | `string` | + +## Returns + +`string` diff --git a/.typedoc/docs/shared/get-cookie-suffix.mdx b/.typedoc/docs/shared/get-cookie-suffix.mdx new file mode 100644 index 00000000000..ac115fcc8b1 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/get-env-variable.mdx b/.typedoc/docs/shared/get-env-variable.mdx new file mode 100644 index 00000000000..a60f14161bd --- /dev/null +++ b/.typedoc/docs/shared/get-env-variable.mdx @@ -0,0 +1,12 @@ +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. | + +## Returns + +`string` — The environment variable value or empty string if not found. diff --git a/.typedoc/docs/shared/get-non-undefined-values.mdx b/.typedoc/docs/shared/get-non-undefined-values.mdx new file mode 100644 index 00000000000..0d051136c43 --- /dev/null +++ b/.typedoc/docs/shared/get-non-undefined-values.mdx @@ -0,0 +1,11 @@ +Get all non-undefined values from an object. + +## Parameters + +| Parameter | Type | +| --------- | ---- | +| `obj` | `T` | + +## Returns + +`Partial`\<`T`\> diff --git a/.typedoc/docs/shared/get-script-url.mdx b/.typedoc/docs/shared/get-script-url.mdx new file mode 100644 index 00000000000..66218a1414c --- /dev/null +++ b/.typedoc/docs/shared/get-script-url.mdx @@ -0,0 +1,14 @@ +Retrieve the clerk-js script url from the frontendApi and the major tag +using the [getClerkJsMajorVersionOrTag](get-clerk-js-major-version-or-tag.mdx) or a provided clerkJSVersion tag. + +## Parameters + +| Parameter | Type | +| ----------------------------------- | ------------------------------------------- | +| `frontendApi` | `string` | +| `__namedParameters` | \{ clerkJSVersion?: string; \} | +| `__namedParameters.clerkJSVersion?` | `string` | + +## Returns + +`string` diff --git a/.typedoc/docs/shared/get-suffixed-cookie-name.mdx b/.typedoc/docs/shared/get-suffixed-cookie-name.mdx new file mode 100644 index 00000000000..f4f707d155e --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/icon-image-url.mdx b/.typedoc/docs/shared/icon-image-url.mdx new file mode 100644 index 00000000000..e0e3fbde62d --- /dev/null +++ b/.typedoc/docs/shared/icon-image-url.mdx @@ -0,0 +1,13 @@ +Returns the URL for a static image +using the new img.clerk.com service + +## Parameters + +| Parameter | Type | +| --------- | ---------------------------- | +| `id` | `string` | +| `format` | "svg" \| "jpeg" | + +## Returns + +`string` diff --git a/.typedoc/docs/shared/in-browser.mdx b/.typedoc/docs/shared/in-browser.mdx new file mode 100644 index 00000000000..e08842d7935 --- /dev/null +++ b/.typedoc/docs/shared/in-browser.mdx @@ -0,0 +1,5 @@ +Checks if the window object is defined. You can also use this to check if something is happening on the client side. + +## Returns + +`boolean` diff --git a/.typedoc/docs/shared/is-browser-online.mdx b/.typedoc/docs/shared/is-browser-online.mdx new file mode 100644 index 00000000000..a4f7d95040f --- /dev/null +++ b/.typedoc/docs/shared/is-browser-online.mdx @@ -0,0 +1,5 @@ +Checks if the current environment is a browser and if the navigator is online. + +## Returns + +`boolean` diff --git a/.typedoc/docs/shared/is-clerk-runtime-error.mdx b/.typedoc/docs/shared/is-clerk-runtime-error.mdx new file mode 100644 index 00000000000..c5c725edb77 --- /dev/null +++ b/.typedoc/docs/shared/is-clerk-runtime-error.mdx @@ -0,0 +1,24 @@ +Checks if the provided error object is an instance of ClerkRuntimeError. + +## Parameters + +| Parameter | Type | Description | +| --------- | ----- | -------------------------- | +| `err` | `any` | The error object to check. | + +## Returns + +`err is ClerkRuntimeError` — True if the error is a ClerkRuntimeError, false otherwise. + +## Example + +```ts +const error = new ClerkRuntimeError("An error occurred"); +if (isClerkRuntimeError(error)) { + // Handle ClerkRuntimeError + console.error("ClerkRuntimeError:", error.message); +} else { + // Handle other errors + console.error("Other error:", error.message); +} +``` diff --git a/.typedoc/docs/shared/is-development-from-publishable-key.mdx b/.typedoc/docs/shared/is-development-from-publishable-key.mdx new file mode 100644 index 00000000000..6d17f30a7d4 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/is-development-from-secret-key.mdx b/.typedoc/docs/shared/is-development-from-secret-key.mdx new file mode 100644 index 00000000000..6d2785217a4 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/is-ipv4-address.mdx b/.typedoc/docs/shared/is-ipv4-address.mdx new file mode 100644 index 00000000000..ae9f7620269 --- /dev/null +++ b/.typedoc/docs/shared/is-ipv4-address.mdx @@ -0,0 +1,11 @@ +Checks if a string is a valid IPv4 address. + +## Parameters + +| Parameter | Type | +| --------- | ---------------------------------------- | +| `str` | undefined \| null \| string | + +## Returns + +`boolean` — True if the string is a valid IPv4 address, false otherwise. diff --git a/.typedoc/docs/shared/is-production-from-publishable-key.mdx b/.typedoc/docs/shared/is-production-from-publishable-key.mdx new file mode 100644 index 00000000000..8aa8847074c --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/is-production-from-secret-key.mdx b/.typedoc/docs/shared/is-production-from-secret-key.mdx new file mode 100644 index 00000000000..289067ce0df --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/is-publishable-key.mdx b/.typedoc/docs/shared/is-publishable-key.mdx new file mode 100644 index 00000000000..b45694915b5 --- /dev/null +++ b/.typedoc/docs/shared/is-publishable-key.mdx @@ -0,0 +1,11 @@ +Checks if the provided key is a valid publishable key. + +## Parameters + +| Parameter | Type | Description | +| --------- | -------- | ------------------------------------------------------------------- | +| `key` | `string` | The key to be checked. Defaults to an empty string if not provided. | + +## Returns + +`boolean` — `true` if 'key' is a valid publishable key, `false` otherwise. diff --git a/.typedoc/docs/shared/is-staging.mdx b/.typedoc/docs/shared/is-staging.mdx new file mode 100644 index 00000000000..1491f1c9705 --- /dev/null +++ b/.typedoc/docs/shared/is-staging.mdx @@ -0,0 +1,11 @@ +Check if the frontendApi ends with a staging domain + +## Parameters + +| Parameter | Type | +| ------------- | -------- | +| `frontendApi` | `string` | + +## Returns + +`boolean` diff --git a/.typedoc/docs/shared/is-truthy.mdx b/.typedoc/docs/shared/is-truthy.mdx new file mode 100644 index 00000000000..9c9ea5413ba --- /dev/null +++ b/.typedoc/docs/shared/is-truthy.mdx @@ -0,0 +1,11 @@ +A function to determine if a value is truthy. + +## Parameters + +| Parameter | Type | +| --------- | --------- | +| `value` | `unknown` | + +## Returns + +`boolean` — True for `true`, true, positive numbers. False for `false`, false, 0, negative integers and anything else. diff --git a/.typedoc/docs/shared/is-valid-browser-online.mdx b/.typedoc/docs/shared/is-valid-browser-online.mdx new file mode 100644 index 00000000000..cbc8b340524 --- /dev/null +++ b/.typedoc/docs/shared/is-valid-browser-online.mdx @@ -0,0 +1,5 @@ +Runs `isBrowserOnline` and `isValidBrowser` to check if the current environment is a valid browser and if the navigator is online. + +## Returns + +`boolean` diff --git a/.typedoc/docs/shared/is-valid-browser.mdx b/.typedoc/docs/shared/is-valid-browser.mdx new file mode 100644 index 00000000000..5d89b5b376c --- /dev/null +++ b/.typedoc/docs/shared/is-valid-browser.mdx @@ -0,0 +1,5 @@ +Checks if the current environment is a browser and the user agent is not a bot. + +## Returns + +`boolean` diff --git a/.typedoc/docs/shared/isomorphic-atob.mdx b/.typedoc/docs/shared/isomorphic-atob.mdx new file mode 100644 index 00000000000..ed412ce6632 --- /dev/null +++ b/.typedoc/docs/shared/isomorphic-atob.mdx @@ -0,0 +1,12 @@ +A function that decodes a string of data which has been encoded using base-64 encoding. +Uses `atob` if available, otherwise uses `Buffer` from `global`. If neither are available, returns the data as-is. + +## Parameters + +| Parameter | Type | +| --------- | -------- | +| `data` | `string` | + +## Returns + +`string` diff --git a/.typedoc/docs/shared/load-clerk-js-script.mdx b/.typedoc/docs/shared/load-clerk-js-script.mdx new file mode 100644 index 00000000000..8efc3db1bc0 --- /dev/null +++ b/.typedoc/docs/shared/load-clerk-js-script.mdx @@ -0,0 +1,26 @@ +Hotloads the Clerk JS script with robust failure detection. + +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 + +| Parameter | Type | Description | +| --------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `opts?` | `LoadClerkJsScriptOptions` | The options used to build the Clerk JS script URL and load the script. Must include a `publishableKey` if no existing script is found. | + +## Returns + +`Promise`\<null \| HTMLScriptElement\> — Promise that resolves with null if Clerk loads successfully, or rejects with an error. + +## Example + +```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/.typedoc/docs/shared/pages-or-infinite-options.mdx b/.typedoc/docs/shared/pages-or-infinite-options.mdx new file mode 100644 index 00000000000..c2a7ab7b9c4 --- /dev/null +++ b/.typedoc/docs/shared/pages-or-infinite-options.mdx @@ -0,0 +1,4 @@ +| 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`. | diff --git a/.typedoc/docs/shared/paginated-hook-config.mdx b/.typedoc/docs/shared/paginated-hook-config.mdx new file mode 100644 index 00000000000..99f8acfd945 --- /dev/null +++ b/.typedoc/docs/shared/paginated-hook-config.mdx @@ -0,0 +1,4 @@ +| Name | Type | Description | +| ------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `infinite?` | `boolean` | If `true`, newly fetched data will be appended to the existing list rather than replacing it. Useful for implementing infinite scroll functionality. Defaults to `false`. | +| `keepPreviousData?` | `boolean` | If `true`, the previous data will be kept in the cache until new data is fetched. Defaults to `false`. | diff --git a/.typedoc/docs/shared/paginated-resources.mdx b/.typedoc/docs/shared/paginated-resources.mdx new file mode 100644 index 00000000000..a6608f7e55f --- /dev/null +++ b/.typedoc/docs/shared/paginated-resources.mdx @@ -0,0 +1,17 @@ +| Property | Type | Description | +| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `count` | `number` | The total count of data that exist remotely. | +| `data` | T[] | An array that contains the fetched data. For example, for the `memberships` attribute, data will be an array of [`OrganizationMembership`](/docs/references/javascript/types/organization-membership) objects. | +| `error` | null \| ClerkAPIResponseError | Clerk's API response error object. | +| `fetchNext` | () => void | A function that triggers the next page to be loaded. This is the same as `fetchPage(page => Math.min(pageCount, page + 1))`. | +| `fetchPage` | `ValueOrSetter`\<`number`\> | A function that triggers a specific page to be loaded. | +| `fetchPrevious` | () => void | A function that triggers the previous page to be loaded. This is the same as `fetchPage(page => Math.max(0, page - 1))`. | +| `hasNextPage` | `boolean` | A boolean that indicates if there are available pages to be fetched. | +| `hasPreviousPage` | `boolean` | A boolean that indicates if there are available pages to be fetched. | +| `isError` | `boolean` | A boolean that indicates the request failed. | +| `isFetching` | `boolean` | A boolean that is `true` if there is an ongoing request or a revalidation. | +| `isLoading` | `boolean` | A boolean that is `true` if there is an ongoing request and there is no fetched data. | +| `page` | `number` | The current page. | +| `pageCount` | `number` | The total amount of pages. It is calculated based on `count`, `initialPage`, and `pageSize`. | +| `revalidate` | () => Promise\ | A function that triggers a revalidation of the current page. | +| `setData` | `Infinite` _extends_ `true` ? `CacheSetter`\<(undefined \| [ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\)[]\> : `CacheSetter`\<undefined \| [ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\\> | A function that allows you to set the data manually. | diff --git a/.typedoc/docs/shared/parse-publishable-key.mdx b/.typedoc/docs/shared/parse-publishable-key.mdx new file mode 100644 index 00000000000..2c9e088ff79 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/shared/read-json-file.mdx b/.typedoc/docs/shared/read-json-file.mdx new file mode 100644 index 00000000000..f97f1f5a6b4 --- /dev/null +++ b/.typedoc/docs/shared/read-json-file.mdx @@ -0,0 +1,14 @@ +Read an expected JSON type File. + +Probably paired with: + + +## Parameters + +| Parameter | Type | +| --------- | ------ | +| `file` | `File` | + +## Returns + +`Promise`\<`unknown`\> diff --git a/.typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx b/.typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx new file mode 100644 index 00000000000..c0d014ec37b --- /dev/null +++ b/.typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx @@ -0,0 +1,17 @@ +Sets the package name for error messages during ClerkJS script loading. + +## Parameters + +| Parameter | Type | Description | +| ------------- | -------- | ------------------------------------------------------------------------------ | +| `packageName` | `string` | The name of the package to use in error messages (e.g., '@clerk/clerk-react'). | + +## Returns + +`void` + +## Example + +```typescript +setClerkJsLoadingErrorPackageName("@clerk/clerk-react"); +``` diff --git a/.typedoc/docs/shared/snake-to-camel.mdx b/.typedoc/docs/shared/snake-to-camel.mdx new file mode 100644 index 00000000000..b860d97abee --- /dev/null +++ b/.typedoc/docs/shared/snake-to-camel.mdx @@ -0,0 +1,11 @@ +Converts a string from snake_case to camelCase. + +## Parameters + +| Parameter | Type | +| --------- | -------------------------------- | +| `str` | undefined \| string | + +## Returns + +`string` diff --git a/.typedoc/docs/shared/titleize.mdx b/.typedoc/docs/shared/titleize.mdx new file mode 100644 index 00000000000..0a38d195916 --- /dev/null +++ b/.typedoc/docs/shared/titleize.mdx @@ -0,0 +1,17 @@ +Converts the first character of a string to uppercase. + +## Parameters + +| Parameter | Type | Description | +| --------- | ---------------------------------------- | --------------------------- | +| `str` | undefined \| null \| string | The string to be converted. | + +## Returns + +`string` — The modified string with the rest of the string unchanged. + +## Example + +```ts +titleize("hello world"); // 'Hello world' +``` diff --git a/.typedoc/docs/shared/to-sentence.mdx b/.typedoc/docs/shared/to-sentence.mdx new file mode 100644 index 00000000000..ad4d413ed9d --- /dev/null +++ b/.typedoc/docs/shared/to-sentence.mdx @@ -0,0 +1,11 @@ +Convert words to a sentence. + +## Parameters + +| Parameter | Type | Description | +| --------- | --------------------- | ------------------------------- | +| `items` | string[] | An array of words to be joined. | + +## Returns + +`string` — A string with the items joined by a comma and the last item joined by ", or". diff --git a/.typedoc/docs/shared/use-clerk.mdx b/.typedoc/docs/shared/use-clerk.mdx new file mode 100644 index 00000000000..074e0243ca1 --- /dev/null +++ b/.typedoc/docs/shared/use-clerk.mdx @@ -0,0 +1,43 @@ +> [!WARNING] +> This hook should only be used for advanced use cases, such as building a completely custom OAuth flow or as an escape hatch to access to the `Clerk` object. + +The `useClerk()` hook provides access to the [`Clerk`](/docs/references/javascript/clerk) object, allowing you to build alternatives to any Clerk Component. + +## Returns + +[Clerk](/docs/references/javascript/clerk) — The `useClerk()` hook returns the `Clerk` object, which includes all the methods and properties listed in the [`Clerk` reference](/docs/references/javascript/clerk). + +## Example + +The following example uses the `useClerk()` hook to access the `clerk` object. The `clerk` object is used to call the [`openSignIn()`](/docs/references/javascript/clerk#sign-in) method to open the sign-in modal. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useClerk } from "@clerk/clerk-react"; + +export default function Home() { + const clerk = useClerk(); + + return ; +} +``` + + + + +```tsx {{ filename: 'app/page.tsx' }} +"use client"; + +import { useClerk } from "@clerk/nextjs"; + +export default function HomePage() { + const clerk = useClerk(); + + return ; +} +``` + + + diff --git a/.typedoc/docs/shared/use-organization-list-params.mdx b/.typedoc/docs/shared/use-organization-list-params.mdx new file mode 100644 index 00000000000..592db3abc4f --- /dev/null +++ b/.typedoc/docs/shared/use-organization-list-params.mdx @@ -0,0 +1,5 @@ +| Property | Type | Description | +| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `userInvitations?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: "expired" \| "revoked" \| "pending" \| "accepted"; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the invitations by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| +| `userMemberships?` | true \| \{ initialPage?: number; pageSize?: number; \} & object & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • Any of the properties described in [Shared properties](#shared-properties).
| +| `userSuggestions?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: "pending" \| "accepted" \| ("pending" \| "accepted")[]; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the suggestions by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| diff --git a/.typedoc/docs/shared/use-organization-list-return.mdx b/.typedoc/docs/shared/use-organization-list-return.mdx new file mode 100644 index 00000000000..a6d6a3dc742 --- /dev/null +++ b/.typedoc/docs/shared/use-organization-list-return.mdx @@ -0,0 +1,8 @@ +| Property | Type | Description | +| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `createOrganization` | undefined \| ([CreateOrganizationParams](#create-organization-params)) => Promise\<[OrganizationResource](/docs/references/javascript/organization)\> | A function that returns a `Promise` which resolves to the newly created `Organization`. | +| `isLoaded` | `boolean` | A boolean that indicates whether Clerk has completed initialization and there is an authenticated user. Initially `false`, becomes `true` once Clerk loads with a user. | +| `setActive` | undefined \| ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session and/or organization. | +| `userInvitations` | PaginatedResourcesWithDefault\<[UserOrganizationInvitationResource](/docs/references/javascript/types/user-organization-invitation)\> \| [PaginatedResources](#paginated-resources)\<[UserOrganizationInvitationResource](/docs/references/javascript/types/user-organization-invitation), T\["userInvitations"\] _extends_ \{ infinite: true; \} ? true : false\> | Returns `PaginatedResources` which includes a list of the user's organization invitations. | +| `userMemberships` | PaginatedResourcesWithDefault\<[OrganizationMembershipResource](/docs/references/javascript/types/organization-membership)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationMembershipResource](/docs/references/javascript/types/organization-membership), T\["userMemberships"\] _extends_ \{ infinite: true; \} ? true : false\> | Returns `PaginatedResources` which includes a list of the user's organization memberships. | +| `userSuggestions` | PaginatedResourcesWithDefault\<[OrganizationSuggestionResource](/docs/references/javascript/types/organization-suggestion)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationSuggestionResource](/docs/references/javascript/types/organization-suggestion), T\["userSuggestions"\] _extends_ \{ infinite: true; \} ? true : false\> | Returns `PaginatedResources` which includes a list of suggestions for organizations that the user can join. | diff --git a/.typedoc/docs/shared/use-organization-list.mdx b/.typedoc/docs/shared/use-organization-list.mdx new file mode 100644 index 00000000000..ed93deaad06 --- /dev/null +++ b/.typedoc/docs/shared/use-organization-list.mdx @@ -0,0 +1,150 @@ +The `useOrganizationList()` hook provides access to the current user's organization memberships, invitations, and suggestions. It also includes methods for creating new organizations and managing the active organization. + +## Parameters + +| Parameter | Type | +| --------- | ---- | +| `params?` | `T` | + +## Returns + +[`UseOrganizationListReturn`](use-organization-list-return.mdx)\<`T`\> + +## Examples + +### Expanding and paginating attributes + +To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. So by default, the `userMemberships`, `userInvitations`, and `userSuggestions` attributes are not populated. You must pass true or an object with the desired properties to fetch and paginate the data. + +```tsx +// userMemberships.data will never be populated +const { userMemberships } = useOrganizationList(); + +// Use default values to fetch userMemberships, such as initialPage = 1 and pageSize = 10 +const { userMemberships } = useOrganizationList({ + userMemberships: true, +}); + +// Pass your own values to fetch userMemberships +const { userMemberships } = useOrganizationList({ + userMemberships: { + pageSize: 20, + initialPage: 2, // skips the first page + }, +}); + +// Aggregate pages in order to render an infinite list +const { userMemberships } = useOrganizationList({ + userMemberships: { + infinite: true, + }, +}); +``` + +### Infinite pagination + +The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `userMemberships` attribute will be populated with the first page of the user's organization memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. + +```tsx {{ filename: 'src/components/JoinedOrganizations.tsx' }} +import { useOrganizationList } from "@clerk/clerk-react"; +import React from "react"; + +const JoinedOrganizations = () => { + const { isLoaded, setActive, userMemberships } = useOrganizationList({ + userMemberships: { + infinite: true, + }, + }); + + if (!isLoaded) { + return <>Loading; + } + + return ( + <> +
    + {userMemberships.data?.map((mem) => ( +
  • + {mem.organization.name} + +
  • + ))} +
+ + + + ); +}; + +export default JoinedOrganizations; +``` + +### Simple pagination + +The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `userInvitations` attribute will be populated with the first page of invitations. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of invitations. + +Notice the difference between this example's pagination and the infinite pagination example above. + +```tsx {{ filename: 'src/components/UserInvitationsTable.tsx' }} +import { useOrganizationList } from "@clerk/clerk-react"; +import React from "react"; + +const UserInvitationsTable = () => { + const { isLoaded, userInvitations } = useOrganizationList({ + userInvitations: { + infinite: true, + keepPreviousData: true, + }, + }); + + if (!isLoaded || userInvitations.isLoading) { + return <>Loading; + } + + return ( + <> + + + + + + + + + + {userInvitations.data?.map((inv) => ( + + + + + ))} + +
EmailOrg name
{inv.emailAddress}{inv.publicOrganizationData.name}
+ + + + + ); +}; + +export default UserInvitationsTable; +``` diff --git a/.typedoc/docs/shared/use-organization-params.mdx b/.typedoc/docs/shared/use-organization-params.mdx new file mode 100644 index 00000000000..cfbb1bca26d --- /dev/null +++ b/.typedoc/docs/shared/use-organization-params.mdx @@ -0,0 +1,7 @@ +| Property | Type | Description | +| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `domains?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ enrollmentMode?: "manual_invitation" \| "automatic_invitation" \| "automatic_suggestion"; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `enrollmentMode`: A string that filters the domains by the provided [enrollment mode](/docs/organizations/verified-domains#enrollment-mode).
  • Any of the properties described in [Shared properties](#shared-properties).
| +| `invitations?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: ("expired" \| "revoked" \| "pending" \| "accepted")[]; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the invitations by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| +| `membershipRequests?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: "expired" \| "revoked" \| "pending" \| "accepted"; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the membership requests by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| +| `memberships?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ query?: string; role?: string[]; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `role`: An array of [`OrganizationCustomRoleKey`](/docs/references/javascript/types/organization-custom-role-key).
  • `query`: A string that filters the memberships by the provided string.
  • Any of the properties described in [Shared properties](#shared-properties).
| +| `subscriptions?` | true \| \{ initialPage?: number; pageSize?: number; \} & object & \{ orgId?: string; \} & \{ infinite?: boolean; keepPreviousData?: 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. If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `orgId`: A string that filters the subscriptions by the provided organization ID.
  • Any of the properties described in [Shared properties](#shared-properties).
| diff --git a/.typedoc/docs/shared/use-organization-return.mdx b/.typedoc/docs/shared/use-organization-return.mdx new file mode 100644 index 00000000000..db16c2a130b --- /dev/null +++ b/.typedoc/docs/shared/use-organization-return.mdx @@ -0,0 +1,10 @@ +| Property | Type | Description | +| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `domains` | null \| PaginatedResourcesWithDefault\<[OrganizationDomainResource](/docs/references/javascript/types/organization-domain)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationDomainResource](/docs/references/javascript/types/organization-domain), T\["membershipRequests"\] _extends_ \{ infinite: true; \} ? true : false\> | Includes a paginated list of the organization's domains. | +| `invitations` | null \| PaginatedResourcesWithDefault\<[OrganizationInvitationResource](/docs/references/javascript/types/organization-invitation)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationInvitationResource](/docs/references/javascript/types/organization-invitation), T\["invitations"\] _extends_ \{ infinite: true; \} ? true : false\> | Includes a paginated list of the organization's invitations. | +| `isLoaded` | `boolean` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `membership` | undefined \| null \| [OrganizationMembershipResource](/docs/references/javascript/types/organization-membership) | The current organization membership. | +| `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\<[CommerceSubscriptionItemResource](/docs/references/javascript/types/commerce-subscription-item-resource)\> \| [PaginatedResources](#paginated-resources)\<[CommerceSubscriptionItemResource](/docs/references/javascript/types/commerce-subscription-item-resource), 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/.typedoc/docs/shared/use-organization.mdx b/.typedoc/docs/shared/use-organization.mdx new file mode 100644 index 00000000000..bb92bf55245 --- /dev/null +++ b/.typedoc/docs/shared/use-organization.mdx @@ -0,0 +1,130 @@ +The `useOrganization()` hook retrieves attributes of the currently active organization. + +## Parameters + +| Parameter | Type | +| --------- | ---- | +| `params?` | `T` | + +## Returns + +[`UseOrganizationReturn`](use-organization-return.mdx)\<`T`\> + +## Examples + +### Expand and paginate attributes + +To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. By default, the `memberships`, `invitations`, `membershipRequests`, and `domains` attributes are not populated. You must pass `true` or an object with the desired properties to fetch and paginate the data. + +```tsx +// invitations.data will never be populated. +const { invitations } = useOrganization(); + +// Use default values to fetch invitations, such as initialPage = 1 and pageSize = 10 +const { invitations } = useOrganization({ + invitations: true, +}); + +// Pass your own values to fetch invitations +const { invitations } = useOrganization({ + invitations: { + pageSize: 20, + initialPage: 2, // skips the first page + }, +}); + +// Aggregate pages in order to render an infinite list +const { invitations } = useOrganization({ + invitations: { + infinite: true, + }, +}); +``` + +### Infinite pagination + +The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. + +```tsx +import { useOrganization } from '@clerk/clerk-react' + +export default function MemberList() { + const { memberships } = useOrganization({ + memberships: { + infinite: true, // Append new data to the existing list + keepPreviousData: true, // Persist the cached data until the new data has been fetched + }, + }) + + if (!memberships) { + // Handle loading state + return null + } + + return ( +
+

Organization members

+
    + {memberships.data?.map((membership) => ( +
  • + {membership.publicUserData.firstName} {membership.publicUserData.lastName} < + {membership.publicUserData.identifier}> :: {membership.role} +
  • + ))} +
+ + +
+ ) +} +``` + +### Simple pagination + +The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of memberships. + +Notice the difference between this example's pagination and the infinite pagination example above. + +```tsx +import { useOrganization } from '@clerk/clerk-react' + +export default function MemberList() { + const { memberships } = useOrganization({ + memberships: { + keepPreviousData: true, // Persist the cached data until the new data has been fetched + }, + }) + + if (!memberships) { + // Handle loading state + return null + } + + return ( +
+

Organization members

+
    + {memberships.data?.map((membership) => ( +
  • + {membership.publicUserData.firstName} {membership.publicUserData.lastName} < + {membership.publicUserData.identifier}> :: {membership.role} +
  • + ))} +
+ + + + +
+ ) +} +``` diff --git a/.typedoc/docs/shared/use-reverification.mdx b/.typedoc/docs/shared/use-reverification.mdx new file mode 100644 index 00000000000..f307df52533 --- /dev/null +++ b/.typedoc/docs/shared/use-reverification.mdx @@ -0,0 +1,55 @@ +> [!WARNING] +> +> Depending on the SDK you're using, this feature requires `@clerk/nextjs@6.12.7` or later, `@clerk/clerk-react@5.25.1` or later, and `@clerk/clerk-js@5.57.1` or later. + +The `useReverification()` hook is used to handle a session's reverification flow. If a request requires reverification, a modal will display, prompting the user to verify their credentials. Upon successful verification, the original request will automatically retry. + +## Parameters + +| Parameter | Type | +| ---------- | --------- | +| `fetcher` | `Fetcher` | +| `options?` | `Options` | + +## Returns + +`UseReverificationResult`\<`Fetcher`\> — The `useReverification()` hook returns an array with the "enhanced" fetcher. + +## Example + +### Handle cancellation of the reverification process + +The following example demonstrates how to handle scenarios where a user cancels the reverification flow, such as closing the modal, which might result in `myData` being `null`. + +In the following example, `myFetcher` would be a function in your backend that fetches data from the route that requires reverification. See the [guide on how to require reverification](/docs/guides/reverification) for more information. + +```tsx {{ filename: 'src/components/MyButton.tsx' }} +import { useReverification } from "@clerk/clerk-react"; +import { isReverificationCancelledError } from "@clerk/clerk-react/error"; + +type MyData = { + balance: number; +}; + +export function MyButton() { + const fetchMyData = () => + fetch("/api/balance").then((res) => res.json() as Promise); + const enhancedFetcher = useReverification(fetchMyData); + + const handleClick = async () => { + try { + const myData = await enhancedFetcher(); + // ^ is types as `MyData` + } catch (e) { + // Handle error returned from the fetcher here + + // You can also handle cancellation with the following + if (isReverificationCancelledError(err)) { + // Handle the cancellation error here + } + } + }; + + return ; +} +``` diff --git a/.typedoc/docs/shared/use-session-list.mdx b/.typedoc/docs/shared/use-session-list.mdx new file mode 100644 index 00000000000..6602a87d186 --- /dev/null +++ b/.typedoc/docs/shared/use-session-list.mdx @@ -0,0 +1,77 @@ +The `useSessionList()` hook returns an array of [`Session`](/docs/references/javascript/session) objects that have been registered on the client device. + +## 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. + + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `sessions` | `undefined` | A list of sessions that have been registered on the client device. | +| `setActive` | `undefined` | A function that sets the active session and/or organization. | + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `sessions` | [SessionResource](/docs/references/javascript/session)[] | A list of sessions that have been registered on the client device. | +| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session and/or organization. | + + + +## Example + +### Get a list of sessions + +The following example uses `useSessionList()` to get a list of sessions that have been registered on the client device. The `sessions` property is used to show the number of times the user has visited the page. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useSessionList } from "@clerk/clerk-react"; + +export default function Home() { + const { isLoaded, sessions } = useSessionList(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return ( +
+

Welcome back. You've been here {sessions.length} times before.

+
+ ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +"use client"; + +import { useSessionList } from "@clerk/nextjs"; + +export default function HomePage() { + const { isLoaded, sessions } = useSessionList(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + return ( +
+

Welcome back. You've been here {sessions.length} times before.

+
+ ); +} +``` + +
+
diff --git a/.typedoc/docs/shared/use-session.mdx b/.typedoc/docs/shared/use-session.mdx new file mode 100644 index 00000000000..1abbc16b9b6 --- /dev/null +++ b/.typedoc/docs/shared/use-session.mdx @@ -0,0 +1,98 @@ +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. + +## 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. + + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `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 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 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` | `boolean` | A boolean that indicates whether a user is currently signed in. | +| `session` | [`SignedInSessionResource`](/docs/references/javascript/session) | The current session for the user. | + + + +## Example + +### Access the `Session` object + +The following example uses the `useSession()` hook to access the `Session` object, which has the `lastActiveAt` property. The `lastActiveAt` property is a `Date` object used to show the time the session was last active. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useSession } from "@clerk/clerk-react"; + +export default function Home() { + const { isLoaded, session, isSignedIn } = useSession(); + + if (!isLoaded) { + // Handle loading state + return null; + } + if (!isSignedIn) { + // Handle signed out state + return null; + } + + return ( +
+

+ This session has been active since{" "} + {session.lastActiveAt.toLocaleString()} +

+
+ ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +"use client"; + +import { useSession } from "@clerk/nextjs"; + +export default function HomePage() { + const { isLoaded, session, isSignedIn } = useSession(); + + if (!isLoaded) { + // Handle loading state + return null; + } + if (!isSignedIn) { + // Handle signed out state + return null; + } + + return ( +
+

+ This session has been active since{" "} + {session.lastActiveAt.toLocaleString()} +

+
+ ); +} +``` + +
+
diff --git a/.typedoc/docs/shared/use-user.mdx b/.typedoc/docs/shared/use-user.mdx new file mode 100644 index 00000000000..a89b31c4fae --- /dev/null +++ b/.typedoc/docs/shared/use-user.mdx @@ -0,0 +1,211 @@ +The `useUser()` hook provides access to the current user's [`User`](/docs/references/javascript/user) object, which contains all the data for a single user in your application and provides methods to manage their account. This hook also allows you to check if the user is signed in and if Clerk has loaded and initialized. + +## 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. + + + +| Name | Type | Description | +| ------ | ------ | ------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `isSignedIn` | `undefined` | A boolean that returns `true` if the user is signed in. | +| `user` | `undefined` | The `User` object for the current 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 returns `true` if the user is signed in. | +| `user` | `null` | The `User` object for the current 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 returns `true` if the user is signed in. | +| `user` | [`UserResource`](/docs/references/javascript/user) | The `User` object for the current user. | + + + +## Examples + +### Get the current user + +The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which contains the current user's data such as their full name. The `isLoaded` and `isSignedIn` properties are used to handle the loading state and to check if the user is signed in, respectively. + +```tsx {{ filename: 'src/Example.tsx' }} +export default function Example() { + const { isSignedIn, user, isLoaded } = useUser(); + + if (!isLoaded) { + return
Loading...
; + } + + if (!isSignedIn) { + return
Sign in to view this page
; + } + + return
Hello {user.firstName}!
; +} +``` + +### Update user data + +The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`update()`](/docs/references/javascript/user#update) method to update the current user's information. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useUser } from "@clerk/clerk-react"; + +export default function Home() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + await user.update({ + firstName: "John", + lastName: "Doe", + }); + }; + + return ( + <> + +

user.firstName: {user?.firstName}

+

user.lastName: {user?.lastName}

+ + ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +"use client"; + +import { useUser } from "@clerk/nextjs"; + +export default function HomePage() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + await user.update({ + firstName: "John", + lastName: "Doe", + }); + }; + + return ( + <> + +

user.firstName: {user?.firstName}

+

user.lastName: {user?.lastName}

+ + ); +} +``` + +
+
+ +### Reload user data + +The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`reload()`](/docs/references/javascript/user#reload) method to get the latest user's information. + + + + +```tsx {{ filename: 'src/Home.tsx' }} +import { useUser } from "@clerk/clerk-react"; + +export default function Home() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + // Update data via an API endpoint + const updateMetadata = await fetch("/api/updateMetadata"); + + // Check if the update was successful + if (updateMetadata.message !== "success") { + throw new Error("Error updating"); + } + + // If the update was successful, reload the user data + await user.reload(); + }; + + return ( + <> + +

user role: {user?.publicMetadata.role}

+ + ); +} +``` + +
+ + +```tsx {{ filename: 'app/page.tsx' }} +"use client"; + +import { useUser } from "@clerk/nextjs"; + +export default function HomePage() { + const { isLoaded, user } = useUser(); + + if (!isLoaded) { + // Handle loading state + return null; + } + + if (!user) return null; + + const updateUser = async () => { + // Update data via an API endpoint + const updateMetadata = await fetch("/api/updateMetadata"); + + // Check if the update was successful + if (updateMetadata.message !== "success") { + throw new Error("Error updating"); + } + + // If the update was successful, reload the user data + await user.reload(); + }; + + return ( + <> + +

user role: {user?.publicMetadata.role}

+ + ); +} +``` + +
+
diff --git a/.typedoc/docs/shared/user-agent-is-robot.mdx b/.typedoc/docs/shared/user-agent-is-robot.mdx new file mode 100644 index 00000000000..fada624f70e --- /dev/null +++ b/.typedoc/docs/shared/user-agent-is-robot.mdx @@ -0,0 +1,11 @@ +Checks if the user agent is a bot. + +## Parameters + +| Parameter | Type | Description | +| ----------- | -------- | --------------------- | +| `userAgent` | `string` | Any user agent string | + +## Returns + +`boolean` diff --git a/.typedoc/docs/shared/version-selector.mdx b/.typedoc/docs/shared/version-selector.mdx new file mode 100644 index 00000000000..f40c7058ab1 --- /dev/null +++ b/.typedoc/docs/shared/version-selector.mdx @@ -0,0 +1,17 @@ +This version selector is a bit complicated, so here is the flow: + +1. Use the clerkJSVersion prop on the provider +2. Use the exact `@clerk/clerk-js` version if it is a `@snapshot` prerelease +3. Use the prerelease tag of `@clerk/clerk-js` or the packageVersion provided +4. Fallback to the major version of `@clerk/clerk-js` or the packageVersion provided + +## Parameters + +| Parameter | Type | Description | +| ---------------- | -------------------------------- | ----------------------------------------------------------------------------------------- | +| `clerkJSVersion` | undefined \| string | The optional clerkJSVersion prop on the provider | +| `packageVersion` | `string` | The version of `@clerk/clerk-js` that will be used if an explicit version is not provided | + +## Returns + +`string` — The npm tag, version or major version to use diff --git a/.typedoc/docs/types/act-claim.mdx b/.typedoc/docs/types/act-claim.mdx new file mode 100644 index 00000000000..3de8a4c99a4 --- /dev/null +++ b/.typedoc/docs/types/act-claim.mdx @@ -0,0 +1 @@ +JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). diff --git a/.typedoc/docs/types/act-jwt-claim.mdx b/.typedoc/docs/types/act-jwt-claim.mdx new file mode 100644 index 00000000000..33ad615eb64 --- /dev/null +++ b/.typedoc/docs/types/act-jwt-claim.mdx @@ -0,0 +1,5 @@ +JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). + +## Deprecated + +Use `ActClaim` instead. diff --git a/.typedoc/docs/types/active-session-resource.mdx b/.typedoc/docs/types/active-session-resource.mdx new file mode 100644 index 00000000000..ea2985b809f --- /dev/null +++ b/.typedoc/docs/types/active-session-resource.mdx @@ -0,0 +1,33 @@ +Represents a session resource that has completed all pending tasks +and authentication factors + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `end` | () => Promise\<[SessionResource](/docs/references/javascript/session)\> | Marks the session as ended. The session will no longer be active for this `Client` and its status will become **ended**. | - | +| `factorVerificationAge` | null \| \[number, number\] | An array where each item represents the number of minutes since the last verification of a first or second factor: `[firstFactorAge, secondFactorAge]`. | - | +| `id` | `string` | The unique identifier for the session. | - | +| `pathRoot` | `string` | The root path of the resource. | - | +| `status` | `"active"` | The current state of the session. | [`SessionResource`](/docs/references/javascript/session).[`status`](/docs/references/javascript/session#status) | +| `user` | [`UserResource`](/docs/references/javascript/user) | The user associated with the session. | [`SessionResource`](/docs/references/javascript/session).[`user`](/docs/references/javascript/session#user) | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`ActiveSessionResource`\> + +#### Inherited from + +[`SessionResource`](/docs/references/javascript/session).[`reload`](/docs/references/javascript/session#reload) diff --git a/.typedoc/docs/types/add-payment-source-params.mdx b/.typedoc/docs/types/add-payment-source-params.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/cancel-subscription-params.mdx b/.typedoc/docs/types/cancel-subscription-params.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/check-authorization-fn.mdx b/.typedoc/docs/types/check-authorization-fn.mdx new file mode 100644 index 00000000000..cbec4ba71ef --- /dev/null +++ b/.typedoc/docs/types/check-authorization-fn.mdx @@ -0,0 +1,9 @@ +## Parameters + +| Parameter | Type | +| -------------------- | -------- | +| `isAuthorizedParams` | `Params` | + +## Returns + +`boolean` diff --git a/.typedoc/docs/types/check-authorization-from-session-claims.mdx b/.typedoc/docs/types/check-authorization-from-session-claims.mdx new file mode 100644 index 00000000000..f7357cd71cb --- /dev/null +++ b/.typedoc/docs/types/check-authorization-from-session-claims.mdx @@ -0,0 +1,13 @@ +Type guard for server-side authorization checks using session claims. +System permissions are not allowed since they are not included +in session claims and cannot be verified on the server side. + +## Parameters + +| Parameter | Type | +| -------------------- | -------------------------------------------------------------------------------------------------------- | +| `isAuthorizedParams` | [`CheckAuthorizationParamsFromSessionClaims`](check-authorization-params-from-session-claims.mdx)\<`P`\> | + +## Returns + +`boolean` diff --git a/.typedoc/docs/types/check-authorization-params-from-session-claims.mdx b/.typedoc/docs/types/check-authorization-params-from-session-claims.mdx new file mode 100644 index 00000000000..5299e174317 --- /dev/null +++ b/.typedoc/docs/types/check-authorization-params-from-session-claims.mdx @@ -0,0 +1,9 @@ +## Properties + +| Property | Type | Description | +| --------------------------------------------- | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | +| `feature?` | `Autocomplete`\< user:${string} \| org:${string} \> | The [feature](/docs/billing/overview) to check for. | +| `permission?` | `DisallowSystemPermissions`\<`P`\> | The [permission](/docs/organizations/roles-permissions) to check for. | +| `plan?` | `Autocomplete`\< user:${string} \| org:${string} \> | The [plan](/docs/billing/overview) to check for. | +| `reverification?` | [`ReverificationConfig`](reverification-config.mdx) | The reverification configuration to check for. This feature is currently in public beta. **It is not recommended for production use.** | +| `role?` | `string` | The [role](/docs/organizations/roles-permissions) to check for. | diff --git a/.typedoc/docs/types/check-authorization-with-custom-permissions.mdx b/.typedoc/docs/types/check-authorization-with-custom-permissions.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/clerk-api-error.mdx b/.typedoc/docs/types/clerk-api-error.mdx new file mode 100644 index 00000000000..63a5b74ea7b --- /dev/null +++ b/.typedoc/docs/types/clerk-api-error.mdx @@ -0,0 +1,24 @@ +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[]; 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/.typedoc/docs/types/clerk-api-response-error.mdx b/.typedoc/docs/types/clerk-api-response-error.mdx new file mode 100644 index 00000000000..b2f65c266de --- /dev/null +++ b/.typedoc/docs/types/clerk-api-response-error.mdx @@ -0,0 +1 @@ +Interface representing a Clerk API Response Error. diff --git a/.typedoc/docs/types/clerk-host-router.mdx b/.typedoc/docs/types/clerk-host-router.mdx new file mode 100644 index 00000000000..c94fdb43453 --- /dev/null +++ b/.typedoc/docs/types/clerk-host-router.mdx @@ -0,0 +1 @@ +This type represents a generic router interface that Clerk relies on to interact with the host router. diff --git a/.typedoc/docs/types/clerk-jwt-claims.mdx b/.typedoc/docs/types/clerk-jwt-claims.mdx new file mode 100644 index 00000000000..4aab45ad6c6 --- /dev/null +++ b/.typedoc/docs/types/clerk-jwt-claims.mdx @@ -0,0 +1,28 @@ +Clerk-issued JWT payload + +## Deprecated + +Use `JwtPayload` instead. + +## Indexable + +\[`propName`: `string`\]: `unknown` + +Any other JWT Claim Set member. + +## Properties + +| Property | Type | Description | +| ------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| ~~`act?`~~ | \{ [x: string]: unknown; sub: string; \} | JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). | +| `act.sub` | `string` | - | +| ~~`azp?`~~ | `string` | JWT Authorized party - [RFC7800#section-3](https://tools.ietf.org/html/rfc7800#section-3). | +| ~~`exp`~~ | `number` | JWT Expiration Time - [RFC7519#section-4.1.4](https://tools.ietf.org/html/rfc7519#section-4.1.4). | +| ~~`iat`~~ | `number` | JWT Issued At - [RFC7519#section-4.1.6](https://tools.ietf.org/html/rfc7519#section-4.1.6). | +| ~~`iss`~~ | `string` | JWT Issuer - [RFC7519#section-4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1). | +| ~~`nbf`~~ | `number` | JWT Not Before - [RFC7519#section-4.1.5](https://tools.ietf.org/html/rfc7519#section-4.1.5). | +| ~~`org_id?`~~ | `string` | Active organization ID. | +| ~~`org_role?`~~ | `string` | Active organization role. | +| ~~`org_slug?`~~ | `string` | Active organization slug. | +| ~~`sid`~~ | `string` | Session ID | +| ~~`sub`~~ | `string` | JWT Subject - [RFC7519#section-4.1.2](https://tools.ietf.org/html/rfc7519#section-4.1.2). | diff --git a/.typedoc/docs/types/clerk-paginated-response.mdx b/.typedoc/docs/types/clerk-paginated-response.mdx new file mode 100644 index 00000000000..bd31a7df330 --- /dev/null +++ b/.typedoc/docs/types/clerk-paginated-response.mdx @@ -0,0 +1,11 @@ +An interface that describes the response of a method that returns a paginated list of resources. + +> [!TIP] +> Clerk's SDKs always use `Promise>`. If the promise resolves, you will get back the properties. If the promise is rejected, you will receive a `ClerkAPIResponseError` or network error. + +## Properties + +| Property | Type | Description | +| -------------------------------------- | ---------------- | -------------------------------------------- | +| `data` | T[] | An array that contains the fetched data. | +| `total_count` | `number` | The total count of data that exist remotely. | diff --git a/.typedoc/docs/types/clerk-pagination-params.mdx b/.typedoc/docs/types/clerk-pagination-params.mdx new file mode 100644 index 00000000000..70057fdc8c9 --- /dev/null +++ b/.typedoc/docs/types/clerk-pagination-params.mdx @@ -0,0 +1,6 @@ +## Properties + +| 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`. | diff --git a/.typedoc/docs/types/clerk-pagination-request.mdx b/.typedoc/docs/types/clerk-pagination-request.mdx new file mode 100644 index 00000000000..e7b59556cc0 --- /dev/null +++ b/.typedoc/docs/types/clerk-pagination-request.mdx @@ -0,0 +1,8 @@ +Pagination params in request + +## Type declaration + +| Name | Type | Description | +| --------- | -------- | ---------------------------------------------------- | +| `limit?` | `number` | Maximum number of items returned per request. | +| `offset?` | `number` | This is the starting point for your fetched results. | diff --git a/.typedoc/docs/types/clerk-resource.mdx b/.typedoc/docs/types/clerk-resource.mdx new file mode 100644 index 00000000000..639c609d8c0 --- /dev/null +++ b/.typedoc/docs/types/clerk-resource.mdx @@ -0,0 +1,24 @@ +Defines common properties and methods that all Clerk resources must implement. + +## Properties + +| Property | Type | Description | +| -------------------------------- | -------- | -------------------------------------- | +| `id?` | `string` | The unique identifier of the resource. | +| `pathRoot` | `string` | The root path of the resource. | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`ClerkResource`\> diff --git a/.typedoc/docs/types/clerk-status.mdx b/.typedoc/docs/types/clerk-status.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/clerk.mdx b/.typedoc/docs/types/clerk.mdx new file mode 100644 index 00000000000..fff118bd1d0 --- /dev/null +++ b/.typedoc/docs/types/clerk.mdx @@ -0,0 +1,332 @@ +Main Clerk SDK object. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `__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_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` | `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`](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. | +| `closeOrganizationProfile` | () => void | Closes the Clerk OrganizationProfile modal. | +| `closeSignIn` | () => void | Closes the Clerk SignIn modal. | +| `closeSignUp` | () => void | Closes the Clerk SignUp modal. | +| `closeUserProfile` | () => void | Closes the Clerk UserProfile modal. | +| `closeWaitlist` | () => void | Closes the Clerk Waitlist modal. | +| `createOrganization` | (params) => Promise\<[OrganizationResource](/docs/references/javascript/organization)\> | Creates an organization, adding the current user as admin. | +| `domain` | `string` | Clerk Satellite Frontend API string. | +| `getOrganization` | (organizationId) => Promise\<[OrganizationResource](/docs/references/javascript/organization)\> | Retrieves a single organization by id. | +| `handleEmailLinkVerification` | (params, customNavigate?) => Promise\ | Completes a Email Link flow started by Clerk.client.signIn.createEmailLinkFlow or Clerk.client.signUp.createEmailLinkFlow | +| `handleGoogleOneTapCallback` | (signInOrUp, params, customNavigate?) => Promise\ | Completes a Google One Tap redirection flow started by [Clerk.authenticateWithGoogleOneTap](#authenticatewithgoogleonetap) | +| `handleRedirectCallback` | (params, customNavigate?) => Promise\ | Completes an OAuth or SAML redirection flow started by Clerk.client.signIn.authenticateWithRedirect or Clerk.client.signUp.authenticateWithRedirect | +| `handleUnauthenticated` | () => Promise\ | Handles a 401 response from Frontend API by refreshing the client and session object accordingly | +| `instanceType` | undefined \| InstanceType | Clerk Instance type is defined from the Publishable key | +| `isSatellite` | `boolean` | Clerk Flag for satellite apps. | +| `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. | +| `mountOrganizationSwitcher` | (targetNode, props?) => void | Mount an organization switcher component at the target element. | +| `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. | +| `navigate` | `CustomNavigation` | Function used to commit a navigation after certain steps in the Clerk processes. | +| `off` | `OffEventListener` | Removes an event handler for a specific Clerk event. **Param** The event name to unsubscribe from **Param** The callback function to remove | +| `on` | `OnEventListener` | Registers an event handler for a specific Clerk event. **Param** The event name to subscribe to **Param** The callback function to execute when the event is dispatched **Param** Optional configuration object **Param** If true and the event was previously dispatched, handler will be called immediately with the latest payload | +| `openCreateOrganization` | (props?) => void | Opens the Clerk CreateOrganization modal. | +| `openGoogleOneTap` | (props?) => void | Opens the Google One Tap component. | +| `openOrganizationProfile` | (props?) => void | Opens the Clerk OrganizationProfile modal. | +| `openSignIn` | (props?) => void | Opens the Clerk SignIn component in a modal. | +| `openSignUp` | (props?) => void | Opens the Clerk SignUp component in a modal. | +| `openUserProfile` | (props?) => void | Opens the Clerk UserProfile modal. | +| `openWaitlist` | (props?) => void | Opens the Clerk Waitlist modal. | +| `organization` | undefined \| null \| [OrganizationResource](/docs/references/javascript/organization) | Active Organization | +| `proxyUrl` | undefined \| string | Clerk Proxy url string. | +| `publishableKey` | `string` | Clerk Publishable Key string. | +| `redirectToAfterSignIn` | () => void | Redirects to the configured afterSignIn URL. | +| `redirectToAfterSignOut` | () => void | Redirects to the configured afterSignOut URL. | +| `redirectToAfterSignUp` | () => void | Redirects to the configured afterSignUp URL. | +| `redirectToCreateOrganization` | () => Promise\ | Redirects to the configured URL where `` is mounted. | +| `redirectToOrganizationProfile` | () => Promise\ | Redirects to the configured URL where `` is mounted. | +| `redirectToUserProfile` | () => Promise\ | Redirects to the configured URL where `` is mounted. | +| `redirectToWaitlist` | () => void | Redirects to the configured URL where `` is mounted. | +| `sdkMetadata` | undefined \| \{ environment?: string; name: string; version: string; \} | If present, contains information about the SDK that the host application is using. For example, if Clerk is loaded through `@clerk/nextjs`, this would be `{ name: '@clerk/nextjs', version: '1.0.0' }` | +| `session` | undefined \| null \| [SignedInSessionResource](/docs/references/javascript/session) | Current Session. | +| `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. | +| `unmountOrganizationSwitcher` | (targetNode) => void | Unmount the organization profile component from the target node.\* | +| `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. | +| `user` | undefined \| null \| [UserResource](/docs/references/javascript/user) | Current User. | +| `version` | undefined \| string | Clerk SDK version number. | + +## Methods + +### buildAfterMultiSessionSingleSignOutUrl() + +Returns the configured afterMultiSessionSingleSignOutUrl of the instance. + +#### Returns + +`string` + +--- + +### buildAfterSignInUrl() + +Returns the configured afterSignInUrl of the instance. + +#### Parameters + +| Parameter | Type | +| --------------------------- | -------------------------------------------- | +| `__namedParameters?` | \{ params?: URLSearchParams; \} | +| `__namedParameters.params?` | `URLSearchParams` | + +#### Returns + +`string` + +--- + +### buildAfterSignOutUrl() + +Returns the configured afterSignOutUrl of the instance. + +#### Returns + +`string` + +--- + +### buildAfterSignUpUrl() + +Returns the configured afterSignInUrl of the instance. + +#### Parameters + +| Parameter | Type | +| --------------------------- | -------------------------------------------- | +| `__namedParameters?` | \{ params?: URLSearchParams; \} | +| `__namedParameters.params?` | `URLSearchParams` | + +#### Returns + +`string` + +--- + +### buildCreateOrganizationUrl() + +Returns the configured url where `` is mounted or a custom create-organization page is rendered. + +#### Returns + +`string` + +--- + +### buildNewSubscriptionRedirectUrl() + +Returns the configured newSubscriptionRedirectUrl of the instance. + +#### Returns + +`string` + +--- + +### buildOrganizationProfileUrl() + +Returns the configured url where `` is mounted or a custom organization-profile page is rendered. + +#### Returns + +`string` + +--- + +### buildSignInUrl() + +Returns the configured url where `` is mounted or a custom sign-in page is rendered. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ----------------------------------------- | ------------------------------------------------ | +| `opts?` | [`RedirectOptions`](redirect-options.mdx) | A [RedirectOptions](redirect-options.mdx) object | + +#### Returns + +`string` + +--- + +### buildSignUpUrl() + +Returns the configured url where `` is mounted or a custom sign-up page is rendered. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ----------------------------------------- | ------------------------------------------------ | +| `opts?` | [`RedirectOptions`](redirect-options.mdx) | A [RedirectOptions](redirect-options.mdx) object | + +#### Returns + +`string` + +--- + +### buildTasksUrl() + +Returns the configured url where tasks are mounted. + +#### Returns + +`string` + +--- + +### buildUrlWithAuth() + +Decorates the provided url with the auth token for development instances. + +#### Parameters + +| Parameter | Type | +| --------- | -------- | +| `to` | `string` | + +#### Returns + +`string` + +--- + +### buildUserProfileUrl() + +Returns the url where `` is mounted or a custom user-profile page is rendered. + +#### Returns + +`string` + +--- + +### buildWaitlistUrl() + +Returns the configured url where `` is mounted or a custom waitlist page is rendered. + +#### Parameters + +| Parameter | Type | +| --------------------- | ------------------------------------------------------------ | +| `opts?` | \{ initialValues?: Record\; \} | +| `opts.initialValues?` | `Record`\<`string`, `string`\> | + +#### Returns + +`string` + +--- + +### redirectToSignIn() + +Redirects to the configured URL where `` is mounted. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ----------------------- | ------------------------------------------------ | +| `opts?` | `SignInRedirectOptions` | A [RedirectOptions](redirect-options.mdx) object | + +#### Returns + +`Promise`\<`unknown`\> + +--- + +### redirectToSignUp() + +Redirects to the configured URL where `` is mounted. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ----------------------- | ------------------------------------------------ | +| `opts?` | `SignUpRedirectOptions` | A [RedirectOptions](redirect-options.mdx) object | + +#### Returns + +`Promise`\<`unknown`\> + +--- + +### redirectToTasks() + +Redirects to the configured URL where tasks are mounted. + +#### Parameters + +| Parameter | Type | Description | +| --------- | ---------------------- | ------------------------------------------------ | +| `opts?` | `TasksRedirectOptions` | A [RedirectOptions](redirect-options.mdx) object | + +#### Returns + +`Promise`\<`unknown`\> + +--- + +### redirectWithAuth() + +Redirects to the provided url after decorating it with the auth token for development instances. + +#### Parameters + +| Parameter | Type | +| --------- | -------- | +| `to` | `string` | + +#### Returns + +`Promise`\<`unknown`\> diff --git a/.typedoc/docs/types/commerce-billing-namespace.mdx b/.typedoc/docs/types/commerce-billing-namespace.mdx new file mode 100644 index 00000000000..eed40191201 --- /dev/null +++ b/.typedoc/docs/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](/docs/references/javascript/types/commerce-subscription-item-resource)\>\> | **`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/.typedoc/docs/types/commerce-checkout-json.mdx b/.typedoc/docs/types/commerce-checkout-json.mdx new file mode 100644 index 00000000000..d320ff1e02f --- /dev/null +++ b/.typedoc/docs/types/commerce-checkout-json.mdx @@ -0,0 +1,27 @@ +**`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`** | - | +| `free_trial_ends_at?` | null \| number | **`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/.typedoc/docs/types/commerce-checkout-resource.mdx b/.typedoc/docs/types/commerce-checkout-resource.mdx new file mode 100644 index 00000000000..c4e8c703a7c --- /dev/null +++ b/.typedoc/docs/types/commerce-checkout-resource.mdx @@ -0,0 +1,48 @@ +**`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: ``. | - | +| `freeTrialEndsAt` | 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: ``. | - | +| `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/.typedoc/docs/types/commerce-checkout-totals-json.mdx b/.typedoc/docs/types/commerce-checkout-totals-json.mdx new file mode 100644 index 00000000000..f33e43c2257 --- /dev/null +++ b/.typedoc/docs/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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | +| `grand_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | +| `subtotal` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | +| `tax_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | +| `total_due_now` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | diff --git a/.typedoc/docs/types/commerce-checkout-totals.mdx b/.typedoc/docs/types/commerce-checkout-totals.mdx new file mode 100644 index 00000000000..98336ee1e81 --- /dev/null +++ b/.typedoc/docs/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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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/.typedoc/docs/types/commerce-feature-json.mdx b/.typedoc/docs/types/commerce-feature-json.mdx new file mode 100644 index 00000000000..88ec46c2aee --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-feature-resource.mdx b/.typedoc/docs/types/commerce-feature-resource.mdx new file mode 100644 index 00000000000..35eb1e9bdc3 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-initialized-payment-source-json.mdx b/.typedoc/docs/types/commerce-initialized-payment-source-json.mdx new file mode 100644 index 00000000000..ce7ed223072 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-initialized-payment-source-resource.mdx b/.typedoc/docs/types/commerce-initialized-payment-source-resource.mdx new file mode 100644 index 00000000000..660d0b72139 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-money-amount-json.mdx b/.typedoc/docs/types/commerce-money-amount-json.mdx new file mode 100644 index 00000000000..3799c73988d --- /dev/null +++ b/.typedoc/docs/types/commerce-money-amount-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/.typedoc/docs/types/commerce-money-amount.mdx b/.typedoc/docs/types/commerce-money-amount.mdx new file mode 100644 index 00000000000..b9a42365172 --- /dev/null +++ b/.typedoc/docs/types/commerce-money-amount.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/.typedoc/docs/types/commerce-payer-resource-type.mdx b/.typedoc/docs/types/commerce-payer-resource-type.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-payment-charge-type.mdx b/.typedoc/docs/types/commerce-payment-charge-type.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-payment-json.mdx b/.typedoc/docs/types/commerce-payment-json.mdx new file mode 100644 index 00000000000..3c1a52d2b13 --- /dev/null +++ b/.typedoc/docs/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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-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/.typedoc/docs/types/commerce-payment-resource.mdx b/.typedoc/docs/types/commerce-payment-resource.mdx new file mode 100644 index 00000000000..20c8592f87b --- /dev/null +++ b/.typedoc/docs/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` | [`CommerceMoneyAmount`](commerce-money-amount.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`](/docs/references/javascript/types/commerce-subscription-item-resource) | **`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`](/docs/references/javascript/types/commerce-subscription-item-resource) | **`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/.typedoc/docs/types/commerce-payment-source-json.mdx b/.typedoc/docs/types/commerce-payment-source-json.mdx new file mode 100644 index 00000000000..3dac463fd91 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-payment-source-methods.mdx b/.typedoc/docs/types/commerce-payment-source-methods.mdx new file mode 100644 index 00000000000..d3c69c4bfbd --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-payment-source-resource.mdx b/.typedoc/docs/types/commerce-payment-source-resource.mdx new file mode 100644 index 00000000000..38db54f5f75 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-payment-source-status.mdx b/.typedoc/docs/types/commerce-payment-source-status.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-payment-status.mdx b/.typedoc/docs/types/commerce-payment-status.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-plan-json.mdx b/.typedoc/docs/types/commerce-plan-json.mdx new file mode 100644 index 00000000000..a0a5031abba --- /dev/null +++ b/.typedoc/docs/types/commerce-plan-json.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 | Overrides | +| ------------------------------------------------------------------------------ | --------------------------------------------------------------- | ------------------ | -------------------------- | +| `amount` | `number` | **`Experimental`** | - | +| `amount_formatted` | `string` | **`Experimental`** | - | +| `annual_amount` | `number` | **`Experimental`** | - | +| `annual_amount_formatted` | `string` | **`Experimental`** | - | +| `annual_fee` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | +| `annual_monthly_amount` | `number` | **`Experimental`** | - | +| `annual_monthly_amount_formatted` | `string` | **`Experimental`** | - | +| `annual_monthly_fee` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | +| `avatar_url` | `string` | **`Experimental`** | - | +| `currency` | `string` | **`Experimental`** | - | +| `currency_symbol` | `string` | **`Experimental`** | - | +| `description` | `string` | **`Experimental`** | - | +| `features` | [CommerceFeatureJSON](commerce-feature-json.mdx)[] | **`Experimental`** | - | +| `fee` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | +| `for_payer_type` | [`CommercePayerResourceType`](commerce-payer-resource-type.mdx) | **`Experimental`** | - | +| `free_trial_days?` | null \| number | **`Experimental`** | - | +| `free_trial_enabled?` | `boolean` | **`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/.typedoc/docs/types/commerce-plan-resource.mdx b/.typedoc/docs/types/commerce-plan-resource.mdx new file mode 100644 index 00000000000..12be3aab061 --- /dev/null +++ b/.typedoc/docs/types/commerce-plan-resource.mdx @@ -0,0 +1,52 @@ +**`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 | +| ------------------------------------------------ | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `annualFee` | [`CommerceMoneyAmount`](commerce-money-amount.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: ``. | - | +| `annualMonthlyFee` | [`CommerceMoneyAmount`](commerce-money-amount.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: ``. | - | +| `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: ``. | - | +| `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: ``. | - | +| `fee` | [`CommerceMoneyAmount`](commerce-money-amount.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. | - | +| `freeTrialDays` | null \| 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: ``. | - | +| `freeTrialEnabled` | `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: ``. | - | +| `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/.typedoc/docs/types/commerce-product-json.mdx b/.typedoc/docs/types/commerce-product-json.mdx new file mode 100644 index 00000000000..012681c4ea5 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-product-resource.mdx b/.typedoc/docs/types/commerce-product-resource.mdx new file mode 100644 index 00000000000..045ad69697e --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-statement-group-json.mdx b/.typedoc/docs/types/commerce-statement-group-json.mdx new file mode 100644 index 00000000000..debb37ed037 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-statement-group.mdx b/.typedoc/docs/types/commerce-statement-group.mdx new file mode 100644 index 00000000000..590ebd9aa9d --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-statement-json.mdx b/.typedoc/docs/types/commerce-statement-json.mdx new file mode 100644 index 00000000000..929a1bd120c --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-statement-resource.mdx b/.typedoc/docs/types/commerce-statement-resource.mdx new file mode 100644 index 00000000000..b400e62aa6c --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-statement-status.mdx b/.typedoc/docs/types/commerce-statement-status.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-statement-totals-json.mdx b/.typedoc/docs/types/commerce-statement-totals-json.mdx new file mode 100644 index 00000000000..efc4bbf9ba7 --- /dev/null +++ b/.typedoc/docs/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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | +| `grand_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | +| `subtotal` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | +| `tax_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | diff --git a/.typedoc/docs/types/commerce-statement-totals.mdx b/.typedoc/docs/types/commerce-statement-totals.mdx new file mode 100644 index 00000000000..9929447a7c7 --- /dev/null +++ b/.typedoc/docs/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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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/.typedoc/docs/types/commerce-subscription-item-json.mdx b/.typedoc/docs/types/commerce-subscription-item-json.mdx new file mode 100644 index 00000000000..448376cf45c --- /dev/null +++ b/.typedoc/docs/types/commerce-subscription-item-json.mdx @@ -0,0 +1,30 @@ +**`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?` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | +| `canceled_at` | null \| number | **`Experimental`** | - | +| `created_at` | `number` | **`Experimental`** | - | +| `credit?` | \{ amount: [CommerceMoneyAmountJSON](commerce-money-amount-json.mdx); \} | **`Experimental`** | - | +| `credit.amount` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | - | - | +| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | +| `is_free_trial?` | `boolean` | **`Experimental`** | - | +| `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/.typedoc/docs/types/commerce-subscription-item-resource.mdx b/.typedoc/docs/types/commerce-subscription-item-resource.mdx new file mode 100644 index 00000000000..3c1ecc5216b --- /dev/null +++ b/.typedoc/docs/types/commerce-subscription-item-resource.mdx @@ -0,0 +1,51 @@ +**`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?` | [`CommerceMoneyAmount`](commerce-money-amount.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: [CommerceMoneyAmount](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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) | +| `isFreeTrial` | `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: ``. | - | +| `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/.typedoc/docs/types/commerce-subscription-json.mdx b/.typedoc/docs/types/commerce-subscription-json.mdx new file mode 100644 index 00000000000..1a11b26febb --- /dev/null +++ b/.typedoc/docs/types/commerce-subscription-json.mdx @@ -0,0 +1,27 @@ +**`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`** | - | +| `eligible_for_free_trial?` | `boolean` | **`Experimental`** | - | +| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | +| `next_payment?` | \{ amount: [CommerceMoneyAmountJSON](commerce-money-amount-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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-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/.typedoc/docs/types/commerce-subscription-plan-period.mdx b/.typedoc/docs/types/commerce-subscription-plan-period.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/commerce-subscription-resource.mdx b/.typedoc/docs/types/commerce-subscription-resource.mdx new file mode 100644 index 00000000000..23772ca768a --- /dev/null +++ b/.typedoc/docs/types/commerce-subscription-resource.mdx @@ -0,0 +1,45 @@ +**`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: ``. | - | +| `eligibleForFreeTrial?` | `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` | **`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: [CommerceMoneyAmount](commerce-money-amount.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](/docs/references/javascript/types/commerce-subscription-item-resource)[] | **`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/.typedoc/docs/types/commerce-subscription-status.mdx b/.typedoc/docs/types/commerce-subscription-status.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/confirm-checkout-params.mdx b/.typedoc/docs/types/confirm-checkout-params.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/create-checkout-params.mdx b/.typedoc/docs/types/create-checkout-params.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/create-organization-params.mdx b/.typedoc/docs/types/create-organization-params.mdx new file mode 100644 index 00000000000..77db98c5974 --- /dev/null +++ b/.typedoc/docs/types/create-organization-params.mdx @@ -0,0 +1,4 @@ +| Property | Type | Description | +| ------------------------- | -------- | ----------------------------- | +| `name` | `string` | The name of the organization. | +| `slug?` | `string` | The slug of the organization. | diff --git a/.typedoc/docs/types/element-object-key.mdx b/.typedoc/docs/types/element-object-key.mdx new file mode 100644 index 00000000000..f5fec844683 --- /dev/null +++ b/.typedoc/docs/types/element-object-key.mdx @@ -0,0 +1 @@ +Convert a kebab-cased key from ElementsConfig into a camelCased Elements key diff --git a/.typedoc/docs/types/elements-config.mdx b/.typedoc/docs/types/elements-config.mdx new file mode 100644 index 00000000000..603ae040f48 --- /dev/null +++ b/.typedoc/docs/types/elements-config.mdx @@ -0,0 +1,3 @@ +A map that describes the possible combinations we need to generate +for each unique base element +Kebab-case is used to differentiate between the container and child elements diff --git a/.typedoc/docs/types/experimental_checkout-button-props.mdx b/.typedoc/docs/types/experimental_checkout-button-props.mdx new file mode 100644 index 00000000000..dd556470b00 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/experimental_plan-details-button-props.mdx b/.typedoc/docs/types/experimental_plan-details-button-props.mdx new file mode 100644 index 00000000000..4a00cab7d49 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/experimental_subscription-details-button-props.mdx b/.typedoc/docs/types/experimental_subscription-details-button-props.mdx new file mode 100644 index 00000000000..af7d6709b02 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/for-payer-type.mdx b/.typedoc/docs/types/for-payer-type.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/get-payment-attempts-params.mdx b/.typedoc/docs/types/get-payment-attempts-params.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/get-payment-sources-params.mdx b/.typedoc/docs/types/get-payment-sources-params.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/get-plans-params.mdx b/.typedoc/docs/types/get-plans-params.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/get-statements-params.mdx b/.typedoc/docs/types/get-statements-params.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/get-subscription-params.mdx b/.typedoc/docs/types/get-subscription-params.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/get-subscriptions-params.mdx b/.typedoc/docs/types/get-subscriptions-params.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/get-token.mdx b/.typedoc/docs/types/get-token.mdx new file mode 100644 index 00000000000..60dbf10f036 --- /dev/null +++ b/.typedoc/docs/types/get-token.mdx @@ -0,0 +1,9 @@ +## Parameters + +| Parameter | Type | +| ---------- | ----------------- | +| `options?` | `GetTokenOptions` | + +## Returns + +`Promise`\<string \| null\> diff --git a/.typedoc/docs/types/id-selectors.mdx b/.typedoc/docs/types/id-selectors.mdx new file mode 100644 index 00000000000..29c20772b88 --- /dev/null +++ b/.typedoc/docs/types/id-selectors.mdx @@ -0,0 +1 @@ +Create a type union consisting of the base element with all valid ids appended diff --git a/.typedoc/docs/types/initialize-payment-source-params.mdx b/.typedoc/docs/types/initialize-payment-source-params.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/internal_checkout-props.mdx b/.typedoc/docs/types/internal_checkout-props.mdx new file mode 100644 index 00000000000..59a0f5ad51d --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/internal_plan-details-props.mdx b/.typedoc/docs/types/internal_plan-details-props.mdx new file mode 100644 index 00000000000..e3190d675dc --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/internal_subscription-details-props.mdx b/.typedoc/docs/types/internal_subscription-details-props.mdx new file mode 100644 index 00000000000..a1288deb008 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/jwt-claims.mdx b/.typedoc/docs/types/jwt-claims.mdx new file mode 100644 index 00000000000..16182c24357 --- /dev/null +++ b/.typedoc/docs/types/jwt-claims.mdx @@ -0,0 +1,27 @@ +## Deprecated + +Use `JwtPayload` instead. + +## Indexable + +\[`propName`: `string`\]: `unknown` + +Any other JWT Claim Set member. + +## Properties + +| Property | Type | Description | +| ------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| ~~`__raw`~~ | `string` | Encoded token supporting the `getRawString` method. | +| ~~`act?`~~ | \{ [x: string]: unknown; sub: string; \} | JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). | +| `act.sub` | `string` | - | +| ~~`azp?`~~ | `string` | JWT Authorized party - [RFC7800#section-3](https://tools.ietf.org/html/rfc7800#section-3). | +| ~~`exp`~~ | `number` | JWT Expiration Time - [RFC7519#section-4.1.4](https://tools.ietf.org/html/rfc7519#section-4.1.4). | +| ~~`iat`~~ | `number` | JWT Issued At - [RFC7519#section-4.1.6](https://tools.ietf.org/html/rfc7519#section-4.1.6). | +| ~~`iss`~~ | `string` | JWT Issuer - [RFC7519#section-4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1). | +| ~~`nbf`~~ | `number` | JWT Not Before - [RFC7519#section-4.1.5](https://tools.ietf.org/html/rfc7519#section-4.1.5). | +| ~~`org_id?`~~ | `string` | Active organization ID. | +| ~~`org_role?`~~ | `string` | Active organization role. | +| ~~`org_slug?`~~ | `string` | Active organization slug. | +| ~~`sid`~~ | `string` | Session ID | +| ~~`sub`~~ | `string` | JWT Subject - [RFC7519#section-4.1.2](https://tools.ietf.org/html/rfc7519#section-4.1.2). | diff --git a/.typedoc/docs/types/jwt-header.mdx b/.typedoc/docs/types/jwt-header.mdx new file mode 100644 index 00000000000..ad47ca006c3 --- /dev/null +++ b/.typedoc/docs/types/jwt-header.mdx @@ -0,0 +1,3 @@ +## Deprecated + +Use `JwtHeader` instead. diff --git a/.typedoc/docs/types/legacy-redirect-props.mdx b/.typedoc/docs/types/legacy-redirect-props.mdx new file mode 100644 index 00000000000..62b50d20394 --- /dev/null +++ b/.typedoc/docs/types/legacy-redirect-props.mdx @@ -0,0 +1,13 @@ +> **LegacyRedirectProps** = \{ afterSignInUrl?: string \| null; afterSignUpUrl?: string \| null; redirectUrl?: string \| null; \} + +## Deprecated + +This will be removed in a future release. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------ | +| ~~`afterSignInUrl?`~~ | string \| null | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | +| ~~`afterSignUpUrl?`~~ | string \| null | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | +| ~~`redirectUrl?`~~ | string \| null | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | diff --git a/.typedoc/docs/types/localization-resource.mdx b/.typedoc/docs/types/localization-resource.mdx new file mode 100644 index 00000000000..0c2b7715347 --- /dev/null +++ b/.typedoc/docs/types/localization-resource.mdx @@ -0,0 +1,13 @@ +A type containing all the possible localization keys the prebuilt Clerk components support. +Users aiming to customize a few strings can also peak at the `data-localization-key` attribute by inspecting +the DOM and updating the corresponding key. +Users aiming to completely localize the components by providing a complete translation can use +the default english resource object from [Clerk's open source repo](https://github.com/clerk/javascript) +as a starting point. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `roles?` | `DeepPartial`\<`DeepLocalizationWithoutObjects`\<\{ [r: string]: string; \}\>\> | **`Experimental`** Add role keys and their localized values, e.g. `roles: { 'org:teacher': 'Teacher'}`. | +| `socialButtonsBlockButtonManyInView?` | `DeepPartial`\<\`$\{string\}\{\{provider\|titleize\}\}$\{string\}\` & \{ \_\_params: UnionToRecordWithPrimitives\; \}\> | It should be used to provide a shorter variation of `socialButtonsBlockButton`. It is explicitly typed, in order to avoid contributions that use LLM tools to generate translations that misinterpret the correct usage of this property. | diff --git a/.typedoc/docs/types/make-default-payment-source-params.mdx b/.typedoc/docs/types/make-default-payment-source-params.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/multi-domain-and-or-proxy.mdx b/.typedoc/docs/types/multi-domain-and-or-proxy.mdx new file mode 100644 index 00000000000..fceea3d28db --- /dev/null +++ b/.typedoc/docs/types/multi-domain-and-or-proxy.mdx @@ -0,0 +1,26 @@ +You can configure proxy and satellite domains in a few ways: + +1. none of them are set +2. only `proxyUrl` is set +3. `isSatellite` and `proxyUrl` are set +4. `isSatellite` and `domain` are set + +## Type declaration + +| Name | Type | Description | +| -------------- | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `domain?` | `never` | **Required if your application is a satellite application**. Sets the domain of the satellite application. | +| `isSatellite?` | `never` | A boolean that indicates whether the application is a satellite application. | +| `proxyUrl?` | never \| 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`). | + +| Name | Type | +| ------------- | ----------------------------------------------------------- | +| `domain` | string \| (url) => string | +| `isSatellite` | `Exclude`\<`ClerkOptions`\[`"isSatellite"`\], `undefined`\> | +| `proxyUrl?` | `never` | + +| Name | Type | +| ------------- | ----------------------------------------------------------- | +| `domain?` | `never` | +| `isSatellite` | `Exclude`\<`ClerkOptions`\[`"isSatellite"`\], `undefined`\> | +| `proxyUrl` | string \| (url) => string | diff --git a/.typedoc/docs/types/organization-custom-role-key.mdx b/.typedoc/docs/types/organization-custom-role-key.mdx new file mode 100644 index 00000000000..d3729132f8f --- /dev/null +++ b/.typedoc/docs/types/organization-custom-role-key.mdx @@ -0,0 +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/roles-permissions#custom-roles) as well. diff --git a/.typedoc/docs/types/organization-domain-resource.mdx b/.typedoc/docs/types/organization-domain-resource.mdx new file mode 100644 index 00000000000..7e8db7659d8 --- /dev/null +++ b/.typedoc/docs/types/organization-domain-resource.mdx @@ -0,0 +1,28 @@ +The `OrganizationDomain` object is the model around an organization domain. + +## 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. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`OrganizationDomainResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-domain-verification-status.mdx b/.typedoc/docs/types/organization-domain-verification-status.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/organization-enrollment-mode.mdx b/.typedoc/docs/types/organization-enrollment-mode.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/organization-invitation-resource.mdx b/.typedoc/docs/types/organization-invitation-resource.mdx new file mode 100644 index 00000000000..514156fa13d --- /dev/null +++ b/.typedoc/docs/types/organization-invitation-resource.mdx @@ -0,0 +1,28 @@ +The `OrganizationInvitation` object is the model around an organization invitation. + +## 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. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`OrganizationInvitationResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-invitation-status.mdx b/.typedoc/docs/types/organization-invitation-status.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/organization-membership-request-resource.mdx b/.typedoc/docs/types/organization-membership-request-resource.mdx new file mode 100644 index 00000000000..bdd6dfe997d --- /dev/null +++ b/.typedoc/docs/types/organization-membership-request-resource.mdx @@ -0,0 +1,28 @@ +The `OrganizationMembershipRequest` object is the model that describes the request of a user to join an organization. + +## 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. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`OrganizationMembershipRequestResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-membership-resource.mdx b/.typedoc/docs/types/organization-membership-resource.mdx new file mode 100644 index 00000000000..b4dc4fa94e1 --- /dev/null +++ b/.typedoc/docs/types/organization-membership-resource.mdx @@ -0,0 +1,28 @@ +The `OrganizationMembership` object is the model around an organization membership entity and describes the relationship between users and organizations. + +## 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. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`OrganizationMembershipResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-permission-key.mdx b/.typedoc/docs/types/organization-permission-key.mdx new file mode 100644 index 00000000000..32332de64d2 --- /dev/null +++ b/.typedoc/docs/types/organization-permission-key.mdx @@ -0,0 +1,2 @@ +OrganizationPermissionKey is a combination of system and custom permissions. +System permissions are only accessible from FAPI and client-side operations/utils diff --git a/.typedoc/docs/types/organization-resource.mdx b/.typedoc/docs/types/organization-resource.mdx new file mode 100644 index 00000000000..ffdffff3e9f --- /dev/null +++ b/.typedoc/docs/types/organization-resource.mdx @@ -0,0 +1,34 @@ +The `Organization` object holds information about an organization, as well as methods for managing it. + +To use these methods, you must have the **Organizations** feature [enabled in your app's settings in the Clerk Dashboard](/docs/organizations/overview#enable-organizations-in-your-application). + +## Properties + +| 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](/docs/references/javascript/types/commerce-subscription-item-resource)\>\> | **`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 + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`OrganizationResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-suggestion-resource.mdx b/.typedoc/docs/types/organization-suggestion-resource.mdx new file mode 100644 index 00000000000..9ab3fff17b3 --- /dev/null +++ b/.typedoc/docs/types/organization-suggestion-resource.mdx @@ -0,0 +1,28 @@ +An interface representing an organization suggestion. + +## 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. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`OrganizationSuggestionResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-suggestion-status.mdx b/.typedoc/docs/types/organization-suggestion-status.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/organizations-jwt-claim.mdx b/.typedoc/docs/types/organizations-jwt-claim.mdx new file mode 100644 index 00000000000..cd60c4db281 --- /dev/null +++ b/.typedoc/docs/types/organizations-jwt-claim.mdx @@ -0,0 +1,3 @@ +## Deprecated + +This type will be removed in the next major version. diff --git a/.typedoc/docs/types/override.mdx b/.typedoc/docs/types/override.mdx new file mode 100644 index 00000000000..6aec62ed955 --- /dev/null +++ b/.typedoc/docs/types/override.mdx @@ -0,0 +1,4 @@ +Overrides the type of existing properties +const obj = { a: string, b: number } as const; +type Value = Override +Value contains: { a:string, b: string } diff --git a/.typedoc/docs/types/path-value.mdx b/.typedoc/docs/types/path-value.mdx new file mode 100644 index 00000000000..6b636990561 --- /dev/null +++ b/.typedoc/docs/types/path-value.mdx @@ -0,0 +1,4 @@ +Used to read the value of a string path inside an object defined as const +const obj = { a: { b: 'hello' }} as const; +type Value = PathValue +Value is now a union set containing a single type: 'hello' diff --git a/.typedoc/docs/types/payment-gateway.mdx b/.typedoc/docs/types/payment-gateway.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/pending-session-options.mdx b/.typedoc/docs/types/pending-session-options.mdx new file mode 100644 index 00000000000..3b210e465f2 --- /dev/null +++ b/.typedoc/docs/types/pending-session-options.mdx @@ -0,0 +1,7 @@ +> **PendingSessionOptions** = \{ treatPendingAsSignedOut?: boolean; \} + +## Properties + +| Property | Type | Description | +| --------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------- | +| `treatPendingAsSignedOut?` | `boolean` | A boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`. | diff --git a/.typedoc/docs/types/pending-session-resource.mdx b/.typedoc/docs/types/pending-session-resource.mdx new file mode 100644 index 00000000000..44fa113497e --- /dev/null +++ b/.typedoc/docs/types/pending-session-resource.mdx @@ -0,0 +1,32 @@ +Represents a session resource that has completed sign-in but has pending tasks + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `end` | () => Promise\<[SessionResource](/docs/references/javascript/session)\> | Marks the session as ended. The session will no longer be active for this `Client` and its status will become **ended**. | - | +| `factorVerificationAge` | null \| \[number, number\] | An array where each item represents the number of minutes since the last verification of a first or second factor: `[firstFactorAge, secondFactorAge]`. | - | +| `id` | `string` | The unique identifier for the session. | - | +| `pathRoot` | `string` | The root path of the resource. | - | +| `status` | `"pending"` | The current state of the session. | [`SessionResource`](/docs/references/javascript/session).[`status`](/docs/references/javascript/session#status) | +| `user` | [`UserResource`](/docs/references/javascript/user) | The user associated with the session. | [`SessionResource`](/docs/references/javascript/session).[`user`](/docs/references/javascript/session#user) | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`PendingSessionResource`\> + +#### Inherited from + +[`SessionResource`](/docs/references/javascript/session).[`reload`](/docs/references/javascript/session#reload) diff --git a/.typedoc/docs/types/protect-props.mdx b/.typedoc/docs/types/protect-props.mdx new file mode 100644 index 00000000000..caa5998e83e --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/record-to-path.mdx b/.typedoc/docs/types/record-to-path.mdx new file mode 100644 index 00000000000..d89089101d1 --- /dev/null +++ b/.typedoc/docs/types/record-to-path.mdx @@ -0,0 +1,4 @@ +Used to construct a type union containing all the keys (even if nested) of an object defined as const +const obj = { a: { b: '' }, c: '' } as const; +type Paths = RecordToPath +Paths contains: 'a' | 'a.b' | 'c' diff --git a/.typedoc/docs/types/redirect-options.mdx b/.typedoc/docs/types/redirect-options.mdx new file mode 100644 index 00000000000..b505ddb60ce --- /dev/null +++ b/.typedoc/docs/types/redirect-options.mdx @@ -0,0 +1,2 @@ +Redirect URLs for different actions. +Mainly used to be used to type internal Clerk functions. diff --git a/.typedoc/docs/types/remove-payment-source-params.mdx b/.typedoc/docs/types/remove-payment-source-params.mdx new file mode 100644 index 00000000000..9bd89f7c792 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/reverification-config.mdx b/.typedoc/docs/types/reverification-config.mdx new file mode 100644 index 00000000000..7ca39c1bd5a --- /dev/null +++ b/.typedoc/docs/types/reverification-config.mdx @@ -0,0 +1,10 @@ +The `ReverificationConfig` type has the following properties: + +## Type declaration + +"strict" \| "strict_mfa" \| "moderate" \| "lax" + +| Name | Type | Description | +| -------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `afterMinutes` | `SessionVerificationAfterMinutes` | The age of the factor level to check for. Value should be greater than or equal to 1 and less than 99,999. | +| `level` | "first_factor" \| "second_factor" \| "multi_factor" | The reverification level of credentials to check for. | diff --git a/.typedoc/docs/types/saml-strategy.mdx b/.typedoc/docs/types/saml-strategy.mdx new file mode 100644 index 00000000000..a8f26d96d35 --- /dev/null +++ b/.typedoc/docs/types/saml-strategy.mdx @@ -0,0 +1,3 @@ +## Deprecated + +Use `EnterpriseSSOStrategy` instead. diff --git a/.typedoc/docs/types/sdk-metadata.mdx b/.typedoc/docs/types/sdk-metadata.mdx new file mode 100644 index 00000000000..42ddd4d54c3 --- /dev/null +++ b/.typedoc/docs/types/sdk-metadata.mdx @@ -0,0 +1,9 @@ +> **SDKMetadata** = \{ environment?: string; name: string; version: string; \} + +## Properties + +| Property | Type | Description | +| --------------------------------------- | -------- | --------------------------------------------------------------------------- | +| `environment?` | `string` | Typically this will be the `NODE_ENV` that the SDK is currently running in. | +| `name` | `string` | The npm package name of the SDK. | +| `version` | `string` | The npm package version of the SDK. | diff --git a/.typedoc/docs/types/server-get-token-options.mdx b/.typedoc/docs/types/server-get-token-options.mdx new file mode 100644 index 00000000000..a63b221731b --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/server-get-token.mdx b/.typedoc/docs/types/server-get-token.mdx new file mode 100644 index 00000000000..b0e14e560a8 --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/session-resource.mdx b/.typedoc/docs/types/session-resource.mdx new file mode 100644 index 00000000000..2651cffa85b --- /dev/null +++ b/.typedoc/docs/types/session-resource.mdx @@ -0,0 +1,43 @@ +The `Session` object is an abstraction over an HTTP session. It models the period of information exchange between a user and the server. + +The `Session` object includes methods for recording session activity and ending the session client-side. For security reasons, sessions can also expire server-side. + +As soon as a [`User`](/docs/references/javascript/user) signs in, Clerk creates a `Session` for the current [`Client`](/docs/references/javascript/client). Clients can have more than one sessions at any point in time, but only one of those sessions will be **active**. + +In certain scenarios, a session might be replaced by another one. This is often the case with [multi-session applications](/docs/authentication/configuration/session-options#multi-session-applications). + +All sessions that are **expired**, **removed**, **replaced**, **ended** or **abandoned** are not considered valid. + +> [!NOTE] +> For more information regarding the different session states, see the [guide on session management](/docs/authentication/configuration/session-options). + +## Properties + +| Property | Type | Description | Overrides | +| ---------------------------------------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `end` | () => Promise\ | Marks the session as ended. The session will no longer be active for this `Client` and its status will become **ended**. | - | +| `factorVerificationAge` | null \| \[number, number\] | An array where each item represents the number of minutes since the last verification of a first or second factor: `[firstFactorAge, secondFactorAge]`. | - | +| `id` | `string` | The unique identifier for the session. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | +| `pathRoot` | `string` | The root path of the resource. | - | +| `status` | `SessionStatus` | The current state of the session. | - | +| `user` | null \| [UserResource](/docs/references/javascript/user) | The user associated with the session. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`SessionResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/session-status-claim.mdx b/.typedoc/docs/types/session-status-claim.mdx new file mode 100644 index 00000000000..de597535472 --- /dev/null +++ b/.typedoc/docs/types/session-status-claim.mdx @@ -0,0 +1 @@ +The current state of the session which can only be `active` or `pending`. diff --git a/.typedoc/docs/types/session-task.mdx b/.typedoc/docs/types/session-task.mdx new file mode 100644 index 00000000000..12c0552a25e --- /dev/null +++ b/.typedoc/docs/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/.typedoc/docs/types/session-verification-level.mdx b/.typedoc/docs/types/session-verification-level.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/session-verification-types.mdx b/.typedoc/docs/types/session-verification-types.mdx new file mode 100644 index 00000000000..e69de29bb2d diff --git a/.typedoc/docs/types/set-active-params.mdx b/.typedoc/docs/types/set-active-params.mdx new file mode 100644 index 00000000000..4bd93404d67 --- /dev/null +++ b/.typedoc/docs/types/set-active-params.mdx @@ -0,0 +1,11 @@ +The parameters for the `setActive()` method. + +## Properties + +| Property | Type | Description | +| ----------------------------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| ~~`beforeEmit?`~~ | `BeforeEmitCallback` | **Deprecated.** Use `redirectUrl` instead. Callback run just before the active session and/or organization is set to the passed object. Can be used to set up for pre-navigation actions. | +| `navigate?` | `SetActiveNavigate` | A custom navigation function to be called just before the session and/or organization is set. When provided, it takes precedence over the `redirectUrl` parameter for navigation. Example: `await clerk.setActive({ session, navigate: async ({ session }) => { const currentTask = session.currentTask; if (currentTask) { await router.push(`./onboarding/${currentTask.key}`) return } router.push('/dashboard'); } });` | +| `organization?` | null \| string \| [OrganizationResource](/docs/references/javascript/organization) | The organization resource or organization ID/slug (string version) to be set as active in the current session. If `null`, the currently active organization is removed as active. | +| `redirectUrl?` | `string` | The full URL or path to redirect to just before the session and/or organization is set. | +| `session?` | null \| string \| [SignedInSessionResource](/docs/references/javascript/session) | The session resource or session ID (string version) to be set as active. If `null`, the current session is deleted. | diff --git a/.typedoc/docs/types/set-active.mdx b/.typedoc/docs/types/set-active.mdx new file mode 100644 index 00000000000..ab8cbd7d5c5 --- /dev/null +++ b/.typedoc/docs/types/set-active.mdx @@ -0,0 +1,9 @@ +## Parameters + +| Parameter | Type | +| ----------------- | ------------------------------------------ | +| `setActiveParams` | [`SetActiveParams`](set-active-params.mdx) | + +## Returns + +`Promise`\<`void`\> diff --git a/.typedoc/docs/types/sign-in-resource.mdx b/.typedoc/docs/types/sign-in-resource.mdx new file mode 100644 index 00000000000..e6aa39d2aa5 --- /dev/null +++ b/.typedoc/docs/types/sign-in-resource.mdx @@ -0,0 +1,30 @@ +The `SignIn` object holds the state of the current sign-in and provides helper methods to navigate and complete the sign-in process. It is used to manage the sign-in lifecycle, including the first and second factor verification, and the creation of a new session. + +## Properties + +| Property | Type | Description | +| ------------------------------------------------------------ | --------------------------------- | ------------------------------------------------------------------------- | +| `id?` | `string` | The unique identifier of the resource. | +| `pathRoot` | `string` | The root path of the resource. | +| `status` | null \| SignInStatus | The current status of the sign-in. | +| ~~`supportedIdentifiers`~~ | SignInIdentifier[] | **Deprecated.** This attribute will be removed in the next major version. | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`SignInResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/sign-out.mdx b/.typedoc/docs/types/sign-out.mdx new file mode 100644 index 00000000000..2ec222553cb --- /dev/null +++ b/.typedoc/docs/types/sign-out.mdx @@ -0,0 +1,24 @@ +## Call Signature + +### Parameters + +| Parameter | Type | +| ---------- | ---------------- | +| `options?` | `SignOutOptions` | + +### Returns + +`Promise`\<`void`\> + +## Call Signature + +### Parameters + +| Parameter | Type | +| ------------------ | ----------------- | +| `signOutCallback?` | `SignOutCallback` | +| `options?` | `SignOutOptions` | + +### Returns + +`Promise`\<`void`\> diff --git a/.typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx b/.typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx new file mode 100644 index 00000000000..2ad5ab70fe0 --- /dev/null +++ b/.typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx @@ -0,0 +1,3 @@ +## Deprecated + +Use `SignUpAuthenticateWithWeb3Params` instead. diff --git a/.typedoc/docs/types/sign-up-resource.mdx b/.typedoc/docs/types/sign-up-resource.mdx new file mode 100644 index 00000000000..46d56bca3dc --- /dev/null +++ b/.typedoc/docs/types/sign-up-resource.mdx @@ -0,0 +1,29 @@ +The `SignUp` object holds the state of the current sign-up and provides helper methods to navigate and complete the sign-up process. Once a sign-up is complete, a new user is created. + +## Properties + +| Property | Type | Description | +| -------------------------------- | --------------------------------- | -------------------------------------- | +| `id?` | `string` | The unique identifier of the resource. | +| `pathRoot` | `string` | The root path of the resource. | +| `status` | null \| SignUpStatus | The current status of the sign-up. | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`SignUpResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/signed-in-session-resource.mdx b/.typedoc/docs/types/signed-in-session-resource.mdx new file mode 100644 index 00000000000..a682dc8b4d8 --- /dev/null +++ b/.typedoc/docs/types/signed-in-session-resource.mdx @@ -0,0 +1,2 @@ +Represents session resources for users who have completed +the full sign-in flow diff --git a/.typedoc/docs/types/state-selectors.mdx b/.typedoc/docs/types/state-selectors.mdx new file mode 100644 index 00000000000..cecc110aacf --- /dev/null +++ b/.typedoc/docs/types/state-selectors.mdx @@ -0,0 +1 @@ +Create a type union of all state + id combinations diff --git a/.typedoc/docs/types/telemetry-log-entry.mdx b/.typedoc/docs/types/telemetry-log-entry.mdx new file mode 100644 index 00000000000..4b91f4af44f --- /dev/null +++ b/.typedoc/docs/types/telemetry-log-entry.mdx @@ -0,0 +1 @@ +Debug log entry interface for telemetry collector diff --git a/.typedoc/docs/types/use-auth-return.mdx b/.typedoc/docs/types/use-auth-return.mdx new file mode 100644 index 00000000000..10bb56dd987 --- /dev/null +++ b/.typedoc/docs/types/use-auth-return.mdx @@ -0,0 +1,61 @@ +## Type declaration + +| Name | Type | Description | +| --------------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `actor` | `undefined` | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | +| `getToken` | [`GetToken`](get-token.mdx) | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | +| `has` | \{ \} | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | +| `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. | +| `orgId` | `undefined` | The ID of the user's active organization. | +| `orgRole` | `undefined` | The current user's role in their active organization. | +| `orgSlug` | `undefined` | The URL-friendly identifier of the user's active organization. | +| `sessionClaims` | `undefined` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | +| `sessionId` | `undefined` | The ID for the current session. | +| `signOut` | [`SignOut`](sign-out.mdx) | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | +| `userId` | `undefined` | The ID of the current user. | + +| Name | Type | +| --------------- | ------------------------------ | +| `actor` | `null` | +| `getToken` | [`GetToken`](get-token.mdx) | +| `has()` | (params) => false | +| `isLoaded` | `true` | +| `isSignedIn` | `false` | +| `orgId` | `null` | +| `orgRole` | `null` | +| `orgSlug` | `null` | +| `sessionClaims` | `null` | +| `sessionId` | `null` | +| `signOut` | [`SignOut`](sign-out.mdx) | +| `userId` | `null` | + +| Name | Type | +| --------------- | -------------------------------------------------------------------------------------------- | +| `actor` | [ActClaim](act-claim.mdx) \| null | +| `getToken` | [`GetToken`](get-token.mdx) | +| `has` | [`CheckAuthorizationWithCustomPermissions`](check-authorization-with-custom-permissions.mdx) | +| `isLoaded` | `true` | +| `isSignedIn` | `true` | +| `orgId` | `null` | +| `orgRole` | `null` | +| `orgSlug` | `null` | +| `sessionClaims` | `JwtPayload` | +| `sessionId` | `string` | +| `signOut` | [`SignOut`](sign-out.mdx) | +| `userId` | `string` | + +| Name | Type | +| --------------- | -------------------------------------------------------------------------------------------- | +| `actor` | [ActClaim](act-claim.mdx) \| null | +| `getToken` | [`GetToken`](get-token.mdx) | +| `has` | [`CheckAuthorizationWithCustomPermissions`](check-authorization-with-custom-permissions.mdx) | +| `isLoaded` | `true` | +| `isSignedIn` | `true` | +| `orgId` | `string` | +| `orgRole` | [`OrganizationCustomRoleKey`](organization-custom-role-key.mdx) | +| `orgSlug` | string \| null | +| `sessionClaims` | `JwtPayload` | +| `sessionId` | `string` | +| `signOut` | [`SignOut`](sign-out.mdx) | +| `userId` | `string` | diff --git a/.typedoc/docs/types/use-session-list-return.mdx b/.typedoc/docs/types/use-session-list-return.mdx new file mode 100644 index 00000000000..d5e0943a356 --- /dev/null +++ b/.typedoc/docs/types/use-session-list-return.mdx @@ -0,0 +1,13 @@ +## Type declaration + +| Name | Type | Description | +| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `sessions` | `undefined` | A list of sessions that have been registered on the client device. | +| `setActive` | `undefined` | A function that sets the active session and/or organization. | + +| Name | Type | +| ----------- | --------------------------------------------------------------------- | +| `isLoaded` | `true` | +| `sessions` | [SessionResource](/docs/references/javascript/session)[] | +| `setActive` | [`SetActive`](set-active.mdx) | diff --git a/.typedoc/docs/types/use-session-return.mdx b/.typedoc/docs/types/use-session-return.mdx new file mode 100644 index 00000000000..58f615aad81 --- /dev/null +++ b/.typedoc/docs/types/use-session-return.mdx @@ -0,0 +1,19 @@ +## Type declaration + +| Name | Type | Description | +| ------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------ | +| `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 session for the user. | + +| Name | Type | +| ------------ | ------- | +| `isLoaded` | `true` | +| `isSignedIn` | `false` | +| `session` | `null` | + +| Name | Type | +| ------------ | ---------------------------------------------------------------- | +| `isLoaded` | `true` | +| `isSignedIn` | `boolean` | +| `session` | [`SignedInSessionResource`](/docs/references/javascript/session) | diff --git a/.typedoc/docs/types/use-sign-in-return.mdx b/.typedoc/docs/types/use-sign-in-return.mdx new file mode 100644 index 00000000000..5da1828dd90 --- /dev/null +++ b/.typedoc/docs/types/use-sign-in-return.mdx @@ -0,0 +1,13 @@ +## Type declaration + +| Name | Type | Description | +| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `setActive` | `undefined` | A function that sets the active session. | +| `signIn` | `undefined` | An object that contains the current sign-in attempt status and methods to create a new sign-in attempt. | + +| Name | Type | +| ----------- | ---------------------------------------- | +| `isLoaded` | `true` | +| `setActive` | [`SetActive`](set-active.mdx) | +| `signIn` | [`SignInResource`](sign-in-resource.mdx) | diff --git a/.typedoc/docs/types/use-sign-up-return.mdx b/.typedoc/docs/types/use-sign-up-return.mdx new file mode 100644 index 00000000000..df2caffca81 --- /dev/null +++ b/.typedoc/docs/types/use-sign-up-return.mdx @@ -0,0 +1,13 @@ +## Type declaration + +| Name | Type | Description | +| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `setActive` | `undefined` | A function that sets the active session. | +| `signUp` | `undefined` | An object that contains the current sign-up attempt status and methods to create a new sign-up attempt. | + +| Name | Type | +| ----------- | ------------------------------------------------------- | +| `isLoaded` | `true` | +| `setActive` | [`SetActive`](set-active.mdx) | +| `signUp` | [`SignUpResource`](/docs/references/javascript/sign-up) | diff --git a/.typedoc/docs/types/use-user-return.mdx b/.typedoc/docs/types/use-user-return.mdx new file mode 100644 index 00000000000..960725f16ab --- /dev/null +++ b/.typedoc/docs/types/use-user-return.mdx @@ -0,0 +1,19 @@ +## Type declaration + +| Name | Type | Description | +| ------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------ | +| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | +| `isSignedIn` | `undefined` | A boolean that returns `true` if the user is signed in. | +| `user` | `undefined` | The `User` object for the current user. | + +| Name | Type | +| ------------ | ------- | +| `isLoaded` | `true` | +| `isSignedIn` | `false` | +| `user` | `null` | + +| Name | Type | +| ------------ | -------------------------------------------------- | +| `isLoaded` | `true` | +| `isSignedIn` | `true` | +| `user` | [`UserResource`](/docs/references/javascript/user) | diff --git a/.typedoc/docs/types/user-organization-invitation-resource.mdx b/.typedoc/docs/types/user-organization-invitation-resource.mdx new file mode 100644 index 00000000000..78976cef403 --- /dev/null +++ b/.typedoc/docs/types/user-organization-invitation-resource.mdx @@ -0,0 +1,28 @@ +The `OrganizationInvitation` object is the model around an organization invitation. + +## 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. | - | + +## Methods + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`UserOrganizationInvitationResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/user-resource.mdx b/.typedoc/docs/types/user-resource.mdx new file mode 100644 index 00000000000..385cf6b9539 --- /dev/null +++ b/.typedoc/docs/types/user-resource.mdx @@ -0,0 +1,38 @@ +The `User` object holds all of the information for a single user of your application and provides a set of methods to manage their account. Each `User` has at least one authentication [identifier](/docs/authentication/configuration/sign-up-sign-in-options#identifiers), which might be their email address, phone number, or a username. + +A user can be contacted at their primary email address or primary phone number. They can have more than one registered email address, but only one of them will be their primary email address. This goes for phone numbers as well; a user can have more than one, but only one phone number will be their primary. At the same time, a user can also have one or more external accounts by connecting to [social providers](/docs/authentication/social-connections/oauth) such as Google, Apple, Facebook, and many more. + +Finally, a `User` object holds profile data like the user's name, profile picture, and a set of [metadata](/docs/users/metadata) that can be used internally to store arbitrary information. The metadata are split into `publicMetadata` and `privateMetadata`. Both types are set from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}, but public metadata can also be accessed from the [Frontend API](/docs/reference/frontend-api){{ target: '_blank' }}. + +The ClerkJS SDK provides some helper [methods](#methods) on the `User` object to help retrieve and update user information and authentication status. + +## Properties + +| 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 + +### reload() + +Reload the resource and return the resource itself. + +#### Parameters + +| Parameter | Type | +| --------- | --------------------------- | +| `p?` | `ClerkResourceReloadParams` | + +#### Returns + +`Promise`\<`UserResource`\> + +#### Inherited from + +[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/without.mdx b/.typedoc/docs/types/without.mdx new file mode 100644 index 00000000000..a4185e8e647 --- /dev/null +++ b/.typedoc/docs/types/without.mdx @@ -0,0 +1 @@ +Omit without union flattening From 02d730df7b302c3e19eb0ed08ebce6a2d923914e Mon Sep 17 00:00:00 2001 From: panteliselef Date: Wed, 27 Aug 2025 22:31:52 +0300 Subject: [PATCH 07/22] Revert "Revert "wip changes"" This reverts commit 54c8c22b1e3841122392014b08b4fa16af6ecf6f. --- .typedoc/custom-plugin.mjs | 6 ++++++ .typedoc/custom-theme.mjs | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.typedoc/custom-plugin.mjs b/.typedoc/custom-plugin.mjs index ee584a16964..13746882cd3 100644 --- a/.typedoc/custom-plugin.mjs +++ b/.typedoc/custom-plugin.mjs @@ -135,6 +135,12 @@ function getCatchAllReplacements() { pattern: /\*\*Deprecated\*\*/g, replace: '**Deprecated.**', }, + // Remove the standard experimental API notice block (with or without leading/trailing whitespace or newlines) + { + pattern: + /(?:\r?\n)?\*\*`Experimental`\*\*\r?\n\r?\nThis is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change\.\r?\nIt is advised to pin the SDK version to avoid breaking changes\.\r?\n?/g, + replace: '', + }, { /** * By default, `@default` is output with "**Default** `value`". We want to capture the value and place it inside "Defaults to `value`." diff --git a/.typedoc/custom-theme.mjs b/.typedoc/custom-theme.mjs index 6310f6a3d0a..0e81e6d89f5 100644 --- a/.typedoc/custom-theme.mjs +++ b/.typedoc/custom-theme.mjs @@ -220,11 +220,31 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { // Extract the Accessors group (if any) and prevent default rendering for it const originalGroups = customizedModel.groups; + + const experimentalGroups = originalGroups?.find(g => + g?.owningReflection?.comment?.modifierTags.has('@experimental'), + ); + + if (experimentalGroups) { + const groupsWithoutMethods = originalGroups?.filter(g => g.title === 'Properties'); + + customizedModel.groups = groupsWithoutMethods; + const nonAccessorOutput = superPartials.memberWithGroups(customizedModel, options); + customizedModel.groups = originalGroups; + + return nonAccessorOutput; + } + const accessorsGroup = originalGroups?.find(g => g.title === 'Accessors'); const groupsWithoutAccessors = originalGroups?.filter(g => g.title !== 'Accessors'); customizedModel.groups = groupsWithoutAccessors; const nonAccessorOutput = superPartials.memberWithGroups(customizedModel, options); + + if (experimentalGroups) { + return nonAccessorOutput; + } + customizedModel.groups = originalGroups; /** @type {string[]} */ From c4b7cf055e6d77a2eb8d2a94025fcd463ba6880b Mon Sep 17 00:00:00 2001 From: panteliselef Date: Wed, 27 Aug 2025 23:37:35 +0300 Subject: [PATCH 08/22] handle top sections --- .typedoc/custom-plugin.mjs | 21 ++++++++++++++------- .typedoc/custom-theme.mjs | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/.typedoc/custom-plugin.mjs b/.typedoc/custom-plugin.mjs index 13746882cd3..905915ff767 100644 --- a/.typedoc/custom-plugin.mjs +++ b/.typedoc/custom-plugin.mjs @@ -1,4 +1,4 @@ -// @ts-check +// @ts-check - Enable TypeScript checks for safer MDX post-processing and link rewriting import { MarkdownPageEvent } from 'typedoc-plugin-markdown'; /** @@ -83,6 +83,19 @@ function getRelativeLinkReplacements() { function getCatchAllReplacements() { return [ + // Robustly remove the full Experimental section (including optional Example/code block) + // from the first "**`Experimental`**" until the next heading (## ...) or end of file. + // This covers variations in wording/whitespace and ensures the block is stripped. + { + pattern: /(?:^|\r?\n)\*\*`Experimental`\*\*[\s\S]*?(?=(?:\r?\n##\s)|$)/g, + replace: '', + }, + // As a safeguard, remove any leftover Example section that specifically shows ClerkProvider clerkJsVersion snippet + { + pattern: + /(?:^|\r?\n)## Example\r?\n(?:\r?\n)?```tsx[\s\S]*?ClerkProvider\s+clerkJsVersion="[^"]*"[\s\S]*?```(?:\r?\n)?/g, + replace: '', + }, { pattern: /\(setActiveParams\)/g, replace: '([setActiveParams](/docs/references/javascript/types/set-active-params))', @@ -135,12 +148,6 @@ function getCatchAllReplacements() { pattern: /\*\*Deprecated\*\*/g, replace: '**Deprecated.**', }, - // Remove the standard experimental API notice block (with or without leading/trailing whitespace or newlines) - { - pattern: - /(?:\r?\n)?\*\*`Experimental`\*\*\r?\n\r?\nThis is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change\.\r?\nIt is advised to pin the SDK version to avoid breaking changes\.\r?\n?/g, - replace: '', - }, { /** * By default, `@default` is output with "**Default** `value`". We want to capture the value and place it inside "Defaults to `value`." diff --git a/.typedoc/custom-theme.mjs b/.typedoc/custom-theme.mjs index 0e81e6d89f5..fb77bb0ebae 100644 --- a/.typedoc/custom-theme.mjs +++ b/.typedoc/custom-theme.mjs @@ -46,6 +46,21 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { this.partials = { ...superPartials, + /** + * This hides the "Experimental" section from the output (by default). + * @param {import('typedoc').Comment} model + * @param {{ headingLevel?: number; showSummary?: boolean; showTags?: boolean; showReturns?: boolean; isTableColumn?: boolean }} [options] + */ + comment: (model, options) => { + if (model?.modifierTags.has('@experimental')) { + const originalBlockTags = model.blockTags; + model.blockTags = model.blockTags.filter(tag => tag.name !== '@example'); + const res = superPartials.comment(model, options); + model.blockTags = originalBlockTags; + return res; + } + return superPartials.comment(model, options); + }, /** * This hides the "Type parameters" section and the signature title from the output (by default). Shows the signature title if the `@displayFunctionSignature` tag is present. * @param {import('typedoc').SignatureReflection} model From d8c5dc26846209c8a9e71fbe5a1af81cd2aea03d Mon Sep 17 00:00:00 2001 From: panteliselef Date: Thu, 28 Aug 2025 00:19:56 +0300 Subject: [PATCH 09/22] scope to classes and interfaces --- .typedoc/custom-plugin.mjs | 13 ------------- .typedoc/custom-theme.mjs | 16 +++++++++++----- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/.typedoc/custom-plugin.mjs b/.typedoc/custom-plugin.mjs index 905915ff767..bd12260c429 100644 --- a/.typedoc/custom-plugin.mjs +++ b/.typedoc/custom-plugin.mjs @@ -83,19 +83,6 @@ function getRelativeLinkReplacements() { function getCatchAllReplacements() { return [ - // Robustly remove the full Experimental section (including optional Example/code block) - // from the first "**`Experimental`**" until the next heading (## ...) or end of file. - // This covers variations in wording/whitespace and ensures the block is stripped. - { - pattern: /(?:^|\r?\n)\*\*`Experimental`\*\*[\s\S]*?(?=(?:\r?\n##\s)|$)/g, - replace: '', - }, - // As a safeguard, remove any leftover Example section that specifically shows ClerkProvider clerkJsVersion snippet - { - pattern: - /(?:^|\r?\n)## Example\r?\n(?:\r?\n)?```tsx[\s\S]*?ClerkProvider\s+clerkJsVersion="[^"]*"[\s\S]*?```(?:\r?\n)?/g, - replace: '', - }, { pattern: /\(setActiveParams\)/g, replace: '([setActiveParams](/docs/references/javascript/types/set-active-params))', diff --git a/.typedoc/custom-theme.mjs b/.typedoc/custom-theme.mjs index fb77bb0ebae..fb5dee9b635 100644 --- a/.typedoc/custom-theme.mjs +++ b/.typedoc/custom-theme.mjs @@ -52,12 +52,18 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { * @param {{ headingLevel?: number; showSummary?: boolean; showTags?: boolean; showReturns?: boolean; isTableColumn?: boolean }} [options] */ comment: (model, options) => { - if (model?.modifierTags.has('@experimental')) { - const originalBlockTags = model.blockTags; - model.blockTags = model.blockTags.filter(tag => tag.name !== '@example'); + if ( + model.hasModifier('@experimental') && + [ReflectionKind.Class, ReflectionKind.Interface].includes(this.page?.model?.kind) + ) { + model.removeModifier('@experimental'); + model.removeTags('@example'); + model.removeTags('@see'); + const res = superPartials.comment(model, options); - model.blockTags = originalBlockTags; - return res; + + const [line, ...linesToInclude] = res.replace(/^\n\n/, '').split('\n'); + return linesToInclude.join('\n'); } return superPartials.comment(model, options); }, From 6b7da9fac39547f5454a51bbc909fda1a007b37d Mon Sep 17 00:00:00 2001 From: panteliselef Date: Thu, 28 Aug 2025 00:27:31 +0300 Subject: [PATCH 10/22] remove redudant code --- .typedoc/custom-theme.mjs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.typedoc/custom-theme.mjs b/.typedoc/custom-theme.mjs index fb5dee9b635..6a923f5e177 100644 --- a/.typedoc/custom-theme.mjs +++ b/.typedoc/custom-theme.mjs @@ -262,10 +262,6 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { customizedModel.groups = groupsWithoutAccessors; const nonAccessorOutput = superPartials.memberWithGroups(customizedModel, options); - if (experimentalGroups) { - return nonAccessorOutput; - } - customizedModel.groups = originalGroups; /** @type {string[]} */ From def7a204f07f3d25bc9cbf5310ae659f9f99d412 Mon Sep 17 00:00:00 2001 From: panteliselef Date: Thu, 28 Aug 2025 00:28:49 +0300 Subject: [PATCH 11/22] Revert "typedoc files" This reverts commit b0378799472eaf1ce1fa829bb653c8890170f991. --- .gitignore | 2 +- .prettierignore | 1 - .../docs/backend/allowlist-identifier.mdx | 13 - .typedoc/docs/backend/auth-object.mdx | 8 - .../backend/authenticate-request-options.mdx | 24 -- .typedoc/docs/backend/client.mdx | 14 - ...rce-payment-attempt-webhook-event-json.mdx | 8 - .typedoc/docs/backend/commerce-plan-json.mdx | 24 -- .typedoc/docs/backend/commerce-plan.mdx | 68 ---- .../commerce-subscription-item-json.mdx | 27 -- ...e-subscription-item-webhook-event-json.mdx | 8 - .../backend/commerce-subscription-item.mdx | 74 ---- ...mmerce-subscription-webhook-event-json.mdx | 8 - .../docs/backend/commerce-subscription.mdx | 60 ---- .typedoc/docs/backend/email-address.mdx | 14 - .typedoc/docs/backend/external-account.mdx | 22 -- .typedoc/docs/backend/get-auth-fn.mdx | 101 ------ .typedoc/docs/backend/identification-link.mdx | 8 - .../infer-auth-object-from-token-array.mdx | 5 - .../backend/infer-auth-object-from-token.mdx | 2 - .typedoc/docs/backend/invitation-status.mdx | 0 .typedoc/docs/backend/invitation.mdx | 14 - .typedoc/docs/backend/o-auth-application.mdx | 26 -- .../organization-invitation-status.mdx | 0 .../docs/backend/organization-invitation.mdx | 19 - ...ganization-membership-public-user-data.mdx | 8 - .../docs/backend/organization-membership.mdx | 15 - .../backend/organization-sync-options.mdx | 8 - .../docs/backend/organization-sync-target.mdx | 2 - .typedoc/docs/backend/organization.mdx | 19 - .../backend/paginated-resource-response.mdx | 14 - .typedoc/docs/backend/phone-number.mdx | 16 - .../backend/public-organization-data-json.mdx | 8 - .typedoc/docs/backend/redirect-url.mdx | 12 - .typedoc/docs/backend/saml-account.mdx | 15 - .typedoc/docs/backend/saml-connection.mdx | 27 -- .typedoc/docs/backend/session-activity.mdx | 14 - .typedoc/docs/backend/session.mdx | 18 - .typedoc/docs/backend/user.mdx | 47 --- .typedoc/docs/backend/verification.mdx | 13 - .../backend/verify-machine-auth-token.mdx | 12 - .../docs/backend/verify-token-options.mdx | 11 - .typedoc/docs/backend/verify-token.mdx | 91 ----- .../docs/backend/verify-webhook-options.mdx | 7 - .typedoc/docs/backend/verify-webhook.mdx | 42 --- .typedoc/docs/backend/web3-wallet.mdx | 11 - .typedoc/docs/clerk-react/api-keys.mdx | 19 - .../docs/clerk-react/clerk-provider-props.mdx | 43 --- .typedoc/docs/clerk-react/protect.mdx | 21 -- .../redirect-to-create-organization.mdx | 13 - .../redirect-to-organization-profile.mdx | 13 - .../clerk-react/redirect-to-user-profile.mdx | 13 - .typedoc/docs/clerk-react/use-auth.mdx | 176 ---------- .typedoc/docs/clerk-react/use-clerk.mdx | 43 --- .../clerk-react/use-organization-list.mdx | 150 -------- .../docs/clerk-react/use-organization.mdx | 130 ------- .../docs/clerk-react/use-reverification.mdx | 55 --- .../docs/clerk-react/use-session-list.mdx | 77 ---- .typedoc/docs/clerk-react/use-session.mdx | 98 ------ .typedoc/docs/clerk-react/use-sign-in.mdx | 73 ---- .typedoc/docs/clerk-react/use-sign-up.mdx | 73 ---- .typedoc/docs/clerk-react/use-user.mdx | 211 ----------- .typedoc/docs/nextjs/auth.mdx | 5 - .typedoc/docs/nextjs/build-clerk-props.mdx | 38 -- .../nextjs/clerk-middleware-auth-object.mdx | 3 - .../docs/nextjs/clerk-middleware-options.mdx | 29 -- .typedoc/docs/nextjs/clerk-middleware.mdx | 1 - .../docs/nextjs/create-async-get-auth.mdx | 23 -- .typedoc/docs/nextjs/create-sync-get-auth.mdx | 24 -- .typedoc/docs/nextjs/current-user.mdx | 25 -- .typedoc/docs/nextjs/get-auth.mdx | 86 ----- .../shared/api-url-from-publishable-key.mdx | 11 - .../build-clerk-js-script-attributes.mdx | 11 - .../docs/shared/build-publishable-key.mdx | 11 - .typedoc/docs/shared/camel-to-snake.mdx | 11 - .typedoc/docs/shared/clerk-js-script-url.mdx | 18 - .typedoc/docs/shared/clerk-runtime-error.mdx | 26 -- .../create-dev-or-staging-url-cache.mdx | 10 - .typedoc/docs/shared/create-path-matcher.mdx | 21 -- .typedoc/docs/shared/deep-camel-to-snake.mdx | 13 - .typedoc/docs/shared/deep-snake-to-camel.mdx | 13 - .../shared/deprecated-object-property.mdx | 21 -- .typedoc/docs/shared/derive-state.mdx | 29 -- .../extract-dev-browser-jwt-from-url.mdx | 13 - .../shared/fast-deep-merge-and-replace.mdx | 14 - .../get-clerk-js-major-version-or-tag.mdx | 14 - .typedoc/docs/shared/get-cookie-suffix.mdx | 13 - .typedoc/docs/shared/get-env-variable.mdx | 12 - .../docs/shared/get-non-undefined-values.mdx | 11 - .typedoc/docs/shared/get-script-url.mdx | 14 - .../docs/shared/get-suffixed-cookie-name.mdx | 13 - .typedoc/docs/shared/icon-image-url.mdx | 13 - .typedoc/docs/shared/in-browser.mdx | 5 - .typedoc/docs/shared/is-browser-online.mdx | 5 - .../docs/shared/is-clerk-runtime-error.mdx | 24 -- .../is-development-from-publishable-key.mdx | 12 - .../shared/is-development-from-secret-key.mdx | 12 - .typedoc/docs/shared/is-ipv4-address.mdx | 11 - .../is-production-from-publishable-key.mdx | 12 - .../shared/is-production-from-secret-key.mdx | 12 - .typedoc/docs/shared/is-publishable-key.mdx | 11 - .typedoc/docs/shared/is-staging.mdx | 11 - .typedoc/docs/shared/is-truthy.mdx | 11 - .../docs/shared/is-valid-browser-online.mdx | 5 - .typedoc/docs/shared/is-valid-browser.mdx | 5 - .typedoc/docs/shared/isomorphic-atob.mdx | 12 - .typedoc/docs/shared/load-clerk-js-script.mdx | 26 -- .../docs/shared/pages-or-infinite-options.mdx | 4 - .../docs/shared/paginated-hook-config.mdx | 4 - .typedoc/docs/shared/paginated-resources.mdx | 17 - .../docs/shared/parse-publishable-key.mdx | 47 --- .typedoc/docs/shared/read-json-file.mdx | 14 - ...et-clerk-js-loading-error-package-name.mdx | 17 - .typedoc/docs/shared/snake-to-camel.mdx | 11 - .typedoc/docs/shared/titleize.mdx | 17 - .typedoc/docs/shared/to-sentence.mdx | 11 - .typedoc/docs/shared/use-clerk.mdx | 43 --- .../shared/use-organization-list-params.mdx | 5 - .../shared/use-organization-list-return.mdx | 8 - .../docs/shared/use-organization-list.mdx | 150 -------- .../docs/shared/use-organization-params.mdx | 7 - .../docs/shared/use-organization-return.mdx | 10 - .typedoc/docs/shared/use-organization.mdx | 130 ------- .typedoc/docs/shared/use-reverification.mdx | 55 --- .typedoc/docs/shared/use-session-list.mdx | 77 ---- .typedoc/docs/shared/use-session.mdx | 98 ------ .typedoc/docs/shared/use-user.mdx | 211 ----------- .typedoc/docs/shared/user-agent-is-robot.mdx | 11 - .typedoc/docs/shared/version-selector.mdx | 17 - .typedoc/docs/types/act-claim.mdx | 1 - .typedoc/docs/types/act-jwt-claim.mdx | 5 - .../docs/types/active-session-resource.mdx | 33 -- .../docs/types/add-payment-source-params.mdx | 10 - .../docs/types/cancel-subscription-params.mdx | 10 - .../docs/types/check-authorization-fn.mdx | 9 - ...heck-authorization-from-session-claims.mdx | 13 - ...thorization-params-from-session-claims.mdx | 9 - ...-authorization-with-custom-permissions.mdx | 0 .typedoc/docs/types/clerk-api-error.mdx | 24 -- .../docs/types/clerk-api-response-error.mdx | 1 - .typedoc/docs/types/clerk-host-router.mdx | 1 - .typedoc/docs/types/clerk-jwt-claims.mdx | 28 -- .../docs/types/clerk-paginated-response.mdx | 11 - .../docs/types/clerk-pagination-params.mdx | 6 - .../docs/types/clerk-pagination-request.mdx | 8 - .typedoc/docs/types/clerk-resource.mdx | 24 -- .typedoc/docs/types/clerk-status.mdx | 0 .typedoc/docs/types/clerk.mdx | 332 ------------------ .../docs/types/commerce-billing-namespace.mdx | 24 -- .../docs/types/commerce-checkout-json.mdx | 27 -- .../docs/types/commerce-checkout-resource.mdx | 48 --- .../types/commerce-checkout-totals-json.mdx | 20 -- .../docs/types/commerce-checkout-totals.mdx | 21 -- .typedoc/docs/types/commerce-feature-json.mdx | 21 -- .../docs/types/commerce-feature-resource.mdx | 42 --- ...mmerce-initialized-payment-source-json.mdx | 20 -- ...ce-initialized-payment-source-resource.mdx | 40 --- .../docs/types/commerce-money-amount-json.mdx | 19 - .typedoc/docs/types/commerce-money-amount.mdx | 19 - .../types/commerce-payer-resource-type.mdx | 10 - .../types/commerce-payment-charge-type.mdx | 10 - .typedoc/docs/types/commerce-payment-json.mdx | 26 -- .../docs/types/commerce-payment-resource.mdx | 46 --- .../types/commerce-payment-source-json.mdx | 24 -- .../types/commerce-payment-source-methods.mdx | 18 - .../commerce-payment-source-resource.mdx | 46 --- .../types/commerce-payment-source-status.mdx | 10 - .../docs/types/commerce-payment-status.mdx | 10 - .typedoc/docs/types/commerce-plan-json.mdx | 40 --- .../docs/types/commerce-plan-resource.mdx | 52 --- .typedoc/docs/types/commerce-product-json.mdx | 21 -- .../docs/types/commerce-product-resource.mdx | 41 --- .../types/commerce-statement-group-json.mdx | 19 - .../docs/types/commerce-statement-group.mdx | 17 - .../docs/types/commerce-statement-json.mdx | 21 -- .../types/commerce-statement-resource.mdx | 41 --- .../docs/types/commerce-statement-status.mdx | 10 - .../types/commerce-statement-totals-json.mdx | 19 - .../docs/types/commerce-statement-totals.mdx | 20 -- .../types/commerce-subscription-item-json.mdx | 30 -- .../commerce-subscription-item-resource.mdx | 51 --- .../docs/types/commerce-subscription-json.mdx | 27 -- .../commerce-subscription-plan-period.mdx | 10 - .../types/commerce-subscription-resource.mdx | 45 --- .../types/commerce-subscription-status.mdx | 10 - .../docs/types/confirm-checkout-params.mdx | 10 - .../docs/types/create-checkout-params.mdx | 10 - .../docs/types/create-organization-params.mdx | 4 - .typedoc/docs/types/element-object-key.mdx | 1 - .typedoc/docs/types/elements-config.mdx | 3 - .../experimental_checkout-button-props.mdx | 23 -- ...experimental_plan-details-button-props.mdx | 22 -- ...ntal_subscription-details-button-props.mdx | 23 -- .typedoc/docs/types/for-payer-type.mdx | 10 - .../types/get-payment-attempts-params.mdx | 10 - .../docs/types/get-payment-sources-params.mdx | 10 - .typedoc/docs/types/get-plans-params.mdx | 10 - .typedoc/docs/types/get-statements-params.mdx | 10 - .../docs/types/get-subscription-params.mdx | 10 - .../docs/types/get-subscriptions-params.mdx | 10 - .typedoc/docs/types/get-token.mdx | 9 - .typedoc/docs/types/id-selectors.mdx | 1 - .../initialize-payment-source-params.mdx | 10 - .../docs/types/internal_checkout-props.mdx | 23 -- .../types/internal_plan-details-props.mdx | 24 -- .../internal_subscription-details-props.mdx | 23 -- .typedoc/docs/types/jwt-claims.mdx | 27 -- .typedoc/docs/types/jwt-header.mdx | 3 - .typedoc/docs/types/legacy-redirect-props.mdx | 13 - .typedoc/docs/types/localization-resource.mdx | 13 - .../make-default-payment-source-params.mdx | 10 - .../docs/types/multi-domain-and-or-proxy.mdx | 26 -- .../types/organization-custom-role-key.mdx | 3 - .../types/organization-domain-resource.mdx | 28 -- ...rganization-domain-verification-status.mdx | 0 .../types/organization-enrollment-mode.mdx | 0 .../organization-invitation-resource.mdx | 28 -- .../types/organization-invitation-status.mdx | 0 ...ganization-membership-request-resource.mdx | 28 -- .../organization-membership-resource.mdx | 28 -- .../types/organization-permission-key.mdx | 2 - .typedoc/docs/types/organization-resource.mdx | 34 -- .../organization-suggestion-resource.mdx | 28 -- .../types/organization-suggestion-status.mdx | 0 .../docs/types/organizations-jwt-claim.mdx | 3 - .typedoc/docs/types/override.mdx | 4 - .typedoc/docs/types/path-value.mdx | 4 - .typedoc/docs/types/payment-gateway.mdx | 10 - .../docs/types/pending-session-options.mdx | 7 - .../docs/types/pending-session-resource.mdx | 32 -- .typedoc/docs/types/protect-props.mdx | 22 -- .typedoc/docs/types/record-to-path.mdx | 4 - .typedoc/docs/types/redirect-options.mdx | 2 - .../types/remove-payment-source-params.mdx | 10 - .typedoc/docs/types/reverification-config.mdx | 10 - .typedoc/docs/types/saml-strategy.mdx | 3 - .typedoc/docs/types/sdk-metadata.mdx | 9 - .../docs/types/server-get-token-options.mdx | 10 - .typedoc/docs/types/server-get-token.mdx | 11 - .typedoc/docs/types/session-resource.mdx | 43 --- .typedoc/docs/types/session-status-claim.mdx | 1 - .typedoc/docs/types/session-task.mdx | 7 - .../docs/types/session-verification-level.mdx | 0 .../docs/types/session-verification-types.mdx | 0 .typedoc/docs/types/set-active-params.mdx | 11 - .typedoc/docs/types/set-active.mdx | 9 - .typedoc/docs/types/sign-in-resource.mdx | 30 -- .typedoc/docs/types/sign-out.mdx | 24 -- ...n-up-authenticate-with-metamask-params.mdx | 3 - .typedoc/docs/types/sign-up-resource.mdx | 29 -- .../docs/types/signed-in-session-resource.mdx | 2 - .typedoc/docs/types/state-selectors.mdx | 1 - .typedoc/docs/types/telemetry-log-entry.mdx | 1 - .typedoc/docs/types/use-auth-return.mdx | 61 ---- .../docs/types/use-session-list-return.mdx | 13 - .typedoc/docs/types/use-session-return.mdx | 19 - .typedoc/docs/types/use-sign-in-return.mdx | 13 - .typedoc/docs/types/use-sign-up-return.mdx | 13 - .typedoc/docs/types/use-user-return.mdx | 19 - .../user-organization-invitation-resource.mdx | 28 -- .typedoc/docs/types/user-resource.mdx | 38 -- .typedoc/docs/types/without.mdx | 1 - 262 files changed, 1 insertion(+), 6385 deletions(-) delete mode 100644 .typedoc/docs/backend/allowlist-identifier.mdx delete mode 100644 .typedoc/docs/backend/auth-object.mdx delete mode 100644 .typedoc/docs/backend/authenticate-request-options.mdx delete mode 100644 .typedoc/docs/backend/client.mdx delete mode 100644 .typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx delete mode 100644 .typedoc/docs/backend/commerce-plan-json.mdx delete mode 100644 .typedoc/docs/backend/commerce-plan.mdx delete mode 100644 .typedoc/docs/backend/commerce-subscription-item-json.mdx delete mode 100644 .typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx delete mode 100644 .typedoc/docs/backend/commerce-subscription-item.mdx delete mode 100644 .typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx delete mode 100644 .typedoc/docs/backend/commerce-subscription.mdx delete mode 100644 .typedoc/docs/backend/email-address.mdx delete mode 100644 .typedoc/docs/backend/external-account.mdx delete mode 100644 .typedoc/docs/backend/get-auth-fn.mdx delete mode 100644 .typedoc/docs/backend/identification-link.mdx delete mode 100644 .typedoc/docs/backend/infer-auth-object-from-token-array.mdx delete mode 100644 .typedoc/docs/backend/infer-auth-object-from-token.mdx delete mode 100644 .typedoc/docs/backend/invitation-status.mdx delete mode 100644 .typedoc/docs/backend/invitation.mdx delete mode 100644 .typedoc/docs/backend/o-auth-application.mdx delete mode 100644 .typedoc/docs/backend/organization-invitation-status.mdx delete mode 100644 .typedoc/docs/backend/organization-invitation.mdx delete mode 100644 .typedoc/docs/backend/organization-membership-public-user-data.mdx delete mode 100644 .typedoc/docs/backend/organization-membership.mdx delete mode 100644 .typedoc/docs/backend/organization-sync-options.mdx delete mode 100644 .typedoc/docs/backend/organization-sync-target.mdx delete mode 100644 .typedoc/docs/backend/organization.mdx delete mode 100644 .typedoc/docs/backend/paginated-resource-response.mdx delete mode 100644 .typedoc/docs/backend/phone-number.mdx delete mode 100644 .typedoc/docs/backend/public-organization-data-json.mdx delete mode 100644 .typedoc/docs/backend/redirect-url.mdx delete mode 100644 .typedoc/docs/backend/saml-account.mdx delete mode 100644 .typedoc/docs/backend/saml-connection.mdx delete mode 100644 .typedoc/docs/backend/session-activity.mdx delete mode 100644 .typedoc/docs/backend/session.mdx delete mode 100644 .typedoc/docs/backend/user.mdx delete mode 100644 .typedoc/docs/backend/verification.mdx delete mode 100644 .typedoc/docs/backend/verify-machine-auth-token.mdx delete mode 100644 .typedoc/docs/backend/verify-token-options.mdx delete mode 100644 .typedoc/docs/backend/verify-token.mdx delete mode 100644 .typedoc/docs/backend/verify-webhook-options.mdx delete mode 100644 .typedoc/docs/backend/verify-webhook.mdx delete mode 100644 .typedoc/docs/backend/web3-wallet.mdx delete mode 100644 .typedoc/docs/clerk-react/api-keys.mdx delete mode 100644 .typedoc/docs/clerk-react/clerk-provider-props.mdx delete mode 100644 .typedoc/docs/clerk-react/protect.mdx delete mode 100644 .typedoc/docs/clerk-react/redirect-to-create-organization.mdx delete mode 100644 .typedoc/docs/clerk-react/redirect-to-organization-profile.mdx delete mode 100644 .typedoc/docs/clerk-react/redirect-to-user-profile.mdx delete mode 100644 .typedoc/docs/clerk-react/use-auth.mdx delete mode 100644 .typedoc/docs/clerk-react/use-clerk.mdx delete mode 100644 .typedoc/docs/clerk-react/use-organization-list.mdx delete mode 100644 .typedoc/docs/clerk-react/use-organization.mdx delete mode 100644 .typedoc/docs/clerk-react/use-reverification.mdx delete mode 100644 .typedoc/docs/clerk-react/use-session-list.mdx delete mode 100644 .typedoc/docs/clerk-react/use-session.mdx delete mode 100644 .typedoc/docs/clerk-react/use-sign-in.mdx delete mode 100644 .typedoc/docs/clerk-react/use-sign-up.mdx delete mode 100644 .typedoc/docs/clerk-react/use-user.mdx delete mode 100644 .typedoc/docs/nextjs/auth.mdx delete mode 100644 .typedoc/docs/nextjs/build-clerk-props.mdx delete mode 100644 .typedoc/docs/nextjs/clerk-middleware-auth-object.mdx delete mode 100644 .typedoc/docs/nextjs/clerk-middleware-options.mdx delete mode 100644 .typedoc/docs/nextjs/clerk-middleware.mdx delete mode 100644 .typedoc/docs/nextjs/create-async-get-auth.mdx delete mode 100644 .typedoc/docs/nextjs/create-sync-get-auth.mdx delete mode 100644 .typedoc/docs/nextjs/current-user.mdx delete mode 100644 .typedoc/docs/nextjs/get-auth.mdx delete mode 100644 .typedoc/docs/shared/api-url-from-publishable-key.mdx delete mode 100644 .typedoc/docs/shared/build-clerk-js-script-attributes.mdx delete mode 100644 .typedoc/docs/shared/build-publishable-key.mdx delete mode 100644 .typedoc/docs/shared/camel-to-snake.mdx delete mode 100644 .typedoc/docs/shared/clerk-js-script-url.mdx delete mode 100644 .typedoc/docs/shared/clerk-runtime-error.mdx delete mode 100644 .typedoc/docs/shared/create-dev-or-staging-url-cache.mdx delete mode 100644 .typedoc/docs/shared/create-path-matcher.mdx delete mode 100644 .typedoc/docs/shared/deep-camel-to-snake.mdx delete mode 100644 .typedoc/docs/shared/deep-snake-to-camel.mdx delete mode 100644 .typedoc/docs/shared/deprecated-object-property.mdx delete mode 100644 .typedoc/docs/shared/derive-state.mdx delete mode 100644 .typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx delete mode 100644 .typedoc/docs/shared/fast-deep-merge-and-replace.mdx delete mode 100644 .typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx delete mode 100644 .typedoc/docs/shared/get-cookie-suffix.mdx delete mode 100644 .typedoc/docs/shared/get-env-variable.mdx delete mode 100644 .typedoc/docs/shared/get-non-undefined-values.mdx delete mode 100644 .typedoc/docs/shared/get-script-url.mdx delete mode 100644 .typedoc/docs/shared/get-suffixed-cookie-name.mdx delete mode 100644 .typedoc/docs/shared/icon-image-url.mdx delete mode 100644 .typedoc/docs/shared/in-browser.mdx delete mode 100644 .typedoc/docs/shared/is-browser-online.mdx delete mode 100644 .typedoc/docs/shared/is-clerk-runtime-error.mdx delete mode 100644 .typedoc/docs/shared/is-development-from-publishable-key.mdx delete mode 100644 .typedoc/docs/shared/is-development-from-secret-key.mdx delete mode 100644 .typedoc/docs/shared/is-ipv4-address.mdx delete mode 100644 .typedoc/docs/shared/is-production-from-publishable-key.mdx delete mode 100644 .typedoc/docs/shared/is-production-from-secret-key.mdx delete mode 100644 .typedoc/docs/shared/is-publishable-key.mdx delete mode 100644 .typedoc/docs/shared/is-staging.mdx delete mode 100644 .typedoc/docs/shared/is-truthy.mdx delete mode 100644 .typedoc/docs/shared/is-valid-browser-online.mdx delete mode 100644 .typedoc/docs/shared/is-valid-browser.mdx delete mode 100644 .typedoc/docs/shared/isomorphic-atob.mdx delete mode 100644 .typedoc/docs/shared/load-clerk-js-script.mdx delete mode 100644 .typedoc/docs/shared/pages-or-infinite-options.mdx delete mode 100644 .typedoc/docs/shared/paginated-hook-config.mdx delete mode 100644 .typedoc/docs/shared/paginated-resources.mdx delete mode 100644 .typedoc/docs/shared/parse-publishable-key.mdx delete mode 100644 .typedoc/docs/shared/read-json-file.mdx delete mode 100644 .typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx delete mode 100644 .typedoc/docs/shared/snake-to-camel.mdx delete mode 100644 .typedoc/docs/shared/titleize.mdx delete mode 100644 .typedoc/docs/shared/to-sentence.mdx delete mode 100644 .typedoc/docs/shared/use-clerk.mdx delete mode 100644 .typedoc/docs/shared/use-organization-list-params.mdx delete mode 100644 .typedoc/docs/shared/use-organization-list-return.mdx delete mode 100644 .typedoc/docs/shared/use-organization-list.mdx delete mode 100644 .typedoc/docs/shared/use-organization-params.mdx delete mode 100644 .typedoc/docs/shared/use-organization-return.mdx delete mode 100644 .typedoc/docs/shared/use-organization.mdx delete mode 100644 .typedoc/docs/shared/use-reverification.mdx delete mode 100644 .typedoc/docs/shared/use-session-list.mdx delete mode 100644 .typedoc/docs/shared/use-session.mdx delete mode 100644 .typedoc/docs/shared/use-user.mdx delete mode 100644 .typedoc/docs/shared/user-agent-is-robot.mdx delete mode 100644 .typedoc/docs/shared/version-selector.mdx delete mode 100644 .typedoc/docs/types/act-claim.mdx delete mode 100644 .typedoc/docs/types/act-jwt-claim.mdx delete mode 100644 .typedoc/docs/types/active-session-resource.mdx delete mode 100644 .typedoc/docs/types/add-payment-source-params.mdx delete mode 100644 .typedoc/docs/types/cancel-subscription-params.mdx delete mode 100644 .typedoc/docs/types/check-authorization-fn.mdx delete mode 100644 .typedoc/docs/types/check-authorization-from-session-claims.mdx delete mode 100644 .typedoc/docs/types/check-authorization-params-from-session-claims.mdx delete mode 100644 .typedoc/docs/types/check-authorization-with-custom-permissions.mdx delete mode 100644 .typedoc/docs/types/clerk-api-error.mdx delete mode 100644 .typedoc/docs/types/clerk-api-response-error.mdx delete mode 100644 .typedoc/docs/types/clerk-host-router.mdx delete mode 100644 .typedoc/docs/types/clerk-jwt-claims.mdx delete mode 100644 .typedoc/docs/types/clerk-paginated-response.mdx delete mode 100644 .typedoc/docs/types/clerk-pagination-params.mdx delete mode 100644 .typedoc/docs/types/clerk-pagination-request.mdx delete mode 100644 .typedoc/docs/types/clerk-resource.mdx delete mode 100644 .typedoc/docs/types/clerk-status.mdx delete mode 100644 .typedoc/docs/types/clerk.mdx delete mode 100644 .typedoc/docs/types/commerce-billing-namespace.mdx delete mode 100644 .typedoc/docs/types/commerce-checkout-json.mdx delete mode 100644 .typedoc/docs/types/commerce-checkout-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-checkout-totals-json.mdx delete mode 100644 .typedoc/docs/types/commerce-checkout-totals.mdx delete mode 100644 .typedoc/docs/types/commerce-feature-json.mdx delete mode 100644 .typedoc/docs/types/commerce-feature-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-initialized-payment-source-json.mdx delete mode 100644 .typedoc/docs/types/commerce-initialized-payment-source-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-money-amount-json.mdx delete mode 100644 .typedoc/docs/types/commerce-money-amount.mdx delete mode 100644 .typedoc/docs/types/commerce-payer-resource-type.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-charge-type.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-json.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-source-json.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-source-methods.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-source-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-source-status.mdx delete mode 100644 .typedoc/docs/types/commerce-payment-status.mdx delete mode 100644 .typedoc/docs/types/commerce-plan-json.mdx delete mode 100644 .typedoc/docs/types/commerce-plan-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-product-json.mdx delete mode 100644 .typedoc/docs/types/commerce-product-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-statement-group-json.mdx delete mode 100644 .typedoc/docs/types/commerce-statement-group.mdx delete mode 100644 .typedoc/docs/types/commerce-statement-json.mdx delete mode 100644 .typedoc/docs/types/commerce-statement-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-statement-status.mdx delete mode 100644 .typedoc/docs/types/commerce-statement-totals-json.mdx delete mode 100644 .typedoc/docs/types/commerce-statement-totals.mdx delete mode 100644 .typedoc/docs/types/commerce-subscription-item-json.mdx delete mode 100644 .typedoc/docs/types/commerce-subscription-item-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-subscription-json.mdx delete mode 100644 .typedoc/docs/types/commerce-subscription-plan-period.mdx delete mode 100644 .typedoc/docs/types/commerce-subscription-resource.mdx delete mode 100644 .typedoc/docs/types/commerce-subscription-status.mdx delete mode 100644 .typedoc/docs/types/confirm-checkout-params.mdx delete mode 100644 .typedoc/docs/types/create-checkout-params.mdx delete mode 100644 .typedoc/docs/types/create-organization-params.mdx delete mode 100644 .typedoc/docs/types/element-object-key.mdx delete mode 100644 .typedoc/docs/types/elements-config.mdx delete mode 100644 .typedoc/docs/types/experimental_checkout-button-props.mdx delete mode 100644 .typedoc/docs/types/experimental_plan-details-button-props.mdx delete mode 100644 .typedoc/docs/types/experimental_subscription-details-button-props.mdx delete mode 100644 .typedoc/docs/types/for-payer-type.mdx delete mode 100644 .typedoc/docs/types/get-payment-attempts-params.mdx delete mode 100644 .typedoc/docs/types/get-payment-sources-params.mdx delete mode 100644 .typedoc/docs/types/get-plans-params.mdx delete mode 100644 .typedoc/docs/types/get-statements-params.mdx delete mode 100644 .typedoc/docs/types/get-subscription-params.mdx delete mode 100644 .typedoc/docs/types/get-subscriptions-params.mdx delete mode 100644 .typedoc/docs/types/get-token.mdx delete mode 100644 .typedoc/docs/types/id-selectors.mdx delete mode 100644 .typedoc/docs/types/initialize-payment-source-params.mdx delete mode 100644 .typedoc/docs/types/internal_checkout-props.mdx delete mode 100644 .typedoc/docs/types/internal_plan-details-props.mdx delete mode 100644 .typedoc/docs/types/internal_subscription-details-props.mdx delete mode 100644 .typedoc/docs/types/jwt-claims.mdx delete mode 100644 .typedoc/docs/types/jwt-header.mdx delete mode 100644 .typedoc/docs/types/legacy-redirect-props.mdx delete mode 100644 .typedoc/docs/types/localization-resource.mdx delete mode 100644 .typedoc/docs/types/make-default-payment-source-params.mdx delete mode 100644 .typedoc/docs/types/multi-domain-and-or-proxy.mdx delete mode 100644 .typedoc/docs/types/organization-custom-role-key.mdx delete mode 100644 .typedoc/docs/types/organization-domain-resource.mdx delete mode 100644 .typedoc/docs/types/organization-domain-verification-status.mdx delete mode 100644 .typedoc/docs/types/organization-enrollment-mode.mdx delete mode 100644 .typedoc/docs/types/organization-invitation-resource.mdx delete mode 100644 .typedoc/docs/types/organization-invitation-status.mdx delete mode 100644 .typedoc/docs/types/organization-membership-request-resource.mdx delete mode 100644 .typedoc/docs/types/organization-membership-resource.mdx delete mode 100644 .typedoc/docs/types/organization-permission-key.mdx delete mode 100644 .typedoc/docs/types/organization-resource.mdx delete mode 100644 .typedoc/docs/types/organization-suggestion-resource.mdx delete mode 100644 .typedoc/docs/types/organization-suggestion-status.mdx delete mode 100644 .typedoc/docs/types/organizations-jwt-claim.mdx delete mode 100644 .typedoc/docs/types/override.mdx delete mode 100644 .typedoc/docs/types/path-value.mdx delete mode 100644 .typedoc/docs/types/payment-gateway.mdx delete mode 100644 .typedoc/docs/types/pending-session-options.mdx delete mode 100644 .typedoc/docs/types/pending-session-resource.mdx delete mode 100644 .typedoc/docs/types/protect-props.mdx delete mode 100644 .typedoc/docs/types/record-to-path.mdx delete mode 100644 .typedoc/docs/types/redirect-options.mdx delete mode 100644 .typedoc/docs/types/remove-payment-source-params.mdx delete mode 100644 .typedoc/docs/types/reverification-config.mdx delete mode 100644 .typedoc/docs/types/saml-strategy.mdx delete mode 100644 .typedoc/docs/types/sdk-metadata.mdx delete mode 100644 .typedoc/docs/types/server-get-token-options.mdx delete mode 100644 .typedoc/docs/types/server-get-token.mdx delete mode 100644 .typedoc/docs/types/session-resource.mdx delete mode 100644 .typedoc/docs/types/session-status-claim.mdx delete mode 100644 .typedoc/docs/types/session-task.mdx delete mode 100644 .typedoc/docs/types/session-verification-level.mdx delete mode 100644 .typedoc/docs/types/session-verification-types.mdx delete mode 100644 .typedoc/docs/types/set-active-params.mdx delete mode 100644 .typedoc/docs/types/set-active.mdx delete mode 100644 .typedoc/docs/types/sign-in-resource.mdx delete mode 100644 .typedoc/docs/types/sign-out.mdx delete mode 100644 .typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx delete mode 100644 .typedoc/docs/types/sign-up-resource.mdx delete mode 100644 .typedoc/docs/types/signed-in-session-resource.mdx delete mode 100644 .typedoc/docs/types/state-selectors.mdx delete mode 100644 .typedoc/docs/types/telemetry-log-entry.mdx delete mode 100644 .typedoc/docs/types/use-auth-return.mdx delete mode 100644 .typedoc/docs/types/use-session-list-return.mdx delete mode 100644 .typedoc/docs/types/use-session-return.mdx delete mode 100644 .typedoc/docs/types/use-sign-in-return.mdx delete mode 100644 .typedoc/docs/types/use-sign-up-return.mdx delete mode 100644 .typedoc/docs/types/use-user-return.mdx delete mode 100644 .typedoc/docs/types/user-organization-invitation-resource.mdx delete mode 100644 .typedoc/docs/types/user-resource.mdx delete mode 100644 .typedoc/docs/types/without.mdx diff --git a/.gitignore b/.gitignore index 082710d3a61..dd5f9738fb7 100644 --- a/.gitignore +++ b/.gitignore @@ -97,5 +97,5 @@ scripts/.env !scripts/.env.example # typedoc -# .typedoc/docs +.typedoc/docs .typedoc/docs.json diff --git a/.prettierignore b/.prettierignore index 8ac2a50af29..51265795595 100644 --- a/.prettierignore +++ b/.prettierignore @@ -22,4 +22,3 @@ playground packages/backend/tests/**/*.js /**/CHANGELOG.md renovate.json5 -.typedoc/docs \ No newline at end of file diff --git a/.typedoc/docs/backend/allowlist-identifier.mdx b/.typedoc/docs/backend/allowlist-identifier.mdx deleted file mode 100644 index bb250e6833a..00000000000 --- a/.typedoc/docs/backend/allowlist-identifier.mdx +++ /dev/null @@ -1,13 +0,0 @@ -The Backend `AllowlistIdentifier` object represents an identifier that has been added to the allowlist of your application. The Backend `AllowlistIdentifier` object is used in the [Backend API](/docs/reference/backend-api/tag/Allow-list-Block-list#operation/ListAllowlistIdentifiers) and is not directly accessible from the Frontend API. - -## Properties - -| Property | Type | Description | -| -------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `createdAt` | `number` | The date when the allowlist identifier was first created. | -| `id` | `string` | A unique ID for the allowlist identifier. | -| `identifier` | `string` | The [identifier](/docs/authentication/configuration/sign-up-sign-in-options#identifiers) that was added to the allowlist. | -| `identifierType` | "email_address" \| "phone_number" \| "web3_wallet" | The type of the allowlist identifier. | -| `instanceId?` | `string` | The ID of the instance that this allowlist identifier belongs to. | -| `invitationId?` | `string` | The ID of the invitation sent to the identifier. | -| `updatedAt` | `number` | The date when the allowlist identifier was last updated. | diff --git a/.typedoc/docs/backend/auth-object.mdx b/.typedoc/docs/backend/auth-object.mdx deleted file mode 100644 index 06d1716405b..00000000000 --- a/.typedoc/docs/backend/auth-object.mdx +++ /dev/null @@ -1,8 +0,0 @@ -## Properties - -| 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/.typedoc/docs/backend/authenticate-request-options.mdx b/.typedoc/docs/backend/authenticate-request-options.mdx deleted file mode 100644 index b28fe984305..00000000000 --- a/.typedoc/docs/backend/authenticate-request-options.mdx +++ /dev/null @@ -1,24 +0,0 @@ -| 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/.typedoc/docs/backend/client.mdx b/.typedoc/docs/backend/client.mdx deleted file mode 100644 index f9c1d5dc0d9..00000000000 --- a/.typedoc/docs/backend/client.mdx +++ /dev/null @@ -1,14 +0,0 @@ -The Backend `Client` object is similar to the [`Client`](/docs/references/javascript/client) object as it holds information about the authenticated sessions in the current device. However, the Backend `Client` object is different from the `Client` object in that it is used in the [Backend API](/docs/reference/backend-api/tag/Clients#operation/GetClient) and is not directly accessible from the Frontend API. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------------ | ------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- | -| `createdAt` | `number` | The date when the `Client` was first created. | -| `id` | `string` | The unique identifier for the `Client`. | -| `lastActiveSessionId` | null \| string | The ID of the last active [Session](/docs/references/backend/types/backend-session). | -| `sessionIds` | string[] | An array of [Session](/docs/references/backend/types/backend-session){{ target: '_blank' }} IDs associated with the `Client`. | -| `sessions` | [Session](/docs/references/backend/types/backend-session)[] | An array of [Session](/docs/references/backend/types/backend-session){{ target: '_blank' }} objects associated with the `Client`. | -| `signInId` | null \| string | The ID of the [`SignIn`](/docs/references/javascript/sign-in){{ target: '_blank' }}. | -| `signUpId` | null \| string | The ID of the [`SignUp`](/docs/references/javascript/sign-up){{ target: '_blank' }}. | -| `updatedAt` | `number` | The date when the `Client` was last updated. | diff --git a/.typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx b/.typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx deleted file mode 100644 index 5cf86956ee7..00000000000 --- a/.typedoc/docs/backend/commerce-payment-attempt-webhook-event-json.mdx +++ /dev/null @@ -1,8 +0,0 @@ -Webhooks specific interface for CommercePaymentAttempt. - -## Properties - -| Property | Type | Description | Overrides | -| ---------------------------- | ---------------------------- | --------------------------------------- | -------------------------- | -| `id` | `string` | The unique identifier for the resource. | - | -| `object` | `"commerce_payment_attempt"` | The type of the resource. | `ClerkResourceJSON.object` | diff --git a/.typedoc/docs/backend/commerce-plan-json.mdx b/.typedoc/docs/backend/commerce-plan-json.mdx deleted file mode 100644 index da74022198c..00000000000 --- a/.typedoc/docs/backend/commerce-plan-json.mdx +++ /dev/null @@ -1,24 +0,0 @@ -**`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` | `CommerceMoneyAmountJSON` | **`Experimental`** | - | -| `annual_monthly_fee` | `CommerceMoneyAmountJSON` | **`Experimental`** | - | -| `description?` | `string` | **`Experimental`** | - | -| `features` | FeatureJSON[] | **`Experimental`** | - | -| `fee` | `CommerceMoneyAmountJSON` | **`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/.typedoc/docs/backend/commerce-plan.mdx b/.typedoc/docs/backend/commerce-plan.mdx deleted file mode 100644 index f43e80be19f..00000000000 --- a/.typedoc/docs/backend/commerce-plan.mdx +++ /dev/null @@ -1,68 +0,0 @@ -**`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` | `CommerceMoneyAmount` | The monthly fee of the plan. | -| `annualFee` | `CommerceMoneyAmount` | The annual fee of the plan. | -| `annualMonthlyFee` | `CommerceMoneyAmount` | 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` | `CommerceMoneyAmount` | **`Experimental`** The annual fee of the plan. | -| `annualMonthlyFee` | `CommerceMoneyAmount` | **`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` | `CommerceMoneyAmount` | **`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/.typedoc/docs/backend/commerce-subscription-item-json.mdx b/.typedoc/docs/backend/commerce-subscription-item-json.mdx deleted file mode 100644 index adb3ec596ea..00000000000 --- a/.typedoc/docs/backend/commerce-subscription-item-json.mdx +++ /dev/null @@ -1,27 +0,0 @@ -**`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 | -| ------------------------------------------- | -------------------------------------------------------- | ---------------------------------------------------------- | -------------------------- | -| `amount` | null \| CommerceMoneyAmountJSON | **`Experimental`** | - | -| `canceled_at` | null \| number | **`Experimental`** | - | -| `created_at` | `number` | **`Experimental`** | - | -| `ended_at` | null \| number | **`Experimental`** | - | -| `id` | `string` | **`Experimental`** The unique identifier for the resource. | - | -| `is_free_trial?` | `boolean` | **`Experimental`** | - | -| `lifetime_paid` | `CommerceMoneyAmountJSON` | **`Experimental`** | - | -| `next_payment` | null \| \{ amount: number; date: number; \} | **`Experimental`** | - | -| `object` | `"commerce_subscription_item"` | **`Experimental`** The type of the resource. | `ClerkResourceJSON.object` | -| `past_due_at` | null \| number | **`Experimental`** | - | -| `payer_id` | `string` | **`Experimental`** | - | -| `period_end` | null \| number | **`Experimental`** | - | -| `period_start` | `number` | **`Experimental`** | - | -| `plan` | [`CommercePlanJSON`](commerce-plan-json.mdx) | **`Experimental`** | - | -| `plan_id` | `string` | **`Experimental`** | - | -| `plan_period` | "month" \| "annual" | **`Experimental`** | - | -| `status` | `CommerceSubscriptionItemStatus` | **`Experimental`** | - | -| `updated_at` | `number` | **`Experimental`** | - | diff --git a/.typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx b/.typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx deleted file mode 100644 index 103e78c0efe..00000000000 --- a/.typedoc/docs/backend/commerce-subscription-item-webhook-event-json.mdx +++ /dev/null @@ -1,8 +0,0 @@ -Webhooks specific interface for CommerceSubscriptionItem. - -## Properties - -| Property | Type | Description | Overrides | -| ---------------------------- | ------------------------------ | --------------------------------------- | -------------------------- | -| `id` | `string` | The unique identifier for the resource. | - | -| `object` | `"commerce_subscription_item"` | The type of the resource. | `ClerkResourceJSON.object` | diff --git a/.typedoc/docs/backend/commerce-subscription-item.mdx b/.typedoc/docs/backend/commerce-subscription-item.mdx deleted file mode 100644 index 152a89b9219..00000000000 --- a/.typedoc/docs/backend/commerce-subscription-item.mdx +++ /dev/null @@ -1,74 +0,0 @@ -**`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 subscription item. | -| `status` | `CommerceSubscriptionItemStatus` | The status of the subscription item. | -| `planPeriod` | "month" \| "annual" | The plan period for the subscription item. | -| `periodStart` | `number` | The start of the current period. | -| `nextPayment` | null \| \{ amount: number; date: number; \} | The next payment information. | -| `amount` | undefined \| null \| CommerceMoneyAmount | The current amount for the subscription item. | -| `plan` | [`CommercePlan`](commerce-plan.mdx) | The plan associated with this subscription item. | -| `planId` | `string` | The plan ID. | -| `createdAt` | `number` | The date and time the subscription item was created. | -| `updatedAt` | `number` | The date and time the subscription item was last updated. | -| `periodEnd` | null \| number | The end of the current period. | -| `canceledAt` | null \| number | When the subscription item was canceled. | -| `pastDueAt` | null \| number | When the subscription item became past due. | -| `endedAt` | null \| number | When the subscription item ended. | -| `payerId` | `string` | The payer ID. | -| `isFreeTrial?` | `boolean` | Whether this subscription item is currently in a free trial period. | -| `lifetimePaid?` | null \| CommerceMoneyAmount | The lifetime amount paid for this subscription item. | - -#### Returns - -`CommerceSubscriptionItem` - -## Properties - -| Property | Type | Description | -| ----------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `amount` | undefined \| null \| CommerceMoneyAmount | **`Experimental`** The current amount for the subscription item. | -| `canceledAt` | null \| number | **`Experimental`** When the subscription item was canceled. | -| `createdAt` | `number` | **`Experimental`** The date and time the subscription item was created. | -| `endedAt` | null \| number | **`Experimental`** When the subscription item ended. | -| `id` | `string` | **`Experimental`** The unique identifier for the subscription item. | -| `isFreeTrial?` | `boolean` | **`Experimental`** Whether this subscription item is currently in a free trial period. | -| `lifetimePaid?` | null \| CommerceMoneyAmount | **`Experimental`** The lifetime amount paid for this subscription item. | -| `nextPayment` | null \| \{ amount: number; date: number; \} | **`Experimental`** The next payment information. | -| `pastDueAt` | null \| number | **`Experimental`** When the subscription item became past due. | -| `payerId` | `string` | **`Experimental`** The payer ID. | -| `periodEnd` | null \| number | **`Experimental`** The end of the current period. | -| `periodStart` | `number` | **`Experimental`** The start of the current period. | -| `plan` | [`CommercePlan`](commerce-plan.mdx) | **`Experimental`** The plan associated with this subscription item. | -| `planId` | `string` | **`Experimental`** The plan ID. | -| `planPeriod` | "month" \| "annual" | **`Experimental`** The plan period for the subscription item. | -| `status` | `CommerceSubscriptionItemStatus` | **`Experimental`** The status of the subscription item. | -| `updatedAt` | `number` | **`Experimental`** The date and time the subscription item was last updated. | - -## Methods - -### fromJSON() - -**`Experimental`** - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------------------------------------------------- | -| `data` | [`CommerceSubscriptionItemJSON`](commerce-subscription-item-json.mdx) | - -#### Returns - -`CommerceSubscriptionItem` diff --git a/.typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx b/.typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx deleted file mode 100644 index 587f9b985a1..00000000000 --- a/.typedoc/docs/backend/commerce-subscription-webhook-event-json.mdx +++ /dev/null @@ -1,8 +0,0 @@ -Webhooks specific interface for CommerceSubscription. - -## Properties - -| Property | Type | Description | Overrides | -| ---------------------------- | ------------------------- | --------------------------------------- | -------------------------- | -| `id` | `string` | The unique identifier for the resource. | - | -| `object` | `"commerce_subscription"` | The type of the resource. | `ClerkResourceJSON.object` | diff --git a/.typedoc/docs/backend/commerce-subscription.mdx b/.typedoc/docs/backend/commerce-subscription.mdx deleted file mode 100644 index 9343e46b5f0..00000000000 --- a/.typedoc/docs/backend/commerce-subscription.mdx +++ /dev/null @@ -1,60 +0,0 @@ -**`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 commerce subscription. | -| `status` | "abandoned" \| "active" \| "ended" \| "canceled" \| "incomplete" \| "past_due" | The current status of the subscription. | -| `payerId` | `string` | The ID of the payer for this subscription. | -| `createdAt` | `number` | Unix timestamp (milliseconds) of creation. | -| `updatedAt` | `number` | Unix timestamp (milliseconds) of last update. | -| `activeAt` | null \| number | Unix timestamp (milliseconds) when the subscription became active. | -| `pastDueAt` | null \| number | Unix timestamp (milliseconds) when the subscription became past due. | -| `subscriptionItems` | [CommerceSubscriptionItem](commerce-subscription-item.mdx)[] | Array of subscription items in this subscription. | -| `nextPayment` | null \| \{ amount: CommerceMoneyAmount; date: number; \} | Information about the next scheduled payment. | -| `eligibleForFreeTrial` | `boolean` | Whether the payer is eligible for a free trial. | - -#### Returns - -`CommerceSubscription` - -## Properties - -| Property | Type | Description | -| -------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `activeAt` | null \| number | **`Experimental`** Unix timestamp (milliseconds) when the subscription became active. | -| `createdAt` | `number` | **`Experimental`** Unix timestamp (milliseconds) of creation. | -| `eligibleForFreeTrial` | `boolean` | **`Experimental`** Whether the payer is eligible for a free trial. | -| `id` | `string` | **`Experimental`** The unique identifier for the commerce subscription. | -| `nextPayment` | null \| \{ amount: CommerceMoneyAmount; date: number; \} | **`Experimental`** Information about the next scheduled payment. | -| `pastDueAt` | null \| number | **`Experimental`** Unix timestamp (milliseconds) when the subscription became past due. | -| `payerId` | `string` | **`Experimental`** The ID of the payer for this subscription. | -| `status` | "abandoned" \| "active" \| "ended" \| "canceled" \| "incomplete" \| "past_due" | **`Experimental`** The current status of the subscription. | -| `subscriptionItems` | [CommerceSubscriptionItem](commerce-subscription-item.mdx)[] | **`Experimental`** Array of subscription items in this subscription. | -| `updatedAt` | `number` | **`Experimental`** Unix timestamp (milliseconds) of last update. | - -## Methods - -### fromJSON() - -**`Experimental`** - -#### Parameters - -| Parameter | Type | -| --------- | -------------------------- | -| `data` | `CommerceSubscriptionJSON` | - -#### Returns - -`CommerceSubscription` diff --git a/.typedoc/docs/backend/email-address.mdx b/.typedoc/docs/backend/email-address.mdx deleted file mode 100644 index f4ddfe2caf9..00000000000 --- a/.typedoc/docs/backend/email-address.mdx +++ /dev/null @@ -1,14 +0,0 @@ -The Backend `EmailAddress` object is a model around an email address. Email addresses are one of the [identifiers](/docs/authentication/configuration/sign-up-sign-in-options#identifiers) used to provide identification for users. - -Email addresses must be **verified** to ensure that they are assigned to their rightful owners. The `EmailAddress` object holds all necessary state around the verification process. - -For implementation examples for adding and verifying email addresses, see the [email link custom flow](/docs/custom-flows/email-links) and [email code custom flow](/docs/custom-flows/add-email) guides. - -## Properties - -| Property | Type | Description | -| ---------------------------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `emailAddress` | `string` | The value of the email address. | -| `id` | `string` | The unique identifier for the email address. | -| `linkedTo` | [IdentificationLink](/docs/references/backend/types/backend-identification-link)[] | An array of objects containing information about any identifications that might be linked to the email address. | -| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of the email address. | diff --git a/.typedoc/docs/backend/external-account.mdx b/.typedoc/docs/backend/external-account.mdx deleted file mode 100644 index 278b9fdae4d..00000000000 --- a/.typedoc/docs/backend/external-account.mdx +++ /dev/null @@ -1,22 +0,0 @@ -The Backend `ExternalAccount` object is a model around an identification obtained by an external provider (e.g. a social provider such as Google). - -External account must be verified, so that you can make sure they can be assigned to their rightful owners. The `ExternalAccount` object holds all necessary state around the verification process. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------ | ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `approvedScopes` | `string` | The scopes that the user has granted access to. | -| `emailAddress` | `string` | The user's email address. | -| `externalId` | `string` | The unique ID of the user in the provider. | -| `firstName` | `string` | The user's first name. | -| `id` | `string` | The unique identifier for this external account. | -| `identificationId` | `string` | The identification with which this external account is associated. | -| `imageUrl` | `string` | The user's image URL. | -| `label` | null \| string | A descriptive label to differentiate multiple external accounts of the same user for the same provider. | -| `lastName` | `string` | The user's last name. | -| `phoneNumber` | null \| string | The phone number related to this specific external account. | -| `provider` | `string` | The provider name (e.g., `google`). | -| `publicMetadata` | null \| Record\ | Metadata that can be read from the Frontend API and Backend API and can be set only from the Backend API. | -| `username` | null \| string | The user's username. | -| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of this external account. | diff --git a/.typedoc/docs/backend/get-auth-fn.mdx b/.typedoc/docs/backend/get-auth-fn.mdx deleted file mode 100644 index d2d8f208d67..00000000000 --- a/.typedoc/docs/backend/get-auth-fn.mdx +++ /dev/null @@ -1,101 +0,0 @@ -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/.typedoc/docs/backend/identification-link.mdx b/.typedoc/docs/backend/identification-link.mdx deleted file mode 100644 index 5ed1b59fce1..00000000000 --- a/.typedoc/docs/backend/identification-link.mdx +++ /dev/null @@ -1,8 +0,0 @@ -Contains information about any identifications that might be linked to the email address. - -## Properties - -| Property | Type | Description | -| ------------------------ | -------- | ------------------------------------------------------------------------------------ | -| `id` | `string` | The unique identifier for the identification link. | -| `type` | `string` | The type of the identification link, e.g., `"email_address"`, `"phone_number"`, etc. | diff --git a/.typedoc/docs/backend/infer-auth-object-from-token-array.mdx b/.typedoc/docs/backend/infer-auth-object-from-token-array.mdx deleted file mode 100644 index a7421ad97d0..00000000000 --- a/.typedoc/docs/backend/infer-auth-object-from-token-array.mdx +++ /dev/null @@ -1,5 +0,0 @@ -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/.typedoc/docs/backend/infer-auth-object-from-token.mdx b/.typedoc/docs/backend/infer-auth-object-from-token.mdx deleted file mode 100644 index 09a78f383a0..00000000000 --- a/.typedoc/docs/backend/infer-auth-object-from-token.mdx +++ /dev/null @@ -1,2 +0,0 @@ -Infers auth object type from a single token type. -Returns SessionType for session tokens, or MachineType for machine tokens. diff --git a/.typedoc/docs/backend/invitation-status.mdx b/.typedoc/docs/backend/invitation-status.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/backend/invitation.mdx b/.typedoc/docs/backend/invitation.mdx deleted file mode 100644 index f7581ba48cd..00000000000 --- a/.typedoc/docs/backend/invitation.mdx +++ /dev/null @@ -1,14 +0,0 @@ -The Backend `Invitation` object represents an invitation to join your application. - -## Properties - -| Property | Type | Description | -| -------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `createdAt` | `number` | The date when the `Invitation` was first created. | -| `emailAddress` | `string` | The email address that the invitation was sent to. | -| `id` | `string` | The unique identifier for the `Invitation`. | -| `publicMetadata` | null \| Record\ | [Metadata](/docs/references/javascript/types/metadata#user-public-metadata){{ target: '_blank' }} that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. Once the user accepts the invitation and signs up, these metadata will end up in the user's public metadata. | -| `revoked?` | `boolean` | Whether the `Invitation` has been revoked. | -| `status` | "expired" \| "revoked" \| "pending" \| "accepted" | The status of the `Invitation`. | -| `updatedAt` | `number` | The date when the `Invitation` was last updated. | -| `url?` | `string` | The URL that the user can use to accept the invitation. | diff --git a/.typedoc/docs/backend/o-auth-application.mdx b/.typedoc/docs/backend/o-auth-application.mdx deleted file mode 100644 index 030d68ff7b0..00000000000 --- a/.typedoc/docs/backend/o-auth-application.mdx +++ /dev/null @@ -1,26 +0,0 @@ -The Backend `OAuthApplication` object holds information about an OAuth application. - -## Properties - -| Property | Type | Description | -| ---------------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `authorizeUrl` | `string` | The URL used to authorize the user and obtain an authorization code. | -| `clientId` | `string` | The ID of the client associated with the OAuth application. | -| `clientImageUrl` | null \| string | The URL of the image or logo representing the OAuth application. | -| `clientSecret?` | `string` | The client secret associated with the OAuth application. Empty if public client. | -| `clientUri` | null \| string | The public-facing URL of the OAuth application, often shown on consent screens. | -| `consentScreenEnabled` | `boolean` | Specifies whether the consent screen should be displayed in the authentication flow. Cannot be disabled for dynamically registered OAuth applications. | -| `createdAt` | `number` | The date when the OAuth application was first created. | -| `discoveryUrl` | `string` | The OpenID Connect discovery endpoint URL for this OAuth application. | -| `dynamicallyRegistered` | `boolean` | Specifies whether the OAuth application is dynamically registered. | -| `id` | `string` | The unique identifier for the OAuth application. | -| `instanceId` | `string` | The ID of the instance that this OAuth application belongs to. | -| `isPublic` | `boolean` | Indicates whether the client is public. If true, the Proof Key of Code Exchange (PKCE) flow can be used. | -| `name` | `string` | The name of the new OAuth application. | -| `pkceRequired` | `boolean` | Specifies whether the Proof Key of Code Exchange (PKCE) flow should be required in the authentication flow. | -| `redirectUris` | string[] | An array of redirect URIs of the new OAuth application. | -| `scopes` | `string` | Scopes for the new OAuth application. | -| `tokenFetchUrl` | `string` | The URL used by the client to exchange an authorization code for an access token. | -| `tokenIntrospectionUrl` | `string` | The URL used to introspect and validate issued access tokens. | -| `updatedAt` | `number` | The date when the OAuth application was last updated. | -| `userInfoUrl` | `string` | The URL where the client can retrieve user information using an access token. | diff --git a/.typedoc/docs/backend/organization-invitation-status.mdx b/.typedoc/docs/backend/organization-invitation-status.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/backend/organization-invitation.mdx b/.typedoc/docs/backend/organization-invitation.mdx deleted file mode 100644 index 41b8a55b0a7..00000000000 --- a/.typedoc/docs/backend/organization-invitation.mdx +++ /dev/null @@ -1,19 +0,0 @@ -The Backend `OrganizationInvitation` object is similar to the [`OrganizationInvitation`](/docs/references/javascript/types/organization-invitation) object as it's the model around an organization invitation. However, the Backend `OrganizationInvitation` object is different in that it's used in the [Backend API](/docs/reference/backend-api/tag/Organization-Invitations#operation/CreateOrganizationInvitation){{ target: '_blank' }} and is not directly accessible from the Frontend API. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `createdAt` | `number` | The date when the invitation was first created. | -| `emailAddress` | `string` | The email address of the user who is invited to the [`Organization`](/docs/references/backend/types/backend-organization). | -| `expiresAt` | `number` | The date when the invitation expires. | -| `id` | `string` | The unique identifier for the `OrganizationInvitation`. | -| `organizationId` | `string` | The ID of the [`Organization`](/docs/references/backend/types/backend-organization) that the user is invited to. | -| `privateMetadata` | [`OrganizationInvitationPrivateMetadata`](/docs/references/javascript/types/metadata#organization-invitation-private-metadata) | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | -| `publicMetadata` | [`OrganizationInvitationPublicMetadata`](/docs/references/javascript/types/metadata#organization-invitation-public-metadata) | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | -| `publicOrganizationData?` | null \| [PublicOrganizationDataJSON](#public-organization-data-json) | Public data about the organization that the user is invited to. | -| `role` | `string` | The role of the invited user. | -| `roleName` | `string` | The name of the role of the invited user. | -| `status?` | "expired" \| "revoked" \| "pending" \| "accepted" | The status of the invitation. | -| `updatedAt` | `number` | The date when the invitation was last updated. | -| `url` | null \| string | The URL that the user can use to accept the invitation. | diff --git a/.typedoc/docs/backend/organization-membership-public-user-data.mdx b/.typedoc/docs/backend/organization-membership-public-user-data.mdx deleted file mode 100644 index 0c5cc72dbcd..00000000000 --- a/.typedoc/docs/backend/organization-membership-public-user-data.mdx +++ /dev/null @@ -1,8 +0,0 @@ -| Property | Type | Description | -| ------------------------------------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `firstName` | null \| string | The first name of the user. | -| `hasImage` | `boolean` | Whether the user has a profile picture. | -| `identifier` | `string` | The [identifier](/docs/authentication/configuration/sign-up-sign-in-options#identifiers) of the user. | -| `imageUrl` | `string` | Holds the default avatar or user's uploaded profile image. Compatible with Clerk's [Image Optimization](/docs/guides/image-optimization). | -| `lastName` | null \| string | The last name of the user. | -| `userId` | `string` | The ID of the user that this public data belongs to. | diff --git a/.typedoc/docs/backend/organization-membership.mdx b/.typedoc/docs/backend/organization-membership.mdx deleted file mode 100644 index 585912c6ef4..00000000000 --- a/.typedoc/docs/backend/organization-membership.mdx +++ /dev/null @@ -1,15 +0,0 @@ -The Backend `OrganizationMembership` object is similar to the [`OrganizationMembership`](/docs/references/javascript/types/organization-membership) object as it's the model around an organization membership entity and describes the relationship between users and organizations. However, the Backend `OrganizationMembership` object is different in that it's used in the [Backend API](/docs/reference/backend-api/tag/Organization-Memberships#operation/CreateOrganizationMembership){{ target: '_blank' }} and is not directly accessible from the Frontend API. - -## Properties - -| Property | Type | Description | -| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `createdAt` | `number` | The date when the membership was first created. | -| `id` | `string` | The unique identifier for the membership. | -| `organization` | [`Organization`](/docs/references/backend/types/backend-organization) | The organization that the user is a member of. | -| `permissions` | string[] | The permissions granted to the user in the organization. | -| `privateMetadata` | [`OrganizationMembershipPrivateMetadata`](/docs/references/javascript/types/metadata#organization-membership-private-metadata) | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | -| `publicMetadata` | [`OrganizationMembershipPublicMetadata`](/docs/references/javascript/types/metadata#organization-membership-public-metadata) | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | -| `publicUserData?` | null \| [OrganizationMembershipPublicUserData](#organization-membership-public-user-data) | Public information about the user that this membership belongs to. | -| `role` | `string` | The role of the user. | -| `updatedAt` | `number` | The date when the membership was last updated. | diff --git a/.typedoc/docs/backend/organization-sync-options.mdx b/.typedoc/docs/backend/organization-sync-options.mdx deleted file mode 100644 index 5a3609e438f..00000000000 --- a/.typedoc/docs/backend/organization-sync-options.mdx +++ /dev/null @@ -1,8 +0,0 @@ -> **OrganizationSyncOptions** = \{ organizationPatterns?: Pattern[]; personalAccountPatterns?: Pattern[]; \} - -## Properties - -| Property | Type | Description | -| --------------------------------------------------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `organizationPatterns?` | Pattern[] | 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/(.*)"]`. | -| `personalAccountPatterns?` | Pattern[] | 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/.typedoc/docs/backend/organization-sync-target.mdx b/.typedoc/docs/backend/organization-sync-target.mdx deleted file mode 100644 index 42fb0f448bb..00000000000 --- a/.typedoc/docs/backend/organization-sync-target.mdx +++ /dev/null @@ -1,2 +0,0 @@ -Represents an organization or a personal account - e.g. an -entity that can be activated by the handshake API. diff --git a/.typedoc/docs/backend/organization.mdx b/.typedoc/docs/backend/organization.mdx deleted file mode 100644 index 4da8acac205..00000000000 --- a/.typedoc/docs/backend/organization.mdx +++ /dev/null @@ -1,19 +0,0 @@ -The Backend `Organization` object is similar to the [`Organization`](/docs/references/javascript/organization) object as it holds information about an organization, as well as methods for managing it. However, the Backend `Organization` object is different in that it is used in the [Backend API](/docs/reference/backend-api/tag/Organizations#operation/ListOrganizations){{ target: '_blank' }} and is not directly accessible from the Frontend API. - -## Properties - -| Property | Type | Description | -| ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `adminDeleteEnabled` | `boolean` | Whether the organization allows admins to delete users. | -| `createdAt` | `number` | The date when the organization was first created. | -| `createdBy?` | `string` | The ID of the user who created the organization. | -| `hasImage` | `boolean` | Whether the organization has an image. | -| `id` | `string` | The unique identifier for the organization. | -| `imageUrl` | `string` | Holds the organization's logo. Compatible with Clerk's [Image Optimization](/docs/guides/image-optimization). | -| `maxAllowedMemberships` | `number` | The maximum number of memberships allowed in the organization. | -| `membersCount?` | `number` | The number of members in the organization. | -| `name` | `string` | The name of the organization. | -| `privateMetadata` | [`OrganizationPrivateMetadata`](/docs/references/javascript/types/metadata#organization-private-metadata) | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | -| `publicMetadata` | null \| [OrganizationPublicMetadata](/docs/references/javascript/types/metadata#organization-public-metadata) | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | -| `slug` | `string` | The URL-friendly identifier of the user's active organization. If supplied, it must be unique for the instance. | -| `updatedAt` | `number` | The date when the organization was last updated. | diff --git a/.typedoc/docs/backend/paginated-resource-response.mdx b/.typedoc/docs/backend/paginated-resource-response.mdx deleted file mode 100644 index 1603ff21b4e..00000000000 --- a/.typedoc/docs/backend/paginated-resource-response.mdx +++ /dev/null @@ -1,14 +0,0 @@ -An interface that describes the response of a method that returns a paginated list of resources. - -If the promise resolves, you will get back the [properties](#properties) listed below. `data` will be an array of the resource type you requested. You can use the `totalCount` property to determine how many total items exist remotely. - -Some methods that return this type allow pagination with the `limit` and `offset` parameters, in which case the first 10 items will be returned by default. For methods such as [`getAllowlistIdentifierList()`](/docs/references/backend/allowlist/get-allowlist-identifier-list), which do not take a `limit` or `offset`, all items will be returned. - -If the promise is rejected, you will receive a `ClerkAPIResponseError` or network error. - -## Properties - -| Property | Type | Description | -| ------------------------------------ | -------- | -------------------------------------------- | -| `data` | `T` | An array that contains the fetched data. | -| `totalCount` | `number` | The total count of data that exist remotely. | diff --git a/.typedoc/docs/backend/phone-number.mdx b/.typedoc/docs/backend/phone-number.mdx deleted file mode 100644 index 01d074308db..00000000000 --- a/.typedoc/docs/backend/phone-number.mdx +++ /dev/null @@ -1,16 +0,0 @@ -The Backend `PhoneNumber` object describes a phone number. Phone numbers can be used as a proof of identification for users, or simply as a means of contacting users. - -Phone numbers must be **verified** to ensure that they can be assigned to their rightful owners. The `PhoneNumber` object holds all the necessary state around the verification process. - -Finally, phone numbers can be used as part of [multi-factor authentication](/docs/authentication/configuration/sign-up-sign-in-options#multi-factor-authentication). During sign in, users can opt in to an extra verification step where they will receive an SMS message with a one-time code. This code must be entered to complete the sign in process. - -## Properties - -| Property | Type | Description | -| -------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `defaultSecondFactor` | `boolean` | Set to `true` if this phone number is the default second factor. Set to `false` otherwise. A user must have exactly one default second factor, if multi-factor authentication (2FA) is enabled. | -| `id` | `string` | The unique identifier for this phone number. | -| `linkedTo` | [IdentificationLink](/docs/references/backend/types/backend-identification-link)[] | An object containing information about any other identification that might be linked to this phone number. | -| `phoneNumber` | `string` | The value of this phone number, in [E.164 format](https://en.wikipedia.org/wiki/E.164). | -| `reservedForSecondFactor` | `boolean` | Set to `true` if this phone number is reserved for multi-factor authentication (2FA). Set to `false` otherwise. | -| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of this phone number. | diff --git a/.typedoc/docs/backend/public-organization-data-json.mdx b/.typedoc/docs/backend/public-organization-data-json.mdx deleted file mode 100644 index 4a509f0f1b1..00000000000 --- a/.typedoc/docs/backend/public-organization-data-json.mdx +++ /dev/null @@ -1,8 +0,0 @@ -| Property | Type | Description | -| ----------------------------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------- | -| `has_image` | `boolean` | Whether the organization has a profile image. | -| `id` | `string` | The unique identifier for the resource. | -| `image_url?` | `string` | Holds the default organization profile image. Compatible with Clerk's [Image Optimization](/docs/guides/image-optimization). | -| `name` | `string` | The name of the organization. | -| `object` | `ObjectType` | The type of the resource. | -| `slug` | `string` | The slug of the organization. | diff --git a/.typedoc/docs/backend/redirect-url.mdx b/.typedoc/docs/backend/redirect-url.mdx deleted file mode 100644 index 1b128348cea..00000000000 --- a/.typedoc/docs/backend/redirect-url.mdx +++ /dev/null @@ -1,12 +0,0 @@ -Redirect URLs are whitelisted URLs that facilitate secure authentication flows in native applications (e.g. React Native, Expo). In these contexts, Clerk ensures that security-critical nonces are passed only to the whitelisted URLs. - -The Backend `RedirectUrl` object represents a redirect URL in your application. This object is used in the Backend API. - -## Properties - -| Property | Type | Description | -| ---------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `createdAt` | `number` | The date when the redirect URL was first created. | -| `id` | `string` | The unique identifier for the redirect URL. | -| `updatedAt` | `number` | The date when the redirect URL was last updated. | -| `url` | `string` | The full URL value prefixed with `https://` or a custom scheme. Examples: `https://my-app.com/oauth-callback`, `my-app://oauth-callback`. | diff --git a/.typedoc/docs/backend/saml-account.mdx b/.typedoc/docs/backend/saml-account.mdx deleted file mode 100644 index 9099ed83ecc..00000000000 --- a/.typedoc/docs/backend/saml-account.mdx +++ /dev/null @@ -1,15 +0,0 @@ -The Backend `SamlAccount` object describes a SAML account. - -## Properties - -| Property | Type | Description | -| -------------------------------------------- | ---------------------------------------------------------------------------------------- | ------------------------------------------------------------ | -| `active` | `boolean` | A boolean that indicates whether the SAML account is active. | -| `emailAddress` | `string` | The email address of the SAML account. | -| `firstName` | `string` | The first name of the SAML account. | -| `id` | `string` | The unique identifier for the SAML account. | -| `lastName` | `string` | The last name of the SAML account. | -| `provider` | `string` | The provider of the SAML account. | -| `providerUserId` | null \| string | The user's ID as used in the provider. | -| `samlConnection` | null \| SamlAccountConnection | The SAML connection of the SAML account. | -| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | The verification of the SAML account. | diff --git a/.typedoc/docs/backend/saml-connection.mdx b/.typedoc/docs/backend/saml-connection.mdx deleted file mode 100644 index d55d90126bd..00000000000 --- a/.typedoc/docs/backend/saml-connection.mdx +++ /dev/null @@ -1,27 +0,0 @@ -The Backend `SamlConnection` object holds information about a SAML connection for an organization. - -## Properties - -| Property | Type | Description | -| ---------------------------------------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `acsUrl` | `string` | The Assertion Consumer Service (ACS) URL of the connection. | -| `active` | `boolean` | Indicates whether the connection is active or not. | -| `allowIdpInitiated` | `boolean` | Indicates whether the connection allows Identity Provider (IdP) initiated flows or not. | -| `allowSubdomains` | `boolean` | Indicates whether users with an email address subdomain are allowed to use this connection in order to authenticate or not. | -| `attributeMapping` | `AttributeMapping` | Defines the attribute name mapping between the Identity Provider (IdP) and Clerk's [`User`](/docs/references/javascript/user) properties. | -| `createdAt` | `number` | The date when the connection was first created. | -| `domain` | `string` | The domain of your organization. Sign in flows using an email with this domain will use the connection. | -| `id` | `string` | The unique identifier for the connection. | -| `idpCertificate` | null \| string | The X.509 certificate as provided by the Identity Provider (IdP). | -| `idpEntityId` | null \| string | The Entity ID as provided by the Identity Provider (IdP). | -| `idpMetadata` | null \| string | The XML content of the Identity Provider (IdP) metadata file. If present, it takes priority over the corresponding individual properties. | -| `idpMetadataUrl` | null \| string | The URL which serves the Identity Provider (IdP) metadata. If present, it takes priority over the corresponding individual properties. | -| `idpSsoUrl` | null \| string | The Single-Sign On URL as provided by the Identity Provider (IdP). | -| `name` | `string` | The name to use as a label for the connection. | -| `organizationId` | null \| string | The organization ID of the organization. | -| `provider` | `string` | The Identity Provider (IdP) of the connection. | -| `spEntityId` | `string` | The Entity ID as provided by the Service Provider (Clerk). | -| `spMetadataUrl` | `string` | The metadata URL as provided by the Service Provider (Clerk). | -| `syncUserAttributes` | `boolean` | Indicates whether the connection syncs user attributes between the Service Provider (SP) and Identity Provider (IdP) or not. | -| `updatedAt` | `number` | The date when the SAML connection was last updated. | -| `userCount` | `number` | The number of users associated with the connection. | diff --git a/.typedoc/docs/backend/session-activity.mdx b/.typedoc/docs/backend/session-activity.mdx deleted file mode 100644 index b6a304b26e0..00000000000 --- a/.typedoc/docs/backend/session-activity.mdx +++ /dev/null @@ -1,14 +0,0 @@ -The Backend `SessionActivity` object models the activity of a user session, capturing details such as the device type, browser information, and geographical location. - -## Properties - -| Property | Type | Description | -| --------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------- | -| `browserName?` | `string` | The name of the browser from which this session activity occurred. | -| `browserVersion?` | `string` | The version of the browser from which this session activity occurred. | -| `city?` | `string` | The city from which this session activity occurred. Resolved by IP address geo-location. | -| `country?` | `string` | The country from which this session activity occurred. Resolved by IP address geo-location. | -| `deviceType?` | `string` | The type of the device which was used in this session activity. | -| `id` | `string` | The unique identifier for the session activity record. | -| `ipAddress?` | `string` | The IP address from which this session activity originated. | -| `isMobile` | `boolean` | Will be set to `true` if the session activity came from a mobile device. Set to `false` otherwise. | diff --git a/.typedoc/docs/backend/session.mdx b/.typedoc/docs/backend/session.mdx deleted file mode 100644 index 6cf5fa2e50b..00000000000 --- a/.typedoc/docs/backend/session.mdx +++ /dev/null @@ -1,18 +0,0 @@ -The Backend `Session` object is similar to the [`Session`](/docs/references/javascript/session) object as it is an abstraction over an HTTP session and models the period of information exchange between a user and the server. However, the Backend `Session` object is different as it is used in the [Backend API](/docs/reference/backend-api/tag/Sessions#operation/GetSessionList) and is not directly accessible from the Frontend API. - -## Properties - -| Property | Type | Description | -| ----------------------------------------------------------------- | ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `abandonAt` | `number` | The date when the `Session` will be abandoned. | -| `actor` | null \| Record\ | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | -| `clientId` | `string` | The ID of the client associated with the `Session`. | -| `createdAt` | `number` | The date when the `Session` was first created. | -| `expireAt` | `number` | The date when the `Session` will expire. | -| `id` | `string` | The unique identifier for the `Session`. | -| `lastActiveAt` | `number` | The time the session was last active on the [`Client`](/docs/references/backend/types/backend-client). | -| `lastActiveOrganizationId?` | `string` | The ID of the last active organization. | -| `latestActivity?` | [`SessionActivity`](/docs/references/backend/types/backend-session-activity) | An object that provides additional information about this session, focused around user activity data. | -| `status` | `string` | The current state of the `Session`. | -| `updatedAt` | `number` | The date when the `Session` was last updated. | -| `userId` | `string` | The ID of the user associated with the `Session`. | diff --git a/.typedoc/docs/backend/user.mdx b/.typedoc/docs/backend/user.mdx deleted file mode 100644 index 9847d75c136..00000000000 --- a/.typedoc/docs/backend/user.mdx +++ /dev/null @@ -1,47 +0,0 @@ -The Backend `User` object is similar to the `User` object as it holds information about a user of your application, such as their unique identifier, name, email addresses, phone numbers, and more. However, the Backend `User` object is different from the `User` object in that it is used in the [Backend API](/docs/reference/backend-api/tag/Users#operation/GetUser){{ target: '_blank' }} and is not directly accessible from the Frontend API. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `backupCodeEnabled` | `boolean` | A boolean indicating whether the user has enabled Backup codes. | -| `banned` | `boolean` | A boolean indicating whether the user is banned or not. | -| `createdAt` | `number` | The date when the user was first created. | -| `createOrganizationEnabled` | `boolean` | A boolean indicating whether the organization creation is enabled for the user or not. | -| `createOrganizationsLimit` | null \| number | An integer indicating the number of organizations that can be created by the user. If the value is `0`, then the user can create unlimited organizations. Default is `null`. | -| `deleteSelfEnabled` | `boolean` | A boolean indicating whether the user can delete their own account. | -| `emailAddresses` | [EmailAddress](/docs/references/backend/types/backend-email-address)[] | An array of all the `EmailAddress` objects associated with the user. Includes the primary. | -| `externalAccounts` | [ExternalAccount](/docs/references/backend/types/backend-external-account)[] | An array of all the `ExternalAccount` objects associated with the user via OAuth. **Note**: This includes both verified & unverified external accounts. | -| `externalId` | null \| string | The ID of the user as used in your external systems. Must be unique across your instance. | -| `firstName` | null \| string | The user's first name. | -| `hasImage` | `boolean` | A getter boolean to check if the user has uploaded an image or one was copied from OAuth. Returns `false` if Clerk is displaying an avatar for the user. | -| `id` | `string` | The unique identifier for the user. | -| `imageUrl` | `string` | The URL of the user's profile image. | -| `lastActiveAt` | null \| number | Date when the user was last active. | -| `lastName` | null \| string | The user's last name. | -| `lastSignInAt` | null \| number | The date when the user last signed in. May be empty if the user has never signed in. | -| `legalAcceptedAt` | null \| number | The unix timestamp of when the user accepted the legal requirements. `null` if [**Require express consent to legal documents**](/docs/authentication/configuration/legal-compliance) is not enabled. | -| `locked` | `boolean` | A boolean indicating whether the user is banned or not. | -| `passwordEnabled` | `boolean` | A boolean indicating whether the user has a password on their account. | -| `phoneNumbers` | [PhoneNumber](/docs/references/backend/types/backend-phone-number)[] | An array of all the `PhoneNumber` objects associated with the user. Includes the primary. | -| `primaryEmailAddressId` | null \| string | The ID for the `EmailAddress` that the user has set as primary. | -| `primaryPhoneNumberId` | null \| string | The ID for the `PhoneNumber` that the user has set as primary. | -| `primaryWeb3WalletId` | null \| string | The ID for the [`Web3Wallet`](/docs/references/backend/types/backend-web3-wallet) that the user signed up with. | -| `privateMetadata` | `UserPrivateMetadata` | Metadata that can be read and set only from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}. | -| `publicMetadata` | `UserPublicMetadata` | Metadata that can be read from the Frontend API and [Backend API](/docs/reference/backend-api){{ target: '_blank' }} and can be set only from the Backend API. | -| `samlAccounts` | [SamlAccount](/docs/references/backend/types/backend-saml-account)[] | An array of all the `SamlAccount` objects associated with the user via SAML. | -| `totpEnabled` | `boolean` | A boolean indicating whether the user has enabled TOTP by generating a TOTP secret and verifying it via an authenticator app. | -| `twoFactorEnabled` | `boolean` | A boolean indicating whether the user has enabled two-factor authentication. | -| `unsafeMetadata` | `UserUnsafeMetadata` | Metadata that can be read and set from the Frontend API. It's considered unsafe because it can be modified from the frontend. | -| `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 - -| Property | Type | Description | -| ------------------------------------------------------ | ----------------------------------------------------------------------------------------- | -------------------------------------- | -| `fullName` | null \| string | The full name of the user. | -| `primaryEmailAddress` | null \| [EmailAddress](/docs/references/backend/types/backend-email-address) | The primary email address of the user. | -| `primaryPhoneNumber` | null \| [PhoneNumber](/docs/references/backend/types/backend-phone-number) | The primary phone number of the user. | -| `primaryWeb3Wallet` | null \| [Web3Wallet](/docs/references/backend/types/backend-web3-wallet) | The primary web3 wallet of the user. | diff --git a/.typedoc/docs/backend/verification.mdx b/.typedoc/docs/backend/verification.mdx deleted file mode 100644 index 0abc5338e0e..00000000000 --- a/.typedoc/docs/backend/verification.mdx +++ /dev/null @@ -1,13 +0,0 @@ -The Backend `Verification` object describes the state of the verification process of a sign-in or sign-up attempt. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------------------------------------ | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `attempts` | null \| number | The number of attempts related to the verification. | -| `expireAt` | null \| number | The time the verification will expire at. | -| `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` | `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/.typedoc/docs/backend/verify-machine-auth-token.mdx b/.typedoc/docs/backend/verify-machine-auth-token.mdx deleted file mode 100644 index 3c6cc9d35c7..00000000000 --- a/.typedoc/docs/backend/verify-machine-auth-token.mdx +++ /dev/null @@ -1,12 +0,0 @@ -Verifies any type of machine token by detecting its type from the prefix. - -## Parameters - -| Parameter | Type | Description | -| --------- | --------------------------------------------- | ------------------------------------------------------------------------- | -| `token` | `string` | The token to verify (e.g. starts with "m2m*", "oauth*", "api*key*", etc.) | -| `options` | [`VerifyTokenOptions`](#verify-token-options) | Options including secretKey for BAPI authorization | - -## Returns - -`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"; \} \| \{ data: APIKey; errors?: undefined; tokenType: "api_key" \| "m2m_token" \| "oauth_token"; \}\> diff --git a/.typedoc/docs/backend/verify-token-options.mdx b/.typedoc/docs/backend/verify-token-options.mdx deleted file mode 100644 index e35c5fa20b3..00000000000 --- a/.typedoc/docs/backend/verify-token-options.mdx +++ /dev/null @@ -1,11 +0,0 @@ -| Property | Type | Description | -| ----------------------------------------------------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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`. | -| ~~`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). | -| `secretKey?` | `string` | The Clerk Secret Key from the [**API keys**](https://dashboard.clerk.com/last-active?path=api-keys) page in the Clerk Dashboard. | -| `skipJwksCache?` | `boolean` | A flag to ignore the JWKS cache and always fetch JWKS before each JWT verification. | diff --git a/.typedoc/docs/backend/verify-token.mdx b/.typedoc/docs/backend/verify-token.mdx deleted file mode 100644 index 151d30ea2e6..00000000000 --- a/.typedoc/docs/backend/verify-token.mdx +++ /dev/null @@ -1,91 +0,0 @@ -> [!WARNING] -> This is a lower-level method intended for more advanced use-cases. It's recommended to use [`authenticateRequest()`](/docs/references/backend/authenticate-request), which fully authenticates a token passed from the `request` object. - -```ts -function verifyToken( - token, - options, -): Promise>; -``` - -Verifies a Clerk-generated token signature. Networkless if the `jwtKey` is provided. Otherwise, performs a network call to retrieve the JWKS from the [Backend API](/docs/reference/backend-api/tag/JWKS#operation/GetJWKS){{ target: '_blank' }}. - -## Parameters - -| Parameter | Type | Description | -| --------- | --------------------------------------------- | -------------------------------- | -| `token` | `string` | The token to verify. | -| `options` | [`VerifyTokenOptions`](#verify-token-options) | Options for verifying the token. | - -### `VerifyTokenOptions` - -It is recommended to set these options as [environment variables](/docs/deployments/clerk-environment-variables#api-and-sdk-configuration) where possible, and then pass them to the function. For example, you can set the `secretKey` option using the `CLERK_SECRET_KEY` environment variable, and then pass it to the function like this: `createClerkClient({ secretKey: process.env.CLERK_SECRET_KEY })`. - -> [!WARNING] -> You must provide either `jwtKey` or `secretKey`. - - - -## Returns - -`Promise`\<`JwtReturnType`\<`JwtPayload`, `TokenVerificationError`\>\> - -## Example - -The following example demonstrates how to use the [JavaScript Backend SDK](/docs/references/backend/overview) to verify the token signature. - -In the following example: - -1. The **JWKS Public Key** from the Clerk Dashboard is set in the environment variable `CLERK_JWT_KEY`. -1. The session token is retrieved from the `__session` cookie or the Authorization header. -1. The token is verified in a networkless manner by passing the `jwtKey` prop. -1. The `authorizedParties` prop is passed to verify that the session token is generated from the expected frontend application. -1. If the token is valid, the response contains the verified token. - -```ts -import { verifyToken } from "@clerk/backend"; -import { cookies } from "next/headers"; - -export async function GET(request: Request) { - const cookieStore = cookies(); - const sessToken = cookieStore.get("__session")?.value; - const bearerToken = request.headers - .get("Authorization") - ?.replace("Bearer ", ""); - const token = sessToken || bearerToken; - - if (!token) { - return Response.json( - { error: "Token not found. User must sign in." }, - { status: 401 }, - ); - } - - try { - const verifiedToken = await verifyToken(token, { - jwtKey: process.env.CLERK_JWT_KEY, - authorizedParties: ["http://localhost:3001", "api.example.com"], // Replace with your authorized parties - }); - - return Response.json({ verifiedToken }); - } catch (error) { - return Response.json({ error: "Token not verified." }, { status: 401 }); - } -} -``` - -If the token is valid, the response will contain a JSON object that looks something like this: - -```json -{ - "verifiedToken": { - "azp": "http://localhost:3000", - "exp": 1687906422, - "iat": 1687906362, - "iss": "https://magical-marmoset-51.clerk.accounts.dev", - "nbf": 1687906352, - "sid": "sess_2Ro7e2IxrffdqBboq8KfB6eGbIy", - "sub": "user_2RfWKJREkjKbHZy0Wqa5qrHeAnb" - } -} -``` diff --git a/.typedoc/docs/backend/verify-webhook-options.mdx b/.typedoc/docs/backend/verify-webhook-options.mdx deleted file mode 100644 index c0bc04c4ae2..00000000000 --- a/.typedoc/docs/backend/verify-webhook-options.mdx +++ /dev/null @@ -1,7 +0,0 @@ -> **VerifyWebhookOptions** = \{ signingSecret?: string; \} - -## Properties - -| Property | Type | Description | -| ------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `signingSecret?` | `string` | The signing secret for the webhook. It's recommended to use the [`CLERK_WEBHOOK_SIGNING_SECRET` environment variable](/docs/deployments/clerk-environment-variables#webhooks) instead. | diff --git a/.typedoc/docs/backend/verify-webhook.mdx b/.typedoc/docs/backend/verify-webhook.mdx deleted file mode 100644 index dc336b51356..00000000000 --- a/.typedoc/docs/backend/verify-webhook.mdx +++ /dev/null @@ -1,42 +0,0 @@ -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; -``` - -## Parameters - -| Parameter | Type | Description | -| ------------------------ | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `request` | `Request` | The request object. | -| `options` | \{ signingSecret?: string; \} | Optional configuration object. | -| `options.signingSecret?` | `string` | The signing secret for the webhook. It's recommended to use the [`CLERK_WEBHOOK_SIGNING_SECRET` environment variable](/docs/deployments/clerk-environment-variables#webhooks) instead. | - -## Returns - -`Promise`\<`WebhookEvent`\> - -## Example - -See the [guide on syncing data](/docs/webhooks/sync-data) for more comprehensive and framework-specific examples that you can copy and paste into your app. - -```ts -try { - const evt = await verifyWebhook(request); - - // Access the event data - const { id } = evt.data; - const eventType = evt.type; - - // Handle specific event types - if (evt.type === "user.created") { - console.log("New user created:", evt.data.id); - // Handle user creation - } - - return new Response("Success", { status: 200 }); -} catch (err) { - console.error("Webhook verification failed:", err); - return new Response("Webhook verification failed", { status: 400 }); -} -``` diff --git a/.typedoc/docs/backend/web3-wallet.mdx b/.typedoc/docs/backend/web3-wallet.mdx deleted file mode 100644 index d0eeb11bfbf..00000000000 --- a/.typedoc/docs/backend/web3-wallet.mdx +++ /dev/null @@ -1,11 +0,0 @@ -The Backend `Web3Wallet` object describes a Web3 wallet address. The address can be used as a proof of identification for users. - -Web3 addresses must be verified to ensure that they can be assigned to their rightful owners. The verification is completed via Web3 wallet browser extensions, such as [Metamask](https://metamask.io/), [Coinbase Wallet](https://www.coinbase.com/wallet), and [OKX Wallet](https://www.okx.com/help/section/faq-web3-wallet). The `Web3Wallet3` object holds all the necessary state around the verification process. - -## Properties - -| Property | Type | Description | -| ---------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `id` | `string` | The unique ID for the Web3 wallet. | -| `verification` | null \| [Verification](/docs/references/backend/types/backend-verification) | An object holding information on the verification of this Web3 wallet. | -| `web3Wallet` | `string` | The Web3 wallet address, made up of 0x + 40 hexadecimal characters. | diff --git a/.typedoc/docs/clerk-react/api-keys.mdx b/.typedoc/docs/clerk-react/api-keys.mdx deleted file mode 100644 index 4147bc55f14..00000000000 --- a/.typedoc/docs/clerk-react/api-keys.mdx +++ /dev/null @@ -1,19 +0,0 @@ -**`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/.typedoc/docs/clerk-react/clerk-provider-props.mdx b/.typedoc/docs/clerk-react/clerk-provider-props.mdx deleted file mode 100644 index e157d089a4f..00000000000 --- a/.typedoc/docs/clerk-react/clerk-provider-props.mdx +++ /dev/null @@ -1,43 +0,0 @@ -## Properties - -| Property | Type | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `afterMultiSessionSingleSignOutUrl?` | null \| string | The full URL or path to navigate to after signing out the current user is complete. This option applies to [multi-session applications](/docs/authentication/configuration/session-options#multi-session-applications). | -| ~~`afterSignInUrl?`~~ | null \| string | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | -| `afterSignOutUrl?` | null \| string | Full URL or path to navigate to after successful sign out. | -| ~~`afterSignUpUrl?`~~ | null \| string | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | -| `allowedRedirectOrigins?` | (string \| RegExp)[] | An optional array of domains to validate user-provided redirect URLs against. If no match is made, the redirect is considered unsafe and the default redirect will be used with a warning logged in the console. | -| `allowedRedirectProtocols?` | string[] | An optional array of protocols to validate user-provided redirect URLs against. If no match is made, the redirect is considered unsafe and the default redirect will be used with a warning logged in the console. | -| `appearance?` | `Appearance` | Optional object to style your components. Will only affect [Clerk Components](/docs/components/overview) and not [Account Portal](/docs/account-portal/overview) pages. | -| `clerkJSUrl?` | `string` | The URL that `@clerk/clerk-js` should be hot-loaded from. | -| `clerkJSVariant?` | "" \| "headless" | If your web application only uses [Control Components](/docs/components/overview#control-components), you can set this value to `'headless'` and load a minimal ClerkJS bundle for optimal page performance. | -| `clerkJSVersion?` | `string` | The npm version for `@clerk/clerk-js`. | -| `domain?` | string \| (url) => string | **Required if your application is a satellite application**. Sets the domain of the satellite application. | -| `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?` | [`LocalizationResource`](/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. | -| `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`). | -| `publishableKey` | `string` | The Clerk Publishable Key for your instance. This can be found on the [API keys](https://dashboard.clerk.com/last-active?path=api-keys) page in the Clerk Dashboard. | -| ~~`redirectUrl?`~~ | null \| string | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | -| `routerPush?` | (to, metadata?) => unknown | A function which takes the destination path as an argument and performs a "push" navigation. | -| `routerReplace?` | (to, metadata?) => unknown | A function which takes the destination path as an argument and performs a "replace" navigation. | -| `sdkMetadata?` | \{ environment?: string; name: string; version: string; \} | Contains information about the SDK that the host application is using. You don't need to set this value yourself unless you're [developing an SDK](/docs/references/sdk/overview). | -| `sdkMetadata.environment?` | `string` | Typically this will be the `NODE_ENV` that the SDK is currently running in. | -| `sdkMetadata.name` | `string` | The npm package name of the SDK. | -| `sdkMetadata.version` | `string` | The npm package version of the SDK. | -| `selectInitialSession?` | (client) => null \| [SignedInSessionResource](/docs/references/javascript/session) | By default, the last signed-in session is used during client initialization. This option allows you to override that behavior, e.g. by selecting a specific session. | -| `signInFallbackRedirectUrl?` | null \| string | The fallback URL to redirect to after the user signs in, if there's no `redirect_url` in the path already. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. Defaults to `'/'`. | -| `signInForceRedirectUrl?` | null \| string | This URL will always be redirected to after the user signs in. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. | -| `signInUrl?` | `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. **It is required to 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. | -| `signUpFallbackRedirectUrl?` | null \| string | The fallback URL to redirect to after the user signs up, if there's no `redirect_url` in the path already. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. Defaults to `'/'`. | -| `signUpForceRedirectUrl?` | null \| string | This URL will always be redirected to after the user signs up. It's recommended to use the [environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. | -| `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. | -| `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/.typedoc/docs/clerk-react/protect.mdx b/.typedoc/docs/clerk-react/protect.mdx deleted file mode 100644 index 4d3c56c30f0..00000000000 --- a/.typedoc/docs/clerk-react/protect.mdx +++ /dev/null @@ -1,21 +0,0 @@ -Use `` in order to prevent unauthenticated or unauthorized users from accessing the children passed to the component. - -Examples: - -``` - - - has({permission:"a_permission_key"})} /> - has({role:"a_role_key"})} /> -Unauthorized

} /> -``` - -## Parameters - -| Parameter | Type | -| ------------------- | -------------- | -| `__namedParameters` | `ProtectProps` | - -## Returns - -`ReactNode` diff --git a/.typedoc/docs/clerk-react/redirect-to-create-organization.mdx b/.typedoc/docs/clerk-react/redirect-to-create-organization.mdx deleted file mode 100644 index 002c69ba5c1..00000000000 --- a/.typedoc/docs/clerk-react/redirect-to-create-organization.mdx +++ /dev/null @@ -1,13 +0,0 @@ -## Parameters - -| Parameter | Type | -| --------- | --------------------------------------------------- | -| `props` | [`Without`](../types/without.mdx)\<`P`, `"clerk"`\> | - -## Returns - -null \| Element - -## Deprecated - -Use [`redirectToCreateOrganization()`](/docs/references/javascript/clerk#redirect-to-create-organization) instead. diff --git a/.typedoc/docs/clerk-react/redirect-to-organization-profile.mdx b/.typedoc/docs/clerk-react/redirect-to-organization-profile.mdx deleted file mode 100644 index 1bb05bc69e5..00000000000 --- a/.typedoc/docs/clerk-react/redirect-to-organization-profile.mdx +++ /dev/null @@ -1,13 +0,0 @@ -## Parameters - -| Parameter | Type | -| --------- | --------------------------------------------------- | -| `props` | [`Without`](../types/without.mdx)\<`P`, `"clerk"`\> | - -## Returns - -null \| Element - -## Deprecated - -Use [`redirectToOrganizationProfile()`](/docs/references/javascript/clerk#redirect-to-organization-profile) instead. diff --git a/.typedoc/docs/clerk-react/redirect-to-user-profile.mdx b/.typedoc/docs/clerk-react/redirect-to-user-profile.mdx deleted file mode 100644 index f8e8364b5a6..00000000000 --- a/.typedoc/docs/clerk-react/redirect-to-user-profile.mdx +++ /dev/null @@ -1,13 +0,0 @@ -## Parameters - -| Parameter | Type | -| --------- | --------------------------------------------------- | -| `props` | [`Without`](../types/without.mdx)\<`P`, `"clerk"`\> | - -## Returns - -null \| Element - -## Deprecated - -Use [`redirectToUserProfile()`](/docs/references/javascript/clerk#redirect-to-user-profile) instead. diff --git a/.typedoc/docs/clerk-react/use-auth.mdx b/.typedoc/docs/clerk-react/use-auth.mdx deleted file mode 100644 index 01f1051a69b..00000000000 --- a/.typedoc/docs/clerk-react/use-auth.mdx +++ /dev/null @@ -1,176 +0,0 @@ -The `useAuth()` hook provides access to the current user's authentication state and methods to manage the active session. - -> [!NOTE] -> To access auth data server-side, see the [`Auth` object reference doc](/docs/references/backend/types/auth-object). - - -By default, Next.js opts all routes into static rendering. If you need to opt a route or routes into dynamic rendering because you need to access the authentication data at request time, you can create a boundary by passing the `dynamic` prop to ``. See the [guide on rendering modes](/docs/references/nextjs/rendering-modes) for more information, including code examples. - - -## Parameters - -| Parameter | Type | Description | -| ---------------------------- | -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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 - -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. - - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `actor` | `undefined` | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | -| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | -| `has` | `undefined` | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | -| `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. | -| `orgId` | `undefined` | The ID of the user's active organization. | -| `orgRole` | `undefined` | The current user's role in their active organization. | -| `orgSlug` | `undefined` | The URL-friendly identifier of the user's active organization. | -| `sessionClaims` | `undefined` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | -| `sessionId` | `undefined` | The ID for the current session. | -| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | -| `userId` | `undefined` | The ID of the current user. | - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `actor` | `null` | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | -| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | -| `has()` | (params) => false | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | -| `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. | -| `orgId` | `null` | The ID of the user's active organization. | -| `orgRole` | `null` | The current user's role in their active organization. | -| `orgSlug` | `null` | The URL-friendly identifier of the user's active organization. | -| `sessionClaims` | `null` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | -| `sessionId` | `null` | The ID for the current session. | -| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | -| `userId` | `null` | The ID of the current user. | - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `actor` | null \| \{ [x: string]: unknown; sub: string; \} | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | -| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | -| `has()` | (isAuthorizedParams) => boolean | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | -| `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. | -| `orgId` | `null` | The ID of the user's active organization. | -| `orgRole` | `null` | The current user's role in their active organization. | -| `orgSlug` | `null` | The URL-friendly identifier of the user's active organization. | -| `sessionClaims` | `JwtPayload` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | -| `sessionId` | `string` | The ID for the current session. | -| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | -| `userId` | `string` | The ID of the current user. | - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `actor` | null \| \{ [x: string]: unknown; sub: string; \} | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | -| `getToken()` | (options?) => Promise\ | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | -| `has()` | (isAuthorizedParams) => boolean | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | -| `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. | -| `orgId` | `string` | The ID of the user's active organization. | -| `orgRole` | `OrganizationCustomRoleKey` | The current user's role in their active organization. | -| `orgSlug` | null \| string | The URL-friendly identifier of the user's active organization. | -| `sessionClaims` | `JwtPayload` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | -| `sessionId` | `string` | The ID for the current session. | -| `signOut()` | \{ (options?): Promise\; (signOutCallback?, options?): Promise\; \} | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | -| `userId` | `string` | The ID of the current user. | - - - -## Example - -The following example demonstrates how to use the `useAuth()` hook to access the current auth state, like whether the user is signed in or not. It also includes a basic example for using the `getToken()` method to retrieve a session token for fetching data from an external resource. - - - - -```tsx {{ filename: 'src/pages/ExternalDataPage.tsx' }} -import { useAuth } from "@clerk/clerk-react"; - -export default function ExternalDataPage() { - const { userId, sessionId, getToken, isLoaded, isSignedIn } = useAuth(); - - const fetchExternalData = async () => { - const token = await getToken(); - - // Fetch data from an external API - const response = await fetch("https://api.example.com/data", { - headers: { - Authorization: `Bearer ${token}`, - }, - }); - - return response.json(); - }; - - if (!isLoaded) { - return
Loading...
; - } - - if (!isSignedIn) { - return
Sign in to view this page
; - } - - return ( -
-

- Hello, {userId}! Your current active session is {sessionId}. -

- -
- ); -} -``` - -
- - -```tsx {{ filename: 'app/external-data/page.tsx' }} -"use client"; - -import { useAuth } from "@clerk/nextjs"; - -export default function ExternalDataPage() { - const { userId, sessionId, getToken, isLoaded, isSignedIn } = useAuth(); - - const fetchExternalData = async () => { - const token = await getToken(); - - // Fetch data from an external API - const response = await fetch("https://api.example.com/data", { - headers: { - Authorization: `Bearer ${token}`, - }, - }); - - return response.json(); - }; - - if (!isLoaded) { - return
Loading...
; - } - - if (!isSignedIn) { - return
Sign in to view this page
; - } - - return ( -
-

- Hello, {userId}! Your current active session is {sessionId}. -

- -
- ); -} -``` - -
-
diff --git a/.typedoc/docs/clerk-react/use-clerk.mdx b/.typedoc/docs/clerk-react/use-clerk.mdx deleted file mode 100644 index 074e0243ca1..00000000000 --- a/.typedoc/docs/clerk-react/use-clerk.mdx +++ /dev/null @@ -1,43 +0,0 @@ -> [!WARNING] -> This hook should only be used for advanced use cases, such as building a completely custom OAuth flow or as an escape hatch to access to the `Clerk` object. - -The `useClerk()` hook provides access to the [`Clerk`](/docs/references/javascript/clerk) object, allowing you to build alternatives to any Clerk Component. - -## Returns - -[Clerk](/docs/references/javascript/clerk) — The `useClerk()` hook returns the `Clerk` object, which includes all the methods and properties listed in the [`Clerk` reference](/docs/references/javascript/clerk). - -## Example - -The following example uses the `useClerk()` hook to access the `clerk` object. The `clerk` object is used to call the [`openSignIn()`](/docs/references/javascript/clerk#sign-in) method to open the sign-in modal. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useClerk } from "@clerk/clerk-react"; - -export default function Home() { - const clerk = useClerk(); - - return ; -} -``` - - - - -```tsx {{ filename: 'app/page.tsx' }} -"use client"; - -import { useClerk } from "@clerk/nextjs"; - -export default function HomePage() { - const clerk = useClerk(); - - return ; -} -``` - - - diff --git a/.typedoc/docs/clerk-react/use-organization-list.mdx b/.typedoc/docs/clerk-react/use-organization-list.mdx deleted file mode 100644 index c6f8b6d93cb..00000000000 --- a/.typedoc/docs/clerk-react/use-organization-list.mdx +++ /dev/null @@ -1,150 +0,0 @@ -The `useOrganizationList()` hook provides access to the current user's organization memberships, invitations, and suggestions. It also includes methods for creating new organizations and managing the active organization. - -## Parameters - -| Parameter | Type | -| --------- | ---- | -| `params?` | `T` | - -## Returns - -[`UseOrganizationListReturn`](../shared/use-organization-list-return.mdx)\<`T`\> - -## Examples - -### Expanding and paginating attributes - -To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. So by default, the `userMemberships`, `userInvitations`, and `userSuggestions` attributes are not populated. You must pass true or an object with the desired properties to fetch and paginate the data. - -```tsx -// userMemberships.data will never be populated -const { userMemberships } = useOrganizationList(); - -// Use default values to fetch userMemberships, such as initialPage = 1 and pageSize = 10 -const { userMemberships } = useOrganizationList({ - userMemberships: true, -}); - -// Pass your own values to fetch userMemberships -const { userMemberships } = useOrganizationList({ - userMemberships: { - pageSize: 20, - initialPage: 2, // skips the first page - }, -}); - -// Aggregate pages in order to render an infinite list -const { userMemberships } = useOrganizationList({ - userMemberships: { - infinite: true, - }, -}); -``` - -### Infinite pagination - -The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `userMemberships` attribute will be populated with the first page of the user's organization memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. - -```tsx {{ filename: 'src/components/JoinedOrganizations.tsx' }} -import { useOrganizationList } from "@clerk/clerk-react"; -import React from "react"; - -const JoinedOrganizations = () => { - const { isLoaded, setActive, userMemberships } = useOrganizationList({ - userMemberships: { - infinite: true, - }, - }); - - if (!isLoaded) { - return <>Loading; - } - - return ( - <> -
    - {userMemberships.data?.map((mem) => ( -
  • - {mem.organization.name} - -
  • - ))} -
- - - - ); -}; - -export default JoinedOrganizations; -``` - -### Simple pagination - -The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `userInvitations` attribute will be populated with the first page of invitations. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of invitations. - -Notice the difference between this example's pagination and the infinite pagination example above. - -```tsx {{ filename: 'src/components/UserInvitationsTable.tsx' }} -import { useOrganizationList } from "@clerk/clerk-react"; -import React from "react"; - -const UserInvitationsTable = () => { - const { isLoaded, userInvitations } = useOrganizationList({ - userInvitations: { - infinite: true, - keepPreviousData: true, - }, - }); - - if (!isLoaded || userInvitations.isLoading) { - return <>Loading; - } - - return ( - <> - - - - - - - - - - {userInvitations.data?.map((inv) => ( - - - - - ))} - -
EmailOrg name
{inv.emailAddress}{inv.publicOrganizationData.name}
- - - - - ); -}; - -export default UserInvitationsTable; -``` diff --git a/.typedoc/docs/clerk-react/use-organization.mdx b/.typedoc/docs/clerk-react/use-organization.mdx deleted file mode 100644 index d37be2324cb..00000000000 --- a/.typedoc/docs/clerk-react/use-organization.mdx +++ /dev/null @@ -1,130 +0,0 @@ -The `useOrganization()` hook retrieves attributes of the currently active organization. - -## Parameters - -| Parameter | Type | -| --------- | ---- | -| `params?` | `T` | - -## Returns - -[`UseOrganizationReturn`](../shared/use-organization-return.mdx)\<`T`\> - -## Examples - -### Expand and paginate attributes - -To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. By default, the `memberships`, `invitations`, `membershipRequests`, and `domains` attributes are not populated. You must pass `true` or an object with the desired properties to fetch and paginate the data. - -```tsx -// invitations.data will never be populated. -const { invitations } = useOrganization(); - -// Use default values to fetch invitations, such as initialPage = 1 and pageSize = 10 -const { invitations } = useOrganization({ - invitations: true, -}); - -// Pass your own values to fetch invitations -const { invitations } = useOrganization({ - invitations: { - pageSize: 20, - initialPage: 2, // skips the first page - }, -}); - -// Aggregate pages in order to render an infinite list -const { invitations } = useOrganization({ - invitations: { - infinite: true, - }, -}); -``` - -### Infinite pagination - -The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. - -```tsx -import { useOrganization } from '@clerk/clerk-react' - -export default function MemberList() { - const { memberships } = useOrganization({ - memberships: { - infinite: true, // Append new data to the existing list - keepPreviousData: true, // Persist the cached data until the new data has been fetched - }, - }) - - if (!memberships) { - // Handle loading state - return null - } - - return ( -
-

Organization members

-
    - {memberships.data?.map((membership) => ( -
  • - {membership.publicUserData.firstName} {membership.publicUserData.lastName} < - {membership.publicUserData.identifier}> :: {membership.role} -
  • - ))} -
- - -
- ) -} -``` - -### Simple pagination - -The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of memberships. - -Notice the difference between this example's pagination and the infinite pagination example above. - -```tsx -import { useOrganization } from '@clerk/clerk-react' - -export default function MemberList() { - const { memberships } = useOrganization({ - memberships: { - keepPreviousData: true, // Persist the cached data until the new data has been fetched - }, - }) - - if (!memberships) { - // Handle loading state - return null - } - - return ( -
-

Organization members

-
    - {memberships.data?.map((membership) => ( -
  • - {membership.publicUserData.firstName} {membership.publicUserData.lastName} < - {membership.publicUserData.identifier}> :: {membership.role} -
  • - ))} -
- - - - -
- ) -} -``` diff --git a/.typedoc/docs/clerk-react/use-reverification.mdx b/.typedoc/docs/clerk-react/use-reverification.mdx deleted file mode 100644 index f307df52533..00000000000 --- a/.typedoc/docs/clerk-react/use-reverification.mdx +++ /dev/null @@ -1,55 +0,0 @@ -> [!WARNING] -> -> Depending on the SDK you're using, this feature requires `@clerk/nextjs@6.12.7` or later, `@clerk/clerk-react@5.25.1` or later, and `@clerk/clerk-js@5.57.1` or later. - -The `useReverification()` hook is used to handle a session's reverification flow. If a request requires reverification, a modal will display, prompting the user to verify their credentials. Upon successful verification, the original request will automatically retry. - -## Parameters - -| Parameter | Type | -| ---------- | --------- | -| `fetcher` | `Fetcher` | -| `options?` | `Options` | - -## Returns - -`UseReverificationResult`\<`Fetcher`\> — The `useReverification()` hook returns an array with the "enhanced" fetcher. - -## Example - -### Handle cancellation of the reverification process - -The following example demonstrates how to handle scenarios where a user cancels the reverification flow, such as closing the modal, which might result in `myData` being `null`. - -In the following example, `myFetcher` would be a function in your backend that fetches data from the route that requires reverification. See the [guide on how to require reverification](/docs/guides/reverification) for more information. - -```tsx {{ filename: 'src/components/MyButton.tsx' }} -import { useReverification } from "@clerk/clerk-react"; -import { isReverificationCancelledError } from "@clerk/clerk-react/error"; - -type MyData = { - balance: number; -}; - -export function MyButton() { - const fetchMyData = () => - fetch("/api/balance").then((res) => res.json() as Promise); - const enhancedFetcher = useReverification(fetchMyData); - - const handleClick = async () => { - try { - const myData = await enhancedFetcher(); - // ^ is types as `MyData` - } catch (e) { - // Handle error returned from the fetcher here - - // You can also handle cancellation with the following - if (isReverificationCancelledError(err)) { - // Handle the cancellation error here - } - } - }; - - return ; -} -``` diff --git a/.typedoc/docs/clerk-react/use-session-list.mdx b/.typedoc/docs/clerk-react/use-session-list.mdx deleted file mode 100644 index 6602a87d186..00000000000 --- a/.typedoc/docs/clerk-react/use-session-list.mdx +++ /dev/null @@ -1,77 +0,0 @@ -The `useSessionList()` hook returns an array of [`Session`](/docs/references/javascript/session) objects that have been registered on the client device. - -## 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. - - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `sessions` | `undefined` | A list of sessions that have been registered on the client device. | -| `setActive` | `undefined` | A function that sets the active session and/or organization. | - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `sessions` | [SessionResource](/docs/references/javascript/session)[] | A list of sessions that have been registered on the client device. | -| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session and/or organization. | - - - -## Example - -### Get a list of sessions - -The following example uses `useSessionList()` to get a list of sessions that have been registered on the client device. The `sessions` property is used to show the number of times the user has visited the page. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useSessionList } from "@clerk/clerk-react"; - -export default function Home() { - const { isLoaded, sessions } = useSessionList(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return ( -
-

Welcome back. You've been here {sessions.length} times before.

-
- ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -"use client"; - -import { useSessionList } from "@clerk/nextjs"; - -export default function HomePage() { - const { isLoaded, sessions } = useSessionList(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return ( -
-

Welcome back. You've been here {sessions.length} times before.

-
- ); -} -``` - -
-
diff --git a/.typedoc/docs/clerk-react/use-session.mdx b/.typedoc/docs/clerk-react/use-session.mdx deleted file mode 100644 index 1abbc16b9b6..00000000000 --- a/.typedoc/docs/clerk-react/use-session.mdx +++ /dev/null @@ -1,98 +0,0 @@ -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. - -## 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. - - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `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 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 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` | `boolean` | A boolean that indicates whether a user is currently signed in. | -| `session` | [`SignedInSessionResource`](/docs/references/javascript/session) | The current session for the user. | - - - -## Example - -### Access the `Session` object - -The following example uses the `useSession()` hook to access the `Session` object, which has the `lastActiveAt` property. The `lastActiveAt` property is a `Date` object used to show the time the session was last active. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useSession } from "@clerk/clerk-react"; - -export default function Home() { - const { isLoaded, session, isSignedIn } = useSession(); - - if (!isLoaded) { - // Handle loading state - return null; - } - if (!isSignedIn) { - // Handle signed out state - return null; - } - - return ( -
-

- This session has been active since{" "} - {session.lastActiveAt.toLocaleString()} -

-
- ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -"use client"; - -import { useSession } from "@clerk/nextjs"; - -export default function HomePage() { - const { isLoaded, session, isSignedIn } = useSession(); - - if (!isLoaded) { - // Handle loading state - return null; - } - if (!isSignedIn) { - // Handle signed out state - return null; - } - - return ( -
-

- This session has been active since{" "} - {session.lastActiveAt.toLocaleString()} -

-
- ); -} -``` - -
-
diff --git a/.typedoc/docs/clerk-react/use-sign-in.mdx b/.typedoc/docs/clerk-react/use-sign-in.mdx deleted file mode 100644 index a94556a8390..00000000000 --- a/.typedoc/docs/clerk-react/use-sign-in.mdx +++ /dev/null @@ -1,73 +0,0 @@ -The `useSignIn()` hook provides access to the [`SignIn`](/docs/references/javascript/sign-in) object, which allows you to check the current state of a sign-in attempt and manage the sign-in flow. You can use this to create a [custom sign-in flow](/docs/custom-flows/overview#sign-in-flow). - -## 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. - - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `setActive` | `undefined` | A function that sets the active session. | -| `signIn` | `undefined` | An object that contains the current sign-in attempt status and methods to create a new sign-in attempt. | - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session. | -| `signIn` | [SignInResource](/docs/references/javascript/sign-in) | An object that contains the current sign-in attempt status and methods to create a new sign-in attempt. | - - - -## Examples - -### Check the current state of a sign-in - -The following example uses the `useSignIn()` hook to access the [`SignIn`](/docs/references/javascript/sign-in) object, which contains the current sign-in attempt status and methods to create a new sign-in attempt. The `isLoaded` property is used to handle the loading state. - - - - -```tsx {{ filename: 'src/pages/SignInPage.tsx' }} -import { useSignIn } from "@clerk/clerk-react"; - -export default function SignInPage() { - const { isLoaded, signIn } = useSignIn(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return
The current sign-in attempt status is {signIn?.status}.
; -} -``` - -
- - -```tsx {{ filename: 'app/sign-in/page.tsx' }} -"use client"; - -import { useSignIn } from "@clerk/nextjs"; - -export default function SignInPage() { - const { isLoaded, signIn } = useSignIn(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return
The current sign-in attempt status is {signIn?.status}.
; -} -``` - -
-
- -### Create a custom sign-in flow with `useSignIn()` - -The `useSignIn()` hook can also be used to build fully custom sign-in flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-in flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignIn()` hook to create custom flows, see the [custom flow guides](/docs/custom-flows/overview). diff --git a/.typedoc/docs/clerk-react/use-sign-up.mdx b/.typedoc/docs/clerk-react/use-sign-up.mdx deleted file mode 100644 index be1cee60c46..00000000000 --- a/.typedoc/docs/clerk-react/use-sign-up.mdx +++ /dev/null @@ -1,73 +0,0 @@ -The `useSignUp()` hook provides access to the [`SignUp`](/docs/references/javascript/sign-up) object, which allows you to check the current state of a sign-up attempt and manage the sign-up flow. You can use this to create a [custom sign-up flow](/docs/custom-flows/overview#sign-up-flow). - -## 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. - - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `setActive` | `undefined` | A function that sets the active session. | -| `signUp` | `undefined` | An object that contains the current sign-up attempt status and methods to create a new sign-up attempt. | - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session. | -| `signUp` | [`SignUpResource`](/docs/references/javascript/sign-up) | An object that contains the current sign-up attempt status and methods to create a new sign-up attempt. | - - - -## Examples - -### Check the current state of a sign-up - -The following example uses the `useSignUp()` hook to access the [`SignUp`](/docs/references/javascript/sign-up) object, which contains the current sign-up attempt status and methods to create a new sign-up attempt. The `isLoaded` property is used to handle the loading state. - - - - -```tsx {{ filename: 'src/pages/SignUpPage.tsx' }} -import { useSignUp } from "@clerk/clerk-react"; - -export default function SignUpPage() { - const { isLoaded, signUp } = useSignUp(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return
The current sign-up attempt status is {signUp?.status}.
; -} -``` - -
- - -```tsx {{ filename: 'app/sign-up/page.tsx' }} -"use client"; - -import { useSignUp } from "@clerk/nextjs"; - -export default function SignUpPage() { - const { isLoaded, signUp } = useSignUp(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return
The current sign-up attempt status is {signUp?.status}.
; -} -``` - -
-
- -### Create a custom sign-up flow with `useSignUp()` - -The `useSignUp()` hook can also be used to build fully custom sign-up flows, if Clerk's prebuilt components don't meet your specific needs or if you require more control over the authentication flow. Different sign-up flows include email and password, email and phone codes, email links, and multifactor (MFA). To learn more about using the `useSignUp()` hook to create custom flows, see the [custom flow guides](/docs/custom-flows/overview). diff --git a/.typedoc/docs/clerk-react/use-user.mdx b/.typedoc/docs/clerk-react/use-user.mdx deleted file mode 100644 index a89b31c4fae..00000000000 --- a/.typedoc/docs/clerk-react/use-user.mdx +++ /dev/null @@ -1,211 +0,0 @@ -The `useUser()` hook provides access to the current user's [`User`](/docs/references/javascript/user) object, which contains all the data for a single user in your application and provides methods to manage their account. This hook also allows you to check if the user is signed in and if Clerk has loaded and initialized. - -## 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. - - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `isSignedIn` | `undefined` | A boolean that returns `true` if the user is signed in. | -| `user` | `undefined` | The `User` object for the current 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 returns `true` if the user is signed in. | -| `user` | `null` | The `User` object for the current 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 returns `true` if the user is signed in. | -| `user` | [`UserResource`](/docs/references/javascript/user) | The `User` object for the current user. | - - - -## Examples - -### Get the current user - -The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which contains the current user's data such as their full name. The `isLoaded` and `isSignedIn` properties are used to handle the loading state and to check if the user is signed in, respectively. - -```tsx {{ filename: 'src/Example.tsx' }} -export default function Example() { - const { isSignedIn, user, isLoaded } = useUser(); - - if (!isLoaded) { - return
Loading...
; - } - - if (!isSignedIn) { - return
Sign in to view this page
; - } - - return
Hello {user.firstName}!
; -} -``` - -### Update user data - -The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`update()`](/docs/references/javascript/user#update) method to update the current user's information. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useUser } from "@clerk/clerk-react"; - -export default function Home() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - await user.update({ - firstName: "John", - lastName: "Doe", - }); - }; - - return ( - <> - -

user.firstName: {user?.firstName}

-

user.lastName: {user?.lastName}

- - ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -"use client"; - -import { useUser } from "@clerk/nextjs"; - -export default function HomePage() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - await user.update({ - firstName: "John", - lastName: "Doe", - }); - }; - - return ( - <> - -

user.firstName: {user?.firstName}

-

user.lastName: {user?.lastName}

- - ); -} -``` - -
-
- -### Reload user data - -The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`reload()`](/docs/references/javascript/user#reload) method to get the latest user's information. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useUser } from "@clerk/clerk-react"; - -export default function Home() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - // Update data via an API endpoint - const updateMetadata = await fetch("/api/updateMetadata"); - - // Check if the update was successful - if (updateMetadata.message !== "success") { - throw new Error("Error updating"); - } - - // If the update was successful, reload the user data - await user.reload(); - }; - - return ( - <> - -

user role: {user?.publicMetadata.role}

- - ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -"use client"; - -import { useUser } from "@clerk/nextjs"; - -export default function HomePage() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - // Update data via an API endpoint - const updateMetadata = await fetch("/api/updateMetadata"); - - // Check if the update was successful - if (updateMetadata.message !== "success") { - throw new Error("Error updating"); - } - - // If the update was successful, reload the user data - await user.reload(); - }; - - return ( - <> - -

user role: {user?.publicMetadata.role}

- - ); -} -``` - -
-
diff --git a/.typedoc/docs/nextjs/auth.mdx b/.typedoc/docs/nextjs/auth.mdx deleted file mode 100644 index c19bd0e7c4a..00000000000 --- a/.typedoc/docs/nextjs/auth.mdx +++ /dev/null @@ -1,5 +0,0 @@ -The `auth()` helper returns the [`Auth`](/docs/references/backend/types/auth-object) object of the currently active user, as well as the [`redirectToSignIn()`](/docs/references/nextjs/auth#redirect-to-sign-in) method. - -- Only available for App Router. -- Only works on the server-side, such as in Server Components, Route Handlers, and Server Actions. -- Requires [`clerkMiddleware()`](/docs/references/nextjs/clerk-middleware) to be configured. diff --git a/.typedoc/docs/nextjs/build-clerk-props.mdx b/.typedoc/docs/nextjs/build-clerk-props.mdx deleted file mode 100644 index 9059525d586..00000000000 --- a/.typedoc/docs/nextjs/build-clerk-props.mdx +++ /dev/null @@ -1,38 +0,0 @@ -Clerk uses `buildClerkProps` to inform the client-side helpers of the authentication state of the user. This function is used SSR in the `getServerSideProps` function of your Next.js application. - -## Examples - -### Basic usage - -```tsx {{ filename: 'pages/myServerSidePage.tsx' }} -import { getAuth, buildClerkProps } from "@clerk/nextjs/server"; -import { GetServerSideProps } from "next"; - -export const getServerSideProps: GetServerSideProps = async (ctx) => { - const { userId } = getAuth(ctx.req); - - if (!userId) { - // handle user is not signed in. - } - - // Load any data your application needs for the page using the userId - return { props: { ...buildClerkProps(ctx.req) } }; -}; -``` - -### Usage with `clerkClient` - -The `clerkClient` allows you to access the Clerk API. You can use this to retrieve or update data. - -```tsx {{ filename: 'pages/api/example.ts' }} -import { getAuth, buildClerkProps, clerkClient } from "@clerk/nextjs/server"; -import { GetServerSideProps } from "next"; - -export const getServerSideProps: GetServerSideProps = async (ctx) => { - const { userId } = getAuth(ctx.req); - - const user = userId ? await clerkClient().users.getUser(userId) : undefined; - - return { props: { ...buildClerkProps(ctx.req, { user }) } }; -}; -``` diff --git a/.typedoc/docs/nextjs/clerk-middleware-auth-object.mdx b/.typedoc/docs/nextjs/clerk-middleware-auth-object.mdx deleted file mode 100644 index c66ae2fec8d..00000000000 --- a/.typedoc/docs/nextjs/clerk-middleware-auth-object.mdx +++ /dev/null @@ -1,3 +0,0 @@ -## Deprecated - -Use `ClerkMiddlewareSessionAuthObject` instead. diff --git a/.typedoc/docs/nextjs/clerk-middleware-options.mdx b/.typedoc/docs/nextjs/clerk-middleware-options.mdx deleted file mode 100644 index 9514009e75d..00000000000 --- a/.typedoc/docs/nextjs/clerk-middleware-options.mdx +++ /dev/null @@ -1,29 +0,0 @@ -The `clerkMiddleware()` function accepts an optional object. The following options are available. - -## Properties - -| Property | Type | Description | -| --------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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`. | -| `contentSecurityPolicy?` | `ContentSecurityPolicyOptions` | When set, automatically injects a Content-Security-Policy header(s) compatible with Clerk. | -| `debug?` | `boolean` | If true, additional debug information will be logged to the console. | -| `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/.typedoc/docs/nextjs/clerk-middleware.mdx b/.typedoc/docs/nextjs/clerk-middleware.mdx deleted file mode 100644 index a1913f86cd4..00000000000 --- a/.typedoc/docs/nextjs/clerk-middleware.mdx +++ /dev/null @@ -1 +0,0 @@ -The `clerkMiddleware()` helper integrates Clerk authentication into your Next.js application through Middleware. `clerkMiddleware()` is compatible with both the App and Pages routers. diff --git a/.typedoc/docs/nextjs/create-async-get-auth.mdx b/.typedoc/docs/nextjs/create-async-get-auth.mdx deleted file mode 100644 index e598027e2ba..00000000000 --- a/.typedoc/docs/nextjs/create-async-get-auth.mdx +++ /dev/null @@ -1,23 +0,0 @@ -The async variant of our old `createGetAuth` allows for asynchronous code inside its callback. -Should be used with function like `auth()` that are already asynchronous. - -## Parameters - -| Parameter | Type | -| --------------------------------------- | ------------------------------------------------------------------------ | -| `__namedParameters` | \{ debugLoggerName: string; noAuthStatusMessage: string; \} | -| `__namedParameters.debugLoggerName` | `string` | -| `__namedParameters.noAuthStatusMessage` | `string` | - -## Returns - -### Parameters - -| 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 - -`Promise`\<[`AuthObject`](../backend/auth-object.mdx)\> diff --git a/.typedoc/docs/nextjs/create-sync-get-auth.mdx b/.typedoc/docs/nextjs/create-sync-get-auth.mdx deleted file mode 100644 index 36f2647a57e..00000000000 --- a/.typedoc/docs/nextjs/create-sync-get-auth.mdx +++ /dev/null @@ -1,24 +0,0 @@ -Previous known as `createGetAuth`. We needed to create a sync and async variant in order to allow for improvements -that required dynamic imports (using `require` would not work). -It powers the synchronous top-level api `getAuth()`. - -## Parameters - -| Parameter | Type | -| --------------------------------------- | ------------------------------------------------------------------------ | -| `__namedParameters` | \{ debugLoggerName: string; noAuthStatusMessage: string; \} | -| `__namedParameters.debugLoggerName` | `string` | -| `__namedParameters.noAuthStatusMessage` | `string` | - -## Returns - -### Parameters - -| 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 - -SignedInAuthObject \| SignedOutAuthObject diff --git a/.typedoc/docs/nextjs/current-user.mdx b/.typedoc/docs/nextjs/current-user.mdx deleted file mode 100644 index 268ac18bb80..00000000000 --- a/.typedoc/docs/nextjs/current-user.mdx +++ /dev/null @@ -1,25 +0,0 @@ -The `currentUser` helper returns the [Backend User](/docs/references/backend/types/backend-user) object of the currently active user. It can be used in Server Components, Route Handlers, and Server Actions. - -Under the hood, this helper: - -- calls `fetch()`, so it is automatically deduped per request. -- uses the [`GET /v1/users/{user_id}`](/docs/reference/backend-api/tag/Users#operation/GetUser) endpoint. -- counts towards the [Backend API request rate limit](/docs/backend-requests/resources/rate-limits). - -## Returns - -`Promise`\<null \| [User](../backend/user.mdx)\> - -## Example - -```tsx {{ filename: 'app/page.tsx' }} -import { currentUser } from "@clerk/nextjs/server"; - -export default async function Page() { - const user = await currentUser(); - - if (!user) return
Not signed in
; - - return
Hello {user?.firstName}
; -} -``` diff --git a/.typedoc/docs/nextjs/get-auth.mdx b/.typedoc/docs/nextjs/get-auth.mdx deleted file mode 100644 index 1312a0929e0..00000000000 --- a/.typedoc/docs/nextjs/get-auth.mdx +++ /dev/null @@ -1,86 +0,0 @@ -The `getAuth()` helper retrieves authentication state from the request object. - -> [!NOTE] -> If you are using App Router, use the [`auth()` helper](/docs/references/nextjs/auth) instead. - -## Parameters - -| 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 - -SignedInAuthObject \| SignedOutAuthObject — The `Auth` object. See the [Auth reference](/docs/references/backend/types/auth-object) for more information. - -## Examples - -### Protect API routes - -The following example demonstrates how to protect an API route by checking if the `userId` is present in the `getAuth()` response. - -```tsx {{ filename: 'app/api/example/route.ts' }} -import { getAuth } from "@clerk/nextjs/server"; -import type { NextApiRequest, NextApiResponse } from "next"; - -export default async function handler( - req: NextApiRequest, - res: NextApiResponse, -) { - const { userId } = getAuth(req); - - if (!userId) { - return res.status(401).json({ error: "Not authenticated" }); - } - - // Add logic that retrieves the data for the API route - - return res.status(200).json({ userId: userId }); -} -``` - -### Usage with `getToken()` - -`getAuth()` returns [`getToken()`](/docs/references/backend/types/auth-object#get-token), which is a method that returns the current user's session token or a custom JWT template. - -```tsx {{ filename: 'app/api/example/route.ts' }} -import { getAuth } from "@clerk/nextjs/server"; -import type { NextApiRequest, NextApiResponse } from "next"; - -export default async function handler( - req: NextApiRequest, - res: NextApiResponse, -) { - const { getToken } = getAuth(req); - - const token = await getToken({ template: "supabase" }); - - // Add logic that retrieves the data - // from your database using the token - - return res.status(200).json({}); -} -``` - -### Usage with `clerkClient` - -`clerkClient` is used to access the [Backend SDK](/docs/references/backend/overview), which exposes Clerk's Backend API resources. You can use `getAuth()` to pass authentication information that many of the Backend SDK methods require, like the user's ID. - -```tsx {{ filename: 'app/api/example/route.ts' }} -import { clerkClient, getAuth } from "@clerk/nextjs/server"; -import type { NextApiRequest, NextApiResponse } from "next"; - -export default async function handler( - req: NextApiRequest, - res: NextApiResponse, -) { - const { userId } = getAuth(req); - - const client = await clerkClient(); - - const user = userId ? await client.users.getUser(userId) : null; - - return res.status(200).json({}); -} -``` diff --git a/.typedoc/docs/shared/api-url-from-publishable-key.mdx b/.typedoc/docs/shared/api-url-from-publishable-key.mdx deleted file mode 100644 index 0bb0c86f121..00000000000 --- a/.typedoc/docs/shared/api-url-from-publishable-key.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Get the correct API url based on the publishable key. - -## Parameters - -| Parameter | Type | Description | -| ---------------- | -------- | ----------------------------- | -| `publishableKey` | `string` | The publishable key to parse. | - -## Returns - -"https://api.lclclerk.com" \| "https://api.clerkstage.dev" \| "https://api.clerk.com" — One of Clerk's API URLs. diff --git a/.typedoc/docs/shared/build-clerk-js-script-attributes.mdx b/.typedoc/docs/shared/build-clerk-js-script-attributes.mdx deleted file mode 100644 index eb0fbc9ae76..00000000000 --- a/.typedoc/docs/shared/build-clerk-js-script-attributes.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Builds an object of Clerk JS script attributes based on the provided options. - -## Parameters - -| Parameter | Type | Description | -| --------- | -------------------------- | -------------------------------------------------------- | -| `options` | `LoadClerkJsScriptOptions` | The options containing the values for script attributes. | - -## Returns - -`Record`\<`string`, `string`\> — An object containing data attributes to be applied to the script element. diff --git a/.typedoc/docs/shared/build-publishable-key.mdx b/.typedoc/docs/shared/build-publishable-key.mdx deleted file mode 100644 index 2cd1ea56cbe..00000000000 --- a/.typedoc/docs/shared/build-publishable-key.mdx +++ /dev/null @@ -1,11 +0,0 @@ -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/.typedoc/docs/shared/camel-to-snake.mdx b/.typedoc/docs/shared/camel-to-snake.mdx deleted file mode 100644 index 8164e16a4df..00000000000 --- a/.typedoc/docs/shared/camel-to-snake.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Converts a string from camelCase to snake_case. - -## Parameters - -| Parameter | Type | -| --------- | -------------------------------- | -| `str` | undefined \| string | - -## Returns - -`string` diff --git a/.typedoc/docs/shared/clerk-js-script-url.mdx b/.typedoc/docs/shared/clerk-js-script-url.mdx deleted file mode 100644 index abbd4d3b37d..00000000000 --- a/.typedoc/docs/shared/clerk-js-script-url.mdx +++ /dev/null @@ -1,18 +0,0 @@ -Generates a Clerk JS script URL based on the provided options. - -## Parameters - -| Parameter | Type | Description | -| --------- | -------------------------- | --------------------------------------------------------- | -| `opts` | `LoadClerkJsScriptOptions` | The options to use when building the Clerk JS script URL. | - -## Returns - -`string` — The complete URL to the Clerk JS script. - -## Example - -```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/.typedoc/docs/shared/clerk-runtime-error.mdx b/.typedoc/docs/shared/clerk-runtime-error.mdx deleted file mode 100644 index d61df8592e2..00000000000 --- a/.typedoc/docs/shared/clerk-runtime-error.mdx +++ /dev/null @@ -1,26 +0,0 @@ -Custom error class for representing Clerk runtime errors. - -ClerkRuntimeError - -## Example - -```ts -throw new ClerkRuntimeError("An error occurred", { code: "password_invalid" }); -``` - -## Properties - -| Property | Type | Description | Overrides | -| ------------------------------ | -------- | ------------------------------------------------------------------ | --------------- | -| `code` | `string` | A unique code identifying the error, can be used for localization. | - | -| `message` | `string` | The error message. | `Error.message` | - -## Methods - -### toString() - -Returns a string representation of the error. - -#### Returns - -`string` — A formatted string with the error name and message. diff --git a/.typedoc/docs/shared/create-dev-or-staging-url-cache.mdx b/.typedoc/docs/shared/create-dev-or-staging-url-cache.mdx deleted file mode 100644 index d0f1aeaeda3..00000000000 --- a/.typedoc/docs/shared/create-dev-or-staging-url-cache.mdx +++ /dev/null @@ -1,10 +0,0 @@ -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/.typedoc/docs/shared/create-path-matcher.mdx b/.typedoc/docs/shared/create-path-matcher.mdx deleted file mode 100644 index 5fcfc7fed75..00000000000 --- a/.typedoc/docs/shared/create-path-matcher.mdx +++ /dev/null @@ -1,21 +0,0 @@ -Creates a function that matches paths against a set of patterns. - -## Parameters - -| Parameter | Type | Description | -| ---------- | ------------------ | ------------------------------------------------------- | -| `patterns` | `PathMatcherParam` | A string, RegExp, or array of patterns to match against | - -## Returns - -A function that takes a pathname and returns true if it matches any of the patterns - -### Parameters - -| Parameter | Type | -| ---------- | -------- | -| `pathname` | `string` | - -### Returns - -`boolean` diff --git a/.typedoc/docs/shared/deep-camel-to-snake.mdx b/.typedoc/docs/shared/deep-camel-to-snake.mdx deleted file mode 100644 index 08cd236e036..00000000000 --- a/.typedoc/docs/shared/deep-camel-to-snake.mdx +++ /dev/null @@ -1,13 +0,0 @@ -Transforms camelCased objects/ arrays to snake_cased. -This function recursively traverses all objects and arrays of the passed value -camelCased keys are removed. - -## Parameters - -| Parameter | Type | -| --------- | ----- | -| `obj` | `any` | - -## Returns - -`any` diff --git a/.typedoc/docs/shared/deep-snake-to-camel.mdx b/.typedoc/docs/shared/deep-snake-to-camel.mdx deleted file mode 100644 index 3ad646a85be..00000000000 --- a/.typedoc/docs/shared/deep-snake-to-camel.mdx +++ /dev/null @@ -1,13 +0,0 @@ -Transforms snake_cased objects/ arrays to camelCased. -This function recursively traverses all objects and arrays of the passed value -camelCased keys are removed. - -## Parameters - -| Parameter | Type | -| --------- | ----- | -| `obj` | `any` | - -## Returns - -`any` diff --git a/.typedoc/docs/shared/deprecated-object-property.mdx b/.typedoc/docs/shared/deprecated-object-property.mdx deleted file mode 100644 index 611635bfb00..00000000000 --- a/.typedoc/docs/shared/deprecated-object-property.mdx +++ /dev/null @@ -1,21 +0,0 @@ -Mark object property as deprecated. - -A console WARNING will be displayed when object property is being accessed. - -1. Deprecate object property - const obj = { something: 'aloha' }; - -deprecatedObjectProperty(obj, 'something', 'Use `somethingElse` instead.'); - -## Parameters - -| Parameter | Type | -| ---------- | --------------------------- | -| `obj` | `Record`\<`string`, `any`\> | -| `propName` | `string` | -| `warning` | `string` | -| `key?` | `string` | - -## Returns - -`void` diff --git a/.typedoc/docs/shared/derive-state.mdx b/.typedoc/docs/shared/derive-state.mdx deleted file mode 100644 index c5a89ed30bd..00000000000 --- a/.typedoc/docs/shared/derive-state.mdx +++ /dev/null @@ -1,29 +0,0 @@ -Derives authentication state based on the current rendering context (SSR or client-side). - -## Parameters - -| Parameter | Type | -| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `clerkOperational` | `boolean` | -| `state` | `Resources` | -| `initialState` | undefined \| 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; \}\> | - -## Returns - -\{ actor: undefined \| null \| \{ [x: string]: unknown; sub: string; \}; factorVerificationAge: null \| \[number, number\]; organization: undefined \| null \| [OrganizationResource](/docs/references/javascript/organization); orgId: undefined \| null \| string; orgPermissions: undefined \| null \| Autocomplete\[]; orgRole: undefined \| null \| string; orgSlug: undefined \| null \| string; session: undefined \| null \| [SignedInSessionResource](/docs/references/javascript/session); sessionClaims: undefined \| null \| JwtPayload; sessionId: undefined \| null \| string; sessionStatus: undefined \| "active" \| "pending"; user: undefined \| null \| [UserResource](/docs/references/javascript/user); userId: undefined \| null \| string; \} - -| Name | Type | -| ----------------------- | -------------------------------------------------------------------------------------------------- | -| `actor` | undefined \| null \| \{ [x: string]: unknown; sub: string; \} | -| `factorVerificationAge` | null \| \[number, number\] | -| `organization` | undefined \| null \| [OrganizationResource](/docs/references/javascript/organization) | -| `orgId` | undefined \| null \| string | -| `orgPermissions` | undefined \| null \| Autocomplete\[] | -| `orgRole` | undefined \| null \| string | -| `orgSlug` | undefined \| null \| string | -| `session` | undefined \| null \| [SignedInSessionResource](/docs/references/javascript/session) | -| `sessionClaims` | undefined \| null \| JwtPayload | -| `sessionId` | undefined \| null \| string | -| `sessionStatus` | undefined \| "active" \| "pending" | -| `user` | undefined \| null \| [UserResource](/docs/references/javascript/user) | -| `userId` | undefined \| null \| string | diff --git a/.typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx b/.typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx deleted file mode 100644 index 3f8f20906e7..00000000000 --- a/.typedoc/docs/shared/extract-dev-browser-jwt-from-url.mdx +++ /dev/null @@ -1,13 +0,0 @@ -Gets the **clerk_db_jwt JWT from either the hash or the search -Side effect: -Removes **clerk_db_jwt JWT from the URL (hash and searchParams) and updates the browser history - -## Parameters - -| Parameter | Type | -| --------- | ----- | -| `url` | `URL` | - -## Returns - -`string` diff --git a/.typedoc/docs/shared/fast-deep-merge-and-replace.mdx b/.typedoc/docs/shared/fast-deep-merge-and-replace.mdx deleted file mode 100644 index b07891dbf5c..00000000000 --- a/.typedoc/docs/shared/fast-deep-merge-and-replace.mdx +++ /dev/null @@ -1,14 +0,0 @@ -Merges 2 objects without creating new object references -The merged props will appear on the `target` object -If `target` already has a value for a given key it will not be overwritten - -## Parameters - -| Parameter | Type | -| --------- | ---------------------------------------------------- | -| `source` | undefined \| null \| Record\ | -| `target` | undefined \| null \| Record\ | - -## Returns - -`void` diff --git a/.typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx b/.typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx deleted file mode 100644 index 4c846eea8c0..00000000000 --- a/.typedoc/docs/shared/get-clerk-js-major-version-or-tag.mdx +++ /dev/null @@ -1,14 +0,0 @@ -Retrieve the clerk-js major tag using the major version from the pkgVersion -param or use the frontendApi to determine if the canary tag should be used. -The default tag is `latest`. - -## Parameters - -| Parameter | Type | -| ------------- | -------- | -| `frontendApi` | `string` | -| `version?` | `string` | - -## Returns - -`string` diff --git a/.typedoc/docs/shared/get-cookie-suffix.mdx b/.typedoc/docs/shared/get-cookie-suffix.mdx deleted file mode 100644 index ac115fcc8b1..00000000000 --- a/.typedoc/docs/shared/get-cookie-suffix.mdx +++ /dev/null @@ -1,13 +0,0 @@ -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/.typedoc/docs/shared/get-env-variable.mdx b/.typedoc/docs/shared/get-env-variable.mdx deleted file mode 100644 index a60f14161bd..00000000000 --- a/.typedoc/docs/shared/get-env-variable.mdx +++ /dev/null @@ -1,12 +0,0 @@ -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. | - -## Returns - -`string` — The environment variable value or empty string if not found. diff --git a/.typedoc/docs/shared/get-non-undefined-values.mdx b/.typedoc/docs/shared/get-non-undefined-values.mdx deleted file mode 100644 index 0d051136c43..00000000000 --- a/.typedoc/docs/shared/get-non-undefined-values.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Get all non-undefined values from an object. - -## Parameters - -| Parameter | Type | -| --------- | ---- | -| `obj` | `T` | - -## Returns - -`Partial`\<`T`\> diff --git a/.typedoc/docs/shared/get-script-url.mdx b/.typedoc/docs/shared/get-script-url.mdx deleted file mode 100644 index 66218a1414c..00000000000 --- a/.typedoc/docs/shared/get-script-url.mdx +++ /dev/null @@ -1,14 +0,0 @@ -Retrieve the clerk-js script url from the frontendApi and the major tag -using the [getClerkJsMajorVersionOrTag](get-clerk-js-major-version-or-tag.mdx) or a provided clerkJSVersion tag. - -## Parameters - -| Parameter | Type | -| ----------------------------------- | ------------------------------------------- | -| `frontendApi` | `string` | -| `__namedParameters` | \{ clerkJSVersion?: string; \} | -| `__namedParameters.clerkJSVersion?` | `string` | - -## Returns - -`string` diff --git a/.typedoc/docs/shared/get-suffixed-cookie-name.mdx b/.typedoc/docs/shared/get-suffixed-cookie-name.mdx deleted file mode 100644 index f4f707d155e..00000000000 --- a/.typedoc/docs/shared/get-suffixed-cookie-name.mdx +++ /dev/null @@ -1,13 +0,0 @@ -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/.typedoc/docs/shared/icon-image-url.mdx b/.typedoc/docs/shared/icon-image-url.mdx deleted file mode 100644 index e0e3fbde62d..00000000000 --- a/.typedoc/docs/shared/icon-image-url.mdx +++ /dev/null @@ -1,13 +0,0 @@ -Returns the URL for a static image -using the new img.clerk.com service - -## Parameters - -| Parameter | Type | -| --------- | ---------------------------- | -| `id` | `string` | -| `format` | "svg" \| "jpeg" | - -## Returns - -`string` diff --git a/.typedoc/docs/shared/in-browser.mdx b/.typedoc/docs/shared/in-browser.mdx deleted file mode 100644 index e08842d7935..00000000000 --- a/.typedoc/docs/shared/in-browser.mdx +++ /dev/null @@ -1,5 +0,0 @@ -Checks if the window object is defined. You can also use this to check if something is happening on the client side. - -## Returns - -`boolean` diff --git a/.typedoc/docs/shared/is-browser-online.mdx b/.typedoc/docs/shared/is-browser-online.mdx deleted file mode 100644 index a4f7d95040f..00000000000 --- a/.typedoc/docs/shared/is-browser-online.mdx +++ /dev/null @@ -1,5 +0,0 @@ -Checks if the current environment is a browser and if the navigator is online. - -## Returns - -`boolean` diff --git a/.typedoc/docs/shared/is-clerk-runtime-error.mdx b/.typedoc/docs/shared/is-clerk-runtime-error.mdx deleted file mode 100644 index c5c725edb77..00000000000 --- a/.typedoc/docs/shared/is-clerk-runtime-error.mdx +++ /dev/null @@ -1,24 +0,0 @@ -Checks if the provided error object is an instance of ClerkRuntimeError. - -## Parameters - -| Parameter | Type | Description | -| --------- | ----- | -------------------------- | -| `err` | `any` | The error object to check. | - -## Returns - -`err is ClerkRuntimeError` — True if the error is a ClerkRuntimeError, false otherwise. - -## Example - -```ts -const error = new ClerkRuntimeError("An error occurred"); -if (isClerkRuntimeError(error)) { - // Handle ClerkRuntimeError - console.error("ClerkRuntimeError:", error.message); -} else { - // Handle other errors - console.error("Other error:", error.message); -} -``` diff --git a/.typedoc/docs/shared/is-development-from-publishable-key.mdx b/.typedoc/docs/shared/is-development-from-publishable-key.mdx deleted file mode 100644 index 6d17f30a7d4..00000000000 --- a/.typedoc/docs/shared/is-development-from-publishable-key.mdx +++ /dev/null @@ -1,12 +0,0 @@ -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/.typedoc/docs/shared/is-development-from-secret-key.mdx b/.typedoc/docs/shared/is-development-from-secret-key.mdx deleted file mode 100644 index 6d2785217a4..00000000000 --- a/.typedoc/docs/shared/is-development-from-secret-key.mdx +++ /dev/null @@ -1,12 +0,0 @@ -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/.typedoc/docs/shared/is-ipv4-address.mdx b/.typedoc/docs/shared/is-ipv4-address.mdx deleted file mode 100644 index ae9f7620269..00000000000 --- a/.typedoc/docs/shared/is-ipv4-address.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Checks if a string is a valid IPv4 address. - -## Parameters - -| Parameter | Type | -| --------- | ---------------------------------------- | -| `str` | undefined \| null \| string | - -## Returns - -`boolean` — True if the string is a valid IPv4 address, false otherwise. diff --git a/.typedoc/docs/shared/is-production-from-publishable-key.mdx b/.typedoc/docs/shared/is-production-from-publishable-key.mdx deleted file mode 100644 index 8aa8847074c..00000000000 --- a/.typedoc/docs/shared/is-production-from-publishable-key.mdx +++ /dev/null @@ -1,12 +0,0 @@ -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/.typedoc/docs/shared/is-production-from-secret-key.mdx b/.typedoc/docs/shared/is-production-from-secret-key.mdx deleted file mode 100644 index 289067ce0df..00000000000 --- a/.typedoc/docs/shared/is-production-from-secret-key.mdx +++ /dev/null @@ -1,12 +0,0 @@ -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/.typedoc/docs/shared/is-publishable-key.mdx b/.typedoc/docs/shared/is-publishable-key.mdx deleted file mode 100644 index b45694915b5..00000000000 --- a/.typedoc/docs/shared/is-publishable-key.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Checks if the provided key is a valid publishable key. - -## Parameters - -| Parameter | Type | Description | -| --------- | -------- | ------------------------------------------------------------------- | -| `key` | `string` | The key to be checked. Defaults to an empty string if not provided. | - -## Returns - -`boolean` — `true` if 'key' is a valid publishable key, `false` otherwise. diff --git a/.typedoc/docs/shared/is-staging.mdx b/.typedoc/docs/shared/is-staging.mdx deleted file mode 100644 index 1491f1c9705..00000000000 --- a/.typedoc/docs/shared/is-staging.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Check if the frontendApi ends with a staging domain - -## Parameters - -| Parameter | Type | -| ------------- | -------- | -| `frontendApi` | `string` | - -## Returns - -`boolean` diff --git a/.typedoc/docs/shared/is-truthy.mdx b/.typedoc/docs/shared/is-truthy.mdx deleted file mode 100644 index 9c9ea5413ba..00000000000 --- a/.typedoc/docs/shared/is-truthy.mdx +++ /dev/null @@ -1,11 +0,0 @@ -A function to determine if a value is truthy. - -## Parameters - -| Parameter | Type | -| --------- | --------- | -| `value` | `unknown` | - -## Returns - -`boolean` — True for `true`, true, positive numbers. False for `false`, false, 0, negative integers and anything else. diff --git a/.typedoc/docs/shared/is-valid-browser-online.mdx b/.typedoc/docs/shared/is-valid-browser-online.mdx deleted file mode 100644 index cbc8b340524..00000000000 --- a/.typedoc/docs/shared/is-valid-browser-online.mdx +++ /dev/null @@ -1,5 +0,0 @@ -Runs `isBrowserOnline` and `isValidBrowser` to check if the current environment is a valid browser and if the navigator is online. - -## Returns - -`boolean` diff --git a/.typedoc/docs/shared/is-valid-browser.mdx b/.typedoc/docs/shared/is-valid-browser.mdx deleted file mode 100644 index 5d89b5b376c..00000000000 --- a/.typedoc/docs/shared/is-valid-browser.mdx +++ /dev/null @@ -1,5 +0,0 @@ -Checks if the current environment is a browser and the user agent is not a bot. - -## Returns - -`boolean` diff --git a/.typedoc/docs/shared/isomorphic-atob.mdx b/.typedoc/docs/shared/isomorphic-atob.mdx deleted file mode 100644 index ed412ce6632..00000000000 --- a/.typedoc/docs/shared/isomorphic-atob.mdx +++ /dev/null @@ -1,12 +0,0 @@ -A function that decodes a string of data which has been encoded using base-64 encoding. -Uses `atob` if available, otherwise uses `Buffer` from `global`. If neither are available, returns the data as-is. - -## Parameters - -| Parameter | Type | -| --------- | -------- | -| `data` | `string` | - -## Returns - -`string` diff --git a/.typedoc/docs/shared/load-clerk-js-script.mdx b/.typedoc/docs/shared/load-clerk-js-script.mdx deleted file mode 100644 index 8efc3db1bc0..00000000000 --- a/.typedoc/docs/shared/load-clerk-js-script.mdx +++ /dev/null @@ -1,26 +0,0 @@ -Hotloads the Clerk JS script with robust failure detection. - -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 - -| Parameter | Type | Description | -| --------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -| `opts?` | `LoadClerkJsScriptOptions` | The options used to build the Clerk JS script URL and load the script. Must include a `publishableKey` if no existing script is found. | - -## Returns - -`Promise`\<null \| HTMLScriptElement\> — Promise that resolves with null if Clerk loads successfully, or rejects with an error. - -## Example - -```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/.typedoc/docs/shared/pages-or-infinite-options.mdx b/.typedoc/docs/shared/pages-or-infinite-options.mdx deleted file mode 100644 index c2a7ab7b9c4..00000000000 --- a/.typedoc/docs/shared/pages-or-infinite-options.mdx +++ /dev/null @@ -1,4 +0,0 @@ -| 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`. | diff --git a/.typedoc/docs/shared/paginated-hook-config.mdx b/.typedoc/docs/shared/paginated-hook-config.mdx deleted file mode 100644 index 99f8acfd945..00000000000 --- a/.typedoc/docs/shared/paginated-hook-config.mdx +++ /dev/null @@ -1,4 +0,0 @@ -| Name | Type | Description | -| ------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `infinite?` | `boolean` | If `true`, newly fetched data will be appended to the existing list rather than replacing it. Useful for implementing infinite scroll functionality. Defaults to `false`. | -| `keepPreviousData?` | `boolean` | If `true`, the previous data will be kept in the cache until new data is fetched. Defaults to `false`. | diff --git a/.typedoc/docs/shared/paginated-resources.mdx b/.typedoc/docs/shared/paginated-resources.mdx deleted file mode 100644 index a6608f7e55f..00000000000 --- a/.typedoc/docs/shared/paginated-resources.mdx +++ /dev/null @@ -1,17 +0,0 @@ -| Property | Type | Description | -| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `count` | `number` | The total count of data that exist remotely. | -| `data` | T[] | An array that contains the fetched data. For example, for the `memberships` attribute, data will be an array of [`OrganizationMembership`](/docs/references/javascript/types/organization-membership) objects. | -| `error` | null \| ClerkAPIResponseError | Clerk's API response error object. | -| `fetchNext` | () => void | A function that triggers the next page to be loaded. This is the same as `fetchPage(page => Math.min(pageCount, page + 1))`. | -| `fetchPage` | `ValueOrSetter`\<`number`\> | A function that triggers a specific page to be loaded. | -| `fetchPrevious` | () => void | A function that triggers the previous page to be loaded. This is the same as `fetchPage(page => Math.max(0, page - 1))`. | -| `hasNextPage` | `boolean` | A boolean that indicates if there are available pages to be fetched. | -| `hasPreviousPage` | `boolean` | A boolean that indicates if there are available pages to be fetched. | -| `isError` | `boolean` | A boolean that indicates the request failed. | -| `isFetching` | `boolean` | A boolean that is `true` if there is an ongoing request or a revalidation. | -| `isLoading` | `boolean` | A boolean that is `true` if there is an ongoing request and there is no fetched data. | -| `page` | `number` | The current page. | -| `pageCount` | `number` | The total amount of pages. It is calculated based on `count`, `initialPage`, and `pageSize`. | -| `revalidate` | () => Promise\ | A function that triggers a revalidation of the current page. | -| `setData` | `Infinite` _extends_ `true` ? `CacheSetter`\<(undefined \| [ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\)[]\> : `CacheSetter`\<undefined \| [ClerkPaginatedResponse](/docs/references/javascript/types/clerk-paginated-response)\\> | A function that allows you to set the data manually. | diff --git a/.typedoc/docs/shared/parse-publishable-key.mdx b/.typedoc/docs/shared/parse-publishable-key.mdx deleted file mode 100644 index 2c9e088ff79..00000000000 --- a/.typedoc/docs/shared/parse-publishable-key.mdx +++ /dev/null @@ -1,47 +0,0 @@ -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/.typedoc/docs/shared/read-json-file.mdx b/.typedoc/docs/shared/read-json-file.mdx deleted file mode 100644 index f97f1f5a6b4..00000000000 --- a/.typedoc/docs/shared/read-json-file.mdx +++ /dev/null @@ -1,14 +0,0 @@ -Read an expected JSON type File. - -Probably paired with: - - -## Parameters - -| Parameter | Type | -| --------- | ------ | -| `file` | `File` | - -## Returns - -`Promise`\<`unknown`\> diff --git a/.typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx b/.typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx deleted file mode 100644 index c0d014ec37b..00000000000 --- a/.typedoc/docs/shared/set-clerk-js-loading-error-package-name.mdx +++ /dev/null @@ -1,17 +0,0 @@ -Sets the package name for error messages during ClerkJS script loading. - -## Parameters - -| Parameter | Type | Description | -| ------------- | -------- | ------------------------------------------------------------------------------ | -| `packageName` | `string` | The name of the package to use in error messages (e.g., '@clerk/clerk-react'). | - -## Returns - -`void` - -## Example - -```typescript -setClerkJsLoadingErrorPackageName("@clerk/clerk-react"); -``` diff --git a/.typedoc/docs/shared/snake-to-camel.mdx b/.typedoc/docs/shared/snake-to-camel.mdx deleted file mode 100644 index b860d97abee..00000000000 --- a/.typedoc/docs/shared/snake-to-camel.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Converts a string from snake_case to camelCase. - -## Parameters - -| Parameter | Type | -| --------- | -------------------------------- | -| `str` | undefined \| string | - -## Returns - -`string` diff --git a/.typedoc/docs/shared/titleize.mdx b/.typedoc/docs/shared/titleize.mdx deleted file mode 100644 index 0a38d195916..00000000000 --- a/.typedoc/docs/shared/titleize.mdx +++ /dev/null @@ -1,17 +0,0 @@ -Converts the first character of a string to uppercase. - -## Parameters - -| Parameter | Type | Description | -| --------- | ---------------------------------------- | --------------------------- | -| `str` | undefined \| null \| string | The string to be converted. | - -## Returns - -`string` — The modified string with the rest of the string unchanged. - -## Example - -```ts -titleize("hello world"); // 'Hello world' -``` diff --git a/.typedoc/docs/shared/to-sentence.mdx b/.typedoc/docs/shared/to-sentence.mdx deleted file mode 100644 index ad4d413ed9d..00000000000 --- a/.typedoc/docs/shared/to-sentence.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Convert words to a sentence. - -## Parameters - -| Parameter | Type | Description | -| --------- | --------------------- | ------------------------------- | -| `items` | string[] | An array of words to be joined. | - -## Returns - -`string` — A string with the items joined by a comma and the last item joined by ", or". diff --git a/.typedoc/docs/shared/use-clerk.mdx b/.typedoc/docs/shared/use-clerk.mdx deleted file mode 100644 index 074e0243ca1..00000000000 --- a/.typedoc/docs/shared/use-clerk.mdx +++ /dev/null @@ -1,43 +0,0 @@ -> [!WARNING] -> This hook should only be used for advanced use cases, such as building a completely custom OAuth flow or as an escape hatch to access to the `Clerk` object. - -The `useClerk()` hook provides access to the [`Clerk`](/docs/references/javascript/clerk) object, allowing you to build alternatives to any Clerk Component. - -## Returns - -[Clerk](/docs/references/javascript/clerk) — The `useClerk()` hook returns the `Clerk` object, which includes all the methods and properties listed in the [`Clerk` reference](/docs/references/javascript/clerk). - -## Example - -The following example uses the `useClerk()` hook to access the `clerk` object. The `clerk` object is used to call the [`openSignIn()`](/docs/references/javascript/clerk#sign-in) method to open the sign-in modal. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useClerk } from "@clerk/clerk-react"; - -export default function Home() { - const clerk = useClerk(); - - return ; -} -``` - - - - -```tsx {{ filename: 'app/page.tsx' }} -"use client"; - -import { useClerk } from "@clerk/nextjs"; - -export default function HomePage() { - const clerk = useClerk(); - - return ; -} -``` - - - diff --git a/.typedoc/docs/shared/use-organization-list-params.mdx b/.typedoc/docs/shared/use-organization-list-params.mdx deleted file mode 100644 index 592db3abc4f..00000000000 --- a/.typedoc/docs/shared/use-organization-list-params.mdx +++ /dev/null @@ -1,5 +0,0 @@ -| Property | Type | Description | -| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `userInvitations?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: "expired" \| "revoked" \| "pending" \| "accepted"; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the invitations by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| -| `userMemberships?` | true \| \{ initialPage?: number; pageSize?: number; \} & object & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • Any of the properties described in [Shared properties](#shared-properties).
| -| `userSuggestions?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: "pending" \| "accepted" \| ("pending" \| "accepted")[]; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the suggestions by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| diff --git a/.typedoc/docs/shared/use-organization-list-return.mdx b/.typedoc/docs/shared/use-organization-list-return.mdx deleted file mode 100644 index a6d6a3dc742..00000000000 --- a/.typedoc/docs/shared/use-organization-list-return.mdx +++ /dev/null @@ -1,8 +0,0 @@ -| Property | Type | Description | -| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `createOrganization` | undefined \| ([CreateOrganizationParams](#create-organization-params)) => Promise\<[OrganizationResource](/docs/references/javascript/organization)\> | A function that returns a `Promise` which resolves to the newly created `Organization`. | -| `isLoaded` | `boolean` | A boolean that indicates whether Clerk has completed initialization and there is an authenticated user. Initially `false`, becomes `true` once Clerk loads with a user. | -| `setActive` | undefined \| ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session and/or organization. | -| `userInvitations` | PaginatedResourcesWithDefault\<[UserOrganizationInvitationResource](/docs/references/javascript/types/user-organization-invitation)\> \| [PaginatedResources](#paginated-resources)\<[UserOrganizationInvitationResource](/docs/references/javascript/types/user-organization-invitation), T\["userInvitations"\] _extends_ \{ infinite: true; \} ? true : false\> | Returns `PaginatedResources` which includes a list of the user's organization invitations. | -| `userMemberships` | PaginatedResourcesWithDefault\<[OrganizationMembershipResource](/docs/references/javascript/types/organization-membership)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationMembershipResource](/docs/references/javascript/types/organization-membership), T\["userMemberships"\] _extends_ \{ infinite: true; \} ? true : false\> | Returns `PaginatedResources` which includes a list of the user's organization memberships. | -| `userSuggestions` | PaginatedResourcesWithDefault\<[OrganizationSuggestionResource](/docs/references/javascript/types/organization-suggestion)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationSuggestionResource](/docs/references/javascript/types/organization-suggestion), T\["userSuggestions"\] _extends_ \{ infinite: true; \} ? true : false\> | Returns `PaginatedResources` which includes a list of suggestions for organizations that the user can join. | diff --git a/.typedoc/docs/shared/use-organization-list.mdx b/.typedoc/docs/shared/use-organization-list.mdx deleted file mode 100644 index ed93deaad06..00000000000 --- a/.typedoc/docs/shared/use-organization-list.mdx +++ /dev/null @@ -1,150 +0,0 @@ -The `useOrganizationList()` hook provides access to the current user's organization memberships, invitations, and suggestions. It also includes methods for creating new organizations and managing the active organization. - -## Parameters - -| Parameter | Type | -| --------- | ---- | -| `params?` | `T` | - -## Returns - -[`UseOrganizationListReturn`](use-organization-list-return.mdx)\<`T`\> - -## Examples - -### Expanding and paginating attributes - -To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. So by default, the `userMemberships`, `userInvitations`, and `userSuggestions` attributes are not populated. You must pass true or an object with the desired properties to fetch and paginate the data. - -```tsx -// userMemberships.data will never be populated -const { userMemberships } = useOrganizationList(); - -// Use default values to fetch userMemberships, such as initialPage = 1 and pageSize = 10 -const { userMemberships } = useOrganizationList({ - userMemberships: true, -}); - -// Pass your own values to fetch userMemberships -const { userMemberships } = useOrganizationList({ - userMemberships: { - pageSize: 20, - initialPage: 2, // skips the first page - }, -}); - -// Aggregate pages in order to render an infinite list -const { userMemberships } = useOrganizationList({ - userMemberships: { - infinite: true, - }, -}); -``` - -### Infinite pagination - -The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `userMemberships` attribute will be populated with the first page of the user's organization memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. - -```tsx {{ filename: 'src/components/JoinedOrganizations.tsx' }} -import { useOrganizationList } from "@clerk/clerk-react"; -import React from "react"; - -const JoinedOrganizations = () => { - const { isLoaded, setActive, userMemberships } = useOrganizationList({ - userMemberships: { - infinite: true, - }, - }); - - if (!isLoaded) { - return <>Loading; - } - - return ( - <> -
    - {userMemberships.data?.map((mem) => ( -
  • - {mem.organization.name} - -
  • - ))} -
- - - - ); -}; - -export default JoinedOrganizations; -``` - -### Simple pagination - -The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `userInvitations` attribute will be populated with the first page of invitations. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of invitations. - -Notice the difference between this example's pagination and the infinite pagination example above. - -```tsx {{ filename: 'src/components/UserInvitationsTable.tsx' }} -import { useOrganizationList } from "@clerk/clerk-react"; -import React from "react"; - -const UserInvitationsTable = () => { - const { isLoaded, userInvitations } = useOrganizationList({ - userInvitations: { - infinite: true, - keepPreviousData: true, - }, - }); - - if (!isLoaded || userInvitations.isLoading) { - return <>Loading; - } - - return ( - <> - - - - - - - - - - {userInvitations.data?.map((inv) => ( - - - - - ))} - -
EmailOrg name
{inv.emailAddress}{inv.publicOrganizationData.name}
- - - - - ); -}; - -export default UserInvitationsTable; -``` diff --git a/.typedoc/docs/shared/use-organization-params.mdx b/.typedoc/docs/shared/use-organization-params.mdx deleted file mode 100644 index cfbb1bca26d..00000000000 --- a/.typedoc/docs/shared/use-organization-params.mdx +++ /dev/null @@ -1,7 +0,0 @@ -| Property | Type | Description | -| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `domains?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ enrollmentMode?: "manual_invitation" \| "automatic_invitation" \| "automatic_suggestion"; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `enrollmentMode`: A string that filters the domains by the provided [enrollment mode](/docs/organizations/verified-domains#enrollment-mode).
  • Any of the properties described in [Shared properties](#shared-properties).
| -| `invitations?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: ("expired" \| "revoked" \| "pending" \| "accepted")[]; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the invitations by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| -| `membershipRequests?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ status?: "expired" \| "revoked" \| "pending" \| "accepted"; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `status`: A string that filters the membership requests by the provided status.
  • Any of the properties described in [Shared properties](#shared-properties).
| -| `memberships?` | true \| \{ initialPage?: number; pageSize?: number; \} & \{ query?: string; role?: string[]; \} & \{ infinite?: boolean; keepPreviousData?: boolean; \} | If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `role`: An array of [`OrganizationCustomRoleKey`](/docs/references/javascript/types/organization-custom-role-key).
  • `query`: A string that filters the memberships by the provided string.
  • Any of the properties described in [Shared properties](#shared-properties).
| -| `subscriptions?` | true \| \{ initialPage?: number; pageSize?: number; \} & object & \{ orgId?: string; \} & \{ infinite?: boolean; keepPreviousData?: 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. If set to `true`, all default properties will be used.
Otherwise, accepts an object with the following optional properties:
  • `orgId`: A string that filters the subscriptions by the provided organization ID.
  • Any of the properties described in [Shared properties](#shared-properties).
| diff --git a/.typedoc/docs/shared/use-organization-return.mdx b/.typedoc/docs/shared/use-organization-return.mdx deleted file mode 100644 index db16c2a130b..00000000000 --- a/.typedoc/docs/shared/use-organization-return.mdx +++ /dev/null @@ -1,10 +0,0 @@ -| Property | Type | Description | -| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `domains` | null \| PaginatedResourcesWithDefault\<[OrganizationDomainResource](/docs/references/javascript/types/organization-domain)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationDomainResource](/docs/references/javascript/types/organization-domain), T\["membershipRequests"\] _extends_ \{ infinite: true; \} ? true : false\> | Includes a paginated list of the organization's domains. | -| `invitations` | null \| PaginatedResourcesWithDefault\<[OrganizationInvitationResource](/docs/references/javascript/types/organization-invitation)\> \| [PaginatedResources](#paginated-resources)\<[OrganizationInvitationResource](/docs/references/javascript/types/organization-invitation), T\["invitations"\] _extends_ \{ infinite: true; \} ? true : false\> | Includes a paginated list of the organization's invitations. | -| `isLoaded` | `boolean` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `membership` | undefined \| null \| [OrganizationMembershipResource](/docs/references/javascript/types/organization-membership) | The current organization membership. | -| `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\<[CommerceSubscriptionItemResource](/docs/references/javascript/types/commerce-subscription-item-resource)\> \| [PaginatedResources](#paginated-resources)\<[CommerceSubscriptionItemResource](/docs/references/javascript/types/commerce-subscription-item-resource), 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/.typedoc/docs/shared/use-organization.mdx b/.typedoc/docs/shared/use-organization.mdx deleted file mode 100644 index bb92bf55245..00000000000 --- a/.typedoc/docs/shared/use-organization.mdx +++ /dev/null @@ -1,130 +0,0 @@ -The `useOrganization()` hook retrieves attributes of the currently active organization. - -## Parameters - -| Parameter | Type | -| --------- | ---- | -| `params?` | `T` | - -## Returns - -[`UseOrganizationReturn`](use-organization-return.mdx)\<`T`\> - -## Examples - -### Expand and paginate attributes - -To keep network usage to a minimum, developers are required to opt-in by specifying which resource they need to fetch and paginate through. By default, the `memberships`, `invitations`, `membershipRequests`, and `domains` attributes are not populated. You must pass `true` or an object with the desired properties to fetch and paginate the data. - -```tsx -// invitations.data will never be populated. -const { invitations } = useOrganization(); - -// Use default values to fetch invitations, such as initialPage = 1 and pageSize = 10 -const { invitations } = useOrganization({ - invitations: true, -}); - -// Pass your own values to fetch invitations -const { invitations } = useOrganization({ - invitations: { - pageSize: 20, - initialPage: 2, // skips the first page - }, -}); - -// Aggregate pages in order to render an infinite list -const { invitations } = useOrganization({ - invitations: { - infinite: true, - }, -}); -``` - -### Infinite pagination - -The following example demonstrates how to use the `infinite` property to fetch and append new data to the existing list. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Load more" button is clicked, the `fetchNext` helper function will be called to append the next page of memberships to the list. - -```tsx -import { useOrganization } from '@clerk/clerk-react' - -export default function MemberList() { - const { memberships } = useOrganization({ - memberships: { - infinite: true, // Append new data to the existing list - keepPreviousData: true, // Persist the cached data until the new data has been fetched - }, - }) - - if (!memberships) { - // Handle loading state - return null - } - - return ( -
-

Organization members

-
    - {memberships.data?.map((membership) => ( -
  • - {membership.publicUserData.firstName} {membership.publicUserData.lastName} < - {membership.publicUserData.identifier}> :: {membership.role} -
  • - ))} -
- - -
- ) -} -``` - -### Simple pagination - -The following example demonstrates how to use the `fetchPrevious` and `fetchNext` helper functions to paginate through the data. The `memberships` attribute will be populated with the first page of the organization's memberships. When the "Previous page" or "Next page" button is clicked, the `fetchPrevious` or `fetchNext` helper function will be called to fetch the previous or next page of memberships. - -Notice the difference between this example's pagination and the infinite pagination example above. - -```tsx -import { useOrganization } from '@clerk/clerk-react' - -export default function MemberList() { - const { memberships } = useOrganization({ - memberships: { - keepPreviousData: true, // Persist the cached data until the new data has been fetched - }, - }) - - if (!memberships) { - // Handle loading state - return null - } - - return ( -
-

Organization members

-
    - {memberships.data?.map((membership) => ( -
  • - {membership.publicUserData.firstName} {membership.publicUserData.lastName} < - {membership.publicUserData.identifier}> :: {membership.role} -
  • - ))} -
- - - - -
- ) -} -``` diff --git a/.typedoc/docs/shared/use-reverification.mdx b/.typedoc/docs/shared/use-reverification.mdx deleted file mode 100644 index f307df52533..00000000000 --- a/.typedoc/docs/shared/use-reverification.mdx +++ /dev/null @@ -1,55 +0,0 @@ -> [!WARNING] -> -> Depending on the SDK you're using, this feature requires `@clerk/nextjs@6.12.7` or later, `@clerk/clerk-react@5.25.1` or later, and `@clerk/clerk-js@5.57.1` or later. - -The `useReverification()` hook is used to handle a session's reverification flow. If a request requires reverification, a modal will display, prompting the user to verify their credentials. Upon successful verification, the original request will automatically retry. - -## Parameters - -| Parameter | Type | -| ---------- | --------- | -| `fetcher` | `Fetcher` | -| `options?` | `Options` | - -## Returns - -`UseReverificationResult`\<`Fetcher`\> — The `useReverification()` hook returns an array with the "enhanced" fetcher. - -## Example - -### Handle cancellation of the reverification process - -The following example demonstrates how to handle scenarios where a user cancels the reverification flow, such as closing the modal, which might result in `myData` being `null`. - -In the following example, `myFetcher` would be a function in your backend that fetches data from the route that requires reverification. See the [guide on how to require reverification](/docs/guides/reverification) for more information. - -```tsx {{ filename: 'src/components/MyButton.tsx' }} -import { useReverification } from "@clerk/clerk-react"; -import { isReverificationCancelledError } from "@clerk/clerk-react/error"; - -type MyData = { - balance: number; -}; - -export function MyButton() { - const fetchMyData = () => - fetch("/api/balance").then((res) => res.json() as Promise); - const enhancedFetcher = useReverification(fetchMyData); - - const handleClick = async () => { - try { - const myData = await enhancedFetcher(); - // ^ is types as `MyData` - } catch (e) { - // Handle error returned from the fetcher here - - // You can also handle cancellation with the following - if (isReverificationCancelledError(err)) { - // Handle the cancellation error here - } - } - }; - - return ; -} -``` diff --git a/.typedoc/docs/shared/use-session-list.mdx b/.typedoc/docs/shared/use-session-list.mdx deleted file mode 100644 index 6602a87d186..00000000000 --- a/.typedoc/docs/shared/use-session-list.mdx +++ /dev/null @@ -1,77 +0,0 @@ -The `useSessionList()` hook returns an array of [`Session`](/docs/references/javascript/session) objects that have been registered on the client device. - -## 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. - - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `sessions` | `undefined` | A list of sessions that have been registered on the client device. | -| `setActive` | `undefined` | A function that sets the active session and/or organization. | - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `true` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `sessions` | [SessionResource](/docs/references/javascript/session)[] | A list of sessions that have been registered on the client device. | -| `setActive()` | ([setActiveParams](/docs/references/javascript/types/set-active-params)) => Promise\ | A function that sets the active session and/or organization. | - - - -## Example - -### Get a list of sessions - -The following example uses `useSessionList()` to get a list of sessions that have been registered on the client device. The `sessions` property is used to show the number of times the user has visited the page. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useSessionList } from "@clerk/clerk-react"; - -export default function Home() { - const { isLoaded, sessions } = useSessionList(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return ( -
-

Welcome back. You've been here {sessions.length} times before.

-
- ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -"use client"; - -import { useSessionList } from "@clerk/nextjs"; - -export default function HomePage() { - const { isLoaded, sessions } = useSessionList(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - return ( -
-

Welcome back. You've been here {sessions.length} times before.

-
- ); -} -``` - -
-
diff --git a/.typedoc/docs/shared/use-session.mdx b/.typedoc/docs/shared/use-session.mdx deleted file mode 100644 index 1abbc16b9b6..00000000000 --- a/.typedoc/docs/shared/use-session.mdx +++ /dev/null @@ -1,98 +0,0 @@ -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. - -## 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. - - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `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 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 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` | `boolean` | A boolean that indicates whether a user is currently signed in. | -| `session` | [`SignedInSessionResource`](/docs/references/javascript/session) | The current session for the user. | - - - -## Example - -### Access the `Session` object - -The following example uses the `useSession()` hook to access the `Session` object, which has the `lastActiveAt` property. The `lastActiveAt` property is a `Date` object used to show the time the session was last active. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useSession } from "@clerk/clerk-react"; - -export default function Home() { - const { isLoaded, session, isSignedIn } = useSession(); - - if (!isLoaded) { - // Handle loading state - return null; - } - if (!isSignedIn) { - // Handle signed out state - return null; - } - - return ( -
-

- This session has been active since{" "} - {session.lastActiveAt.toLocaleString()} -

-
- ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -"use client"; - -import { useSession } from "@clerk/nextjs"; - -export default function HomePage() { - const { isLoaded, session, isSignedIn } = useSession(); - - if (!isLoaded) { - // Handle loading state - return null; - } - if (!isSignedIn) { - // Handle signed out state - return null; - } - - return ( -
-

- This session has been active since{" "} - {session.lastActiveAt.toLocaleString()} -

-
- ); -} -``` - -
-
diff --git a/.typedoc/docs/shared/use-user.mdx b/.typedoc/docs/shared/use-user.mdx deleted file mode 100644 index a89b31c4fae..00000000000 --- a/.typedoc/docs/shared/use-user.mdx +++ /dev/null @@ -1,211 +0,0 @@ -The `useUser()` hook provides access to the current user's [`User`](/docs/references/javascript/user) object, which contains all the data for a single user in your application and provides methods to manage their account. This hook also allows you to check if the user is signed in and if Clerk has loaded and initialized. - -## 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. - - - -| Name | Type | Description | -| ------ | ------ | ------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `isSignedIn` | `undefined` | A boolean that returns `true` if the user is signed in. | -| `user` | `undefined` | The `User` object for the current 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 returns `true` if the user is signed in. | -| `user` | `null` | The `User` object for the current 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 returns `true` if the user is signed in. | -| `user` | [`UserResource`](/docs/references/javascript/user) | The `User` object for the current user. | - - - -## Examples - -### Get the current user - -The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which contains the current user's data such as their full name. The `isLoaded` and `isSignedIn` properties are used to handle the loading state and to check if the user is signed in, respectively. - -```tsx {{ filename: 'src/Example.tsx' }} -export default function Example() { - const { isSignedIn, user, isLoaded } = useUser(); - - if (!isLoaded) { - return
Loading...
; - } - - if (!isSignedIn) { - return
Sign in to view this page
; - } - - return
Hello {user.firstName}!
; -} -``` - -### Update user data - -The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`update()`](/docs/references/javascript/user#update) method to update the current user's information. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useUser } from "@clerk/clerk-react"; - -export default function Home() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - await user.update({ - firstName: "John", - lastName: "Doe", - }); - }; - - return ( - <> - -

user.firstName: {user?.firstName}

-

user.lastName: {user?.lastName}

- - ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -"use client"; - -import { useUser } from "@clerk/nextjs"; - -export default function HomePage() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - await user.update({ - firstName: "John", - lastName: "Doe", - }); - }; - - return ( - <> - -

user.firstName: {user?.firstName}

-

user.lastName: {user?.lastName}

- - ); -} -``` - -
-
- -### Reload user data - -The following example uses the `useUser()` hook to access the [`User`](/docs/references/javascript/user) object, which calls the [`reload()`](/docs/references/javascript/user#reload) method to get the latest user's information. - - - - -```tsx {{ filename: 'src/Home.tsx' }} -import { useUser } from "@clerk/clerk-react"; - -export default function Home() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - // Update data via an API endpoint - const updateMetadata = await fetch("/api/updateMetadata"); - - // Check if the update was successful - if (updateMetadata.message !== "success") { - throw new Error("Error updating"); - } - - // If the update was successful, reload the user data - await user.reload(); - }; - - return ( - <> - -

user role: {user?.publicMetadata.role}

- - ); -} -``` - -
- - -```tsx {{ filename: 'app/page.tsx' }} -"use client"; - -import { useUser } from "@clerk/nextjs"; - -export default function HomePage() { - const { isLoaded, user } = useUser(); - - if (!isLoaded) { - // Handle loading state - return null; - } - - if (!user) return null; - - const updateUser = async () => { - // Update data via an API endpoint - const updateMetadata = await fetch("/api/updateMetadata"); - - // Check if the update was successful - if (updateMetadata.message !== "success") { - throw new Error("Error updating"); - } - - // If the update was successful, reload the user data - await user.reload(); - }; - - return ( - <> - -

user role: {user?.publicMetadata.role}

- - ); -} -``` - -
-
diff --git a/.typedoc/docs/shared/user-agent-is-robot.mdx b/.typedoc/docs/shared/user-agent-is-robot.mdx deleted file mode 100644 index fada624f70e..00000000000 --- a/.typedoc/docs/shared/user-agent-is-robot.mdx +++ /dev/null @@ -1,11 +0,0 @@ -Checks if the user agent is a bot. - -## Parameters - -| Parameter | Type | Description | -| ----------- | -------- | --------------------- | -| `userAgent` | `string` | Any user agent string | - -## Returns - -`boolean` diff --git a/.typedoc/docs/shared/version-selector.mdx b/.typedoc/docs/shared/version-selector.mdx deleted file mode 100644 index f40c7058ab1..00000000000 --- a/.typedoc/docs/shared/version-selector.mdx +++ /dev/null @@ -1,17 +0,0 @@ -This version selector is a bit complicated, so here is the flow: - -1. Use the clerkJSVersion prop on the provider -2. Use the exact `@clerk/clerk-js` version if it is a `@snapshot` prerelease -3. Use the prerelease tag of `@clerk/clerk-js` or the packageVersion provided -4. Fallback to the major version of `@clerk/clerk-js` or the packageVersion provided - -## Parameters - -| Parameter | Type | Description | -| ---------------- | -------------------------------- | ----------------------------------------------------------------------------------------- | -| `clerkJSVersion` | undefined \| string | The optional clerkJSVersion prop on the provider | -| `packageVersion` | `string` | The version of `@clerk/clerk-js` that will be used if an explicit version is not provided | - -## Returns - -`string` — The npm tag, version or major version to use diff --git a/.typedoc/docs/types/act-claim.mdx b/.typedoc/docs/types/act-claim.mdx deleted file mode 100644 index 3de8a4c99a4..00000000000 --- a/.typedoc/docs/types/act-claim.mdx +++ /dev/null @@ -1 +0,0 @@ -JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). diff --git a/.typedoc/docs/types/act-jwt-claim.mdx b/.typedoc/docs/types/act-jwt-claim.mdx deleted file mode 100644 index 33ad615eb64..00000000000 --- a/.typedoc/docs/types/act-jwt-claim.mdx +++ /dev/null @@ -1,5 +0,0 @@ -JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). - -## Deprecated - -Use `ActClaim` instead. diff --git a/.typedoc/docs/types/active-session-resource.mdx b/.typedoc/docs/types/active-session-resource.mdx deleted file mode 100644 index ea2985b809f..00000000000 --- a/.typedoc/docs/types/active-session-resource.mdx +++ /dev/null @@ -1,33 +0,0 @@ -Represents a session resource that has completed all pending tasks -and authentication factors - -## Properties - -| Property | Type | Description | Overrides | -| ---------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `end` | () => Promise\<[SessionResource](/docs/references/javascript/session)\> | Marks the session as ended. The session will no longer be active for this `Client` and its status will become **ended**. | - | -| `factorVerificationAge` | null \| \[number, number\] | An array where each item represents the number of minutes since the last verification of a first or second factor: `[firstFactorAge, secondFactorAge]`. | - | -| `id` | `string` | The unique identifier for the session. | - | -| `pathRoot` | `string` | The root path of the resource. | - | -| `status` | `"active"` | The current state of the session. | [`SessionResource`](/docs/references/javascript/session).[`status`](/docs/references/javascript/session#status) | -| `user` | [`UserResource`](/docs/references/javascript/user) | The user associated with the session. | [`SessionResource`](/docs/references/javascript/session).[`user`](/docs/references/javascript/session#user) | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`ActiveSessionResource`\> - -#### Inherited from - -[`SessionResource`](/docs/references/javascript/session).[`reload`](/docs/references/javascript/session#reload) diff --git a/.typedoc/docs/types/add-payment-source-params.mdx b/.typedoc/docs/types/add-payment-source-params.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/add-payment-source-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/cancel-subscription-params.mdx b/.typedoc/docs/types/cancel-subscription-params.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/cancel-subscription-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/check-authorization-fn.mdx b/.typedoc/docs/types/check-authorization-fn.mdx deleted file mode 100644 index cbec4ba71ef..00000000000 --- a/.typedoc/docs/types/check-authorization-fn.mdx +++ /dev/null @@ -1,9 +0,0 @@ -## Parameters - -| Parameter | Type | -| -------------------- | -------- | -| `isAuthorizedParams` | `Params` | - -## Returns - -`boolean` diff --git a/.typedoc/docs/types/check-authorization-from-session-claims.mdx b/.typedoc/docs/types/check-authorization-from-session-claims.mdx deleted file mode 100644 index f7357cd71cb..00000000000 --- a/.typedoc/docs/types/check-authorization-from-session-claims.mdx +++ /dev/null @@ -1,13 +0,0 @@ -Type guard for server-side authorization checks using session claims. -System permissions are not allowed since they are not included -in session claims and cannot be verified on the server side. - -## Parameters - -| Parameter | Type | -| -------------------- | -------------------------------------------------------------------------------------------------------- | -| `isAuthorizedParams` | [`CheckAuthorizationParamsFromSessionClaims`](check-authorization-params-from-session-claims.mdx)\<`P`\> | - -## Returns - -`boolean` diff --git a/.typedoc/docs/types/check-authorization-params-from-session-claims.mdx b/.typedoc/docs/types/check-authorization-params-from-session-claims.mdx deleted file mode 100644 index 5299e174317..00000000000 --- a/.typedoc/docs/types/check-authorization-params-from-session-claims.mdx +++ /dev/null @@ -1,9 +0,0 @@ -## Properties - -| Property | Type | Description | -| --------------------------------------------- | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -| `feature?` | `Autocomplete`\< user:${string} \| org:${string} \> | The [feature](/docs/billing/overview) to check for. | -| `permission?` | `DisallowSystemPermissions`\<`P`\> | The [permission](/docs/organizations/roles-permissions) to check for. | -| `plan?` | `Autocomplete`\< user:${string} \| org:${string} \> | The [plan](/docs/billing/overview) to check for. | -| `reverification?` | [`ReverificationConfig`](reverification-config.mdx) | The reverification configuration to check for. This feature is currently in public beta. **It is not recommended for production use.** | -| `role?` | `string` | The [role](/docs/organizations/roles-permissions) to check for. | diff --git a/.typedoc/docs/types/check-authorization-with-custom-permissions.mdx b/.typedoc/docs/types/check-authorization-with-custom-permissions.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/clerk-api-error.mdx b/.typedoc/docs/types/clerk-api-error.mdx deleted file mode 100644 index 63a5b74ea7b..00000000000 --- a/.typedoc/docs/types/clerk-api-error.mdx +++ /dev/null @@ -1,24 +0,0 @@ -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[]; 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/.typedoc/docs/types/clerk-api-response-error.mdx b/.typedoc/docs/types/clerk-api-response-error.mdx deleted file mode 100644 index b2f65c266de..00000000000 --- a/.typedoc/docs/types/clerk-api-response-error.mdx +++ /dev/null @@ -1 +0,0 @@ -Interface representing a Clerk API Response Error. diff --git a/.typedoc/docs/types/clerk-host-router.mdx b/.typedoc/docs/types/clerk-host-router.mdx deleted file mode 100644 index c94fdb43453..00000000000 --- a/.typedoc/docs/types/clerk-host-router.mdx +++ /dev/null @@ -1 +0,0 @@ -This type represents a generic router interface that Clerk relies on to interact with the host router. diff --git a/.typedoc/docs/types/clerk-jwt-claims.mdx b/.typedoc/docs/types/clerk-jwt-claims.mdx deleted file mode 100644 index 4aab45ad6c6..00000000000 --- a/.typedoc/docs/types/clerk-jwt-claims.mdx +++ /dev/null @@ -1,28 +0,0 @@ -Clerk-issued JWT payload - -## Deprecated - -Use `JwtPayload` instead. - -## Indexable - -\[`propName`: `string`\]: `unknown` - -Any other JWT Claim Set member. - -## Properties - -| Property | Type | Description | -| ------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| ~~`act?`~~ | \{ [x: string]: unknown; sub: string; \} | JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). | -| `act.sub` | `string` | - | -| ~~`azp?`~~ | `string` | JWT Authorized party - [RFC7800#section-3](https://tools.ietf.org/html/rfc7800#section-3). | -| ~~`exp`~~ | `number` | JWT Expiration Time - [RFC7519#section-4.1.4](https://tools.ietf.org/html/rfc7519#section-4.1.4). | -| ~~`iat`~~ | `number` | JWT Issued At - [RFC7519#section-4.1.6](https://tools.ietf.org/html/rfc7519#section-4.1.6). | -| ~~`iss`~~ | `string` | JWT Issuer - [RFC7519#section-4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1). | -| ~~`nbf`~~ | `number` | JWT Not Before - [RFC7519#section-4.1.5](https://tools.ietf.org/html/rfc7519#section-4.1.5). | -| ~~`org_id?`~~ | `string` | Active organization ID. | -| ~~`org_role?`~~ | `string` | Active organization role. | -| ~~`org_slug?`~~ | `string` | Active organization slug. | -| ~~`sid`~~ | `string` | Session ID | -| ~~`sub`~~ | `string` | JWT Subject - [RFC7519#section-4.1.2](https://tools.ietf.org/html/rfc7519#section-4.1.2). | diff --git a/.typedoc/docs/types/clerk-paginated-response.mdx b/.typedoc/docs/types/clerk-paginated-response.mdx deleted file mode 100644 index bd31a7df330..00000000000 --- a/.typedoc/docs/types/clerk-paginated-response.mdx +++ /dev/null @@ -1,11 +0,0 @@ -An interface that describes the response of a method that returns a paginated list of resources. - -> [!TIP] -> Clerk's SDKs always use `Promise>`. If the promise resolves, you will get back the properties. If the promise is rejected, you will receive a `ClerkAPIResponseError` or network error. - -## Properties - -| Property | Type | Description | -| -------------------------------------- | ---------------- | -------------------------------------------- | -| `data` | T[] | An array that contains the fetched data. | -| `total_count` | `number` | The total count of data that exist remotely. | diff --git a/.typedoc/docs/types/clerk-pagination-params.mdx b/.typedoc/docs/types/clerk-pagination-params.mdx deleted file mode 100644 index 70057fdc8c9..00000000000 --- a/.typedoc/docs/types/clerk-pagination-params.mdx +++ /dev/null @@ -1,6 +0,0 @@ -## Properties - -| 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`. | diff --git a/.typedoc/docs/types/clerk-pagination-request.mdx b/.typedoc/docs/types/clerk-pagination-request.mdx deleted file mode 100644 index e7b59556cc0..00000000000 --- a/.typedoc/docs/types/clerk-pagination-request.mdx +++ /dev/null @@ -1,8 +0,0 @@ -Pagination params in request - -## Type declaration - -| Name | Type | Description | -| --------- | -------- | ---------------------------------------------------- | -| `limit?` | `number` | Maximum number of items returned per request. | -| `offset?` | `number` | This is the starting point for your fetched results. | diff --git a/.typedoc/docs/types/clerk-resource.mdx b/.typedoc/docs/types/clerk-resource.mdx deleted file mode 100644 index 639c609d8c0..00000000000 --- a/.typedoc/docs/types/clerk-resource.mdx +++ /dev/null @@ -1,24 +0,0 @@ -Defines common properties and methods that all Clerk resources must implement. - -## Properties - -| Property | Type | Description | -| -------------------------------- | -------- | -------------------------------------- | -| `id?` | `string` | The unique identifier of the resource. | -| `pathRoot` | `string` | The root path of the resource. | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`ClerkResource`\> diff --git a/.typedoc/docs/types/clerk-status.mdx b/.typedoc/docs/types/clerk-status.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/clerk.mdx b/.typedoc/docs/types/clerk.mdx deleted file mode 100644 index fff118bd1d0..00000000000 --- a/.typedoc/docs/types/clerk.mdx +++ /dev/null @@ -1,332 +0,0 @@ -Main Clerk SDK object. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `__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_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` | `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`](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. | -| `closeOrganizationProfile` | () => void | Closes the Clerk OrganizationProfile modal. | -| `closeSignIn` | () => void | Closes the Clerk SignIn modal. | -| `closeSignUp` | () => void | Closes the Clerk SignUp modal. | -| `closeUserProfile` | () => void | Closes the Clerk UserProfile modal. | -| `closeWaitlist` | () => void | Closes the Clerk Waitlist modal. | -| `createOrganization` | (params) => Promise\<[OrganizationResource](/docs/references/javascript/organization)\> | Creates an organization, adding the current user as admin. | -| `domain` | `string` | Clerk Satellite Frontend API string. | -| `getOrganization` | (organizationId) => Promise\<[OrganizationResource](/docs/references/javascript/organization)\> | Retrieves a single organization by id. | -| `handleEmailLinkVerification` | (params, customNavigate?) => Promise\ | Completes a Email Link flow started by Clerk.client.signIn.createEmailLinkFlow or Clerk.client.signUp.createEmailLinkFlow | -| `handleGoogleOneTapCallback` | (signInOrUp, params, customNavigate?) => Promise\ | Completes a Google One Tap redirection flow started by [Clerk.authenticateWithGoogleOneTap](#authenticatewithgoogleonetap) | -| `handleRedirectCallback` | (params, customNavigate?) => Promise\ | Completes an OAuth or SAML redirection flow started by Clerk.client.signIn.authenticateWithRedirect or Clerk.client.signUp.authenticateWithRedirect | -| `handleUnauthenticated` | () => Promise\ | Handles a 401 response from Frontend API by refreshing the client and session object accordingly | -| `instanceType` | undefined \| InstanceType | Clerk Instance type is defined from the Publishable key | -| `isSatellite` | `boolean` | Clerk Flag for satellite apps. | -| `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. | -| `mountOrganizationSwitcher` | (targetNode, props?) => void | Mount an organization switcher component at the target element. | -| `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. | -| `navigate` | `CustomNavigation` | Function used to commit a navigation after certain steps in the Clerk processes. | -| `off` | `OffEventListener` | Removes an event handler for a specific Clerk event. **Param** The event name to unsubscribe from **Param** The callback function to remove | -| `on` | `OnEventListener` | Registers an event handler for a specific Clerk event. **Param** The event name to subscribe to **Param** The callback function to execute when the event is dispatched **Param** Optional configuration object **Param** If true and the event was previously dispatched, handler will be called immediately with the latest payload | -| `openCreateOrganization` | (props?) => void | Opens the Clerk CreateOrganization modal. | -| `openGoogleOneTap` | (props?) => void | Opens the Google One Tap component. | -| `openOrganizationProfile` | (props?) => void | Opens the Clerk OrganizationProfile modal. | -| `openSignIn` | (props?) => void | Opens the Clerk SignIn component in a modal. | -| `openSignUp` | (props?) => void | Opens the Clerk SignUp component in a modal. | -| `openUserProfile` | (props?) => void | Opens the Clerk UserProfile modal. | -| `openWaitlist` | (props?) => void | Opens the Clerk Waitlist modal. | -| `organization` | undefined \| null \| [OrganizationResource](/docs/references/javascript/organization) | Active Organization | -| `proxyUrl` | undefined \| string | Clerk Proxy url string. | -| `publishableKey` | `string` | Clerk Publishable Key string. | -| `redirectToAfterSignIn` | () => void | Redirects to the configured afterSignIn URL. | -| `redirectToAfterSignOut` | () => void | Redirects to the configured afterSignOut URL. | -| `redirectToAfterSignUp` | () => void | Redirects to the configured afterSignUp URL. | -| `redirectToCreateOrganization` | () => Promise\ | Redirects to the configured URL where `` is mounted. | -| `redirectToOrganizationProfile` | () => Promise\ | Redirects to the configured URL where `` is mounted. | -| `redirectToUserProfile` | () => Promise\ | Redirects to the configured URL where `` is mounted. | -| `redirectToWaitlist` | () => void | Redirects to the configured URL where `` is mounted. | -| `sdkMetadata` | undefined \| \{ environment?: string; name: string; version: string; \} | If present, contains information about the SDK that the host application is using. For example, if Clerk is loaded through `@clerk/nextjs`, this would be `{ name: '@clerk/nextjs', version: '1.0.0' }` | -| `session` | undefined \| null \| [SignedInSessionResource](/docs/references/javascript/session) | Current Session. | -| `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. | -| `unmountOrganizationSwitcher` | (targetNode) => void | Unmount the organization profile component from the target node.\* | -| `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. | -| `user` | undefined \| null \| [UserResource](/docs/references/javascript/user) | Current User. | -| `version` | undefined \| string | Clerk SDK version number. | - -## Methods - -### buildAfterMultiSessionSingleSignOutUrl() - -Returns the configured afterMultiSessionSingleSignOutUrl of the instance. - -#### Returns - -`string` - ---- - -### buildAfterSignInUrl() - -Returns the configured afterSignInUrl of the instance. - -#### Parameters - -| Parameter | Type | -| --------------------------- | -------------------------------------------- | -| `__namedParameters?` | \{ params?: URLSearchParams; \} | -| `__namedParameters.params?` | `URLSearchParams` | - -#### Returns - -`string` - ---- - -### buildAfterSignOutUrl() - -Returns the configured afterSignOutUrl of the instance. - -#### Returns - -`string` - ---- - -### buildAfterSignUpUrl() - -Returns the configured afterSignInUrl of the instance. - -#### Parameters - -| Parameter | Type | -| --------------------------- | -------------------------------------------- | -| `__namedParameters?` | \{ params?: URLSearchParams; \} | -| `__namedParameters.params?` | `URLSearchParams` | - -#### Returns - -`string` - ---- - -### buildCreateOrganizationUrl() - -Returns the configured url where `` is mounted or a custom create-organization page is rendered. - -#### Returns - -`string` - ---- - -### buildNewSubscriptionRedirectUrl() - -Returns the configured newSubscriptionRedirectUrl of the instance. - -#### Returns - -`string` - ---- - -### buildOrganizationProfileUrl() - -Returns the configured url where `` is mounted or a custom organization-profile page is rendered. - -#### Returns - -`string` - ---- - -### buildSignInUrl() - -Returns the configured url where `` is mounted or a custom sign-in page is rendered. - -#### Parameters - -| Parameter | Type | Description | -| --------- | ----------------------------------------- | ------------------------------------------------ | -| `opts?` | [`RedirectOptions`](redirect-options.mdx) | A [RedirectOptions](redirect-options.mdx) object | - -#### Returns - -`string` - ---- - -### buildSignUpUrl() - -Returns the configured url where `` is mounted or a custom sign-up page is rendered. - -#### Parameters - -| Parameter | Type | Description | -| --------- | ----------------------------------------- | ------------------------------------------------ | -| `opts?` | [`RedirectOptions`](redirect-options.mdx) | A [RedirectOptions](redirect-options.mdx) object | - -#### Returns - -`string` - ---- - -### buildTasksUrl() - -Returns the configured url where tasks are mounted. - -#### Returns - -`string` - ---- - -### buildUrlWithAuth() - -Decorates the provided url with the auth token for development instances. - -#### Parameters - -| Parameter | Type | -| --------- | -------- | -| `to` | `string` | - -#### Returns - -`string` - ---- - -### buildUserProfileUrl() - -Returns the url where `` is mounted or a custom user-profile page is rendered. - -#### Returns - -`string` - ---- - -### buildWaitlistUrl() - -Returns the configured url where `` is mounted or a custom waitlist page is rendered. - -#### Parameters - -| Parameter | Type | -| --------------------- | ------------------------------------------------------------ | -| `opts?` | \{ initialValues?: Record\; \} | -| `opts.initialValues?` | `Record`\<`string`, `string`\> | - -#### Returns - -`string` - ---- - -### redirectToSignIn() - -Redirects to the configured URL where `` is mounted. - -#### Parameters - -| Parameter | Type | Description | -| --------- | ----------------------- | ------------------------------------------------ | -| `opts?` | `SignInRedirectOptions` | A [RedirectOptions](redirect-options.mdx) object | - -#### Returns - -`Promise`\<`unknown`\> - ---- - -### redirectToSignUp() - -Redirects to the configured URL where `` is mounted. - -#### Parameters - -| Parameter | Type | Description | -| --------- | ----------------------- | ------------------------------------------------ | -| `opts?` | `SignUpRedirectOptions` | A [RedirectOptions](redirect-options.mdx) object | - -#### Returns - -`Promise`\<`unknown`\> - ---- - -### redirectToTasks() - -Redirects to the configured URL where tasks are mounted. - -#### Parameters - -| Parameter | Type | Description | -| --------- | ---------------------- | ------------------------------------------------ | -| `opts?` | `TasksRedirectOptions` | A [RedirectOptions](redirect-options.mdx) object | - -#### Returns - -`Promise`\<`unknown`\> - ---- - -### redirectWithAuth() - -Redirects to the provided url after decorating it with the auth token for development instances. - -#### Parameters - -| Parameter | Type | -| --------- | -------- | -| `to` | `string` | - -#### Returns - -`Promise`\<`unknown`\> diff --git a/.typedoc/docs/types/commerce-billing-namespace.mdx b/.typedoc/docs/types/commerce-billing-namespace.mdx deleted file mode 100644 index eed40191201..00000000000 --- a/.typedoc/docs/types/commerce-billing-namespace.mdx +++ /dev/null @@ -1,24 +0,0 @@ -**`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](/docs/references/javascript/types/commerce-subscription-item-resource)\>\> | **`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/.typedoc/docs/types/commerce-checkout-json.mdx b/.typedoc/docs/types/commerce-checkout-json.mdx deleted file mode 100644 index d320ff1e02f..00000000000 --- a/.typedoc/docs/types/commerce-checkout-json.mdx +++ /dev/null @@ -1,27 +0,0 @@ -**`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`** | - | -| `free_trial_ends_at?` | null \| number | **`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/.typedoc/docs/types/commerce-checkout-resource.mdx b/.typedoc/docs/types/commerce-checkout-resource.mdx deleted file mode 100644 index c4e8c703a7c..00000000000 --- a/.typedoc/docs/types/commerce-checkout-resource.mdx +++ /dev/null @@ -1,48 +0,0 @@ -**`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: ``. | - | -| `freeTrialEndsAt` | 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: ``. | - | -| `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/.typedoc/docs/types/commerce-checkout-totals-json.mdx b/.typedoc/docs/types/commerce-checkout-totals-json.mdx deleted file mode 100644 index f33e43c2257..00000000000 --- a/.typedoc/docs/types/commerce-checkout-totals-json.mdx +++ /dev/null @@ -1,20 +0,0 @@ -**`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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | -| `grand_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | -| `subtotal` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | -| `tax_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | -| `total_due_now` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | diff --git a/.typedoc/docs/types/commerce-checkout-totals.mdx b/.typedoc/docs/types/commerce-checkout-totals.mdx deleted file mode 100644 index 98336ee1e81..00000000000 --- a/.typedoc/docs/types/commerce-checkout-totals.mdx +++ /dev/null @@ -1,21 +0,0 @@ -**`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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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/.typedoc/docs/types/commerce-feature-json.mdx b/.typedoc/docs/types/commerce-feature-json.mdx deleted file mode 100644 index 88ec46c2aee..00000000000 --- a/.typedoc/docs/types/commerce-feature-json.mdx +++ /dev/null @@ -1,21 +0,0 @@ -**`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/.typedoc/docs/types/commerce-feature-resource.mdx b/.typedoc/docs/types/commerce-feature-resource.mdx deleted file mode 100644 index 35eb1e9bdc3..00000000000 --- a/.typedoc/docs/types/commerce-feature-resource.mdx +++ /dev/null @@ -1,42 +0,0 @@ -**`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/.typedoc/docs/types/commerce-initialized-payment-source-json.mdx b/.typedoc/docs/types/commerce-initialized-payment-source-json.mdx deleted file mode 100644 index ce7ed223072..00000000000 --- a/.typedoc/docs/types/commerce-initialized-payment-source-json.mdx +++ /dev/null @@ -1,20 +0,0 @@ -**`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/.typedoc/docs/types/commerce-initialized-payment-source-resource.mdx b/.typedoc/docs/types/commerce-initialized-payment-source-resource.mdx deleted file mode 100644 index 660d0b72139..00000000000 --- a/.typedoc/docs/types/commerce-initialized-payment-source-resource.mdx +++ /dev/null @@ -1,40 +0,0 @@ -**`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/.typedoc/docs/types/commerce-money-amount-json.mdx b/.typedoc/docs/types/commerce-money-amount-json.mdx deleted file mode 100644 index 3799c73988d..00000000000 --- a/.typedoc/docs/types/commerce-money-amount-json.mdx +++ /dev/null @@ -1,19 +0,0 @@ -**`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/.typedoc/docs/types/commerce-money-amount.mdx b/.typedoc/docs/types/commerce-money-amount.mdx deleted file mode 100644 index b9a42365172..00000000000 --- a/.typedoc/docs/types/commerce-money-amount.mdx +++ /dev/null @@ -1,19 +0,0 @@ -**`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/.typedoc/docs/types/commerce-payer-resource-type.mdx b/.typedoc/docs/types/commerce-payer-resource-type.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/commerce-payer-resource-type.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/commerce-payment-charge-type.mdx b/.typedoc/docs/types/commerce-payment-charge-type.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/commerce-payment-charge-type.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/commerce-payment-json.mdx b/.typedoc/docs/types/commerce-payment-json.mdx deleted file mode 100644 index 3c1a52d2b13..00000000000 --- a/.typedoc/docs/types/commerce-payment-json.mdx +++ /dev/null @@ -1,26 +0,0 @@ -**`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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-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/.typedoc/docs/types/commerce-payment-resource.mdx b/.typedoc/docs/types/commerce-payment-resource.mdx deleted file mode 100644 index 20c8592f87b..00000000000 --- a/.typedoc/docs/types/commerce-payment-resource.mdx +++ /dev/null @@ -1,46 +0,0 @@ -**`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` | [`CommerceMoneyAmount`](commerce-money-amount.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`](/docs/references/javascript/types/commerce-subscription-item-resource) | **`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`](/docs/references/javascript/types/commerce-subscription-item-resource) | **`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/.typedoc/docs/types/commerce-payment-source-json.mdx b/.typedoc/docs/types/commerce-payment-source-json.mdx deleted file mode 100644 index 3dac463fd91..00000000000 --- a/.typedoc/docs/types/commerce-payment-source-json.mdx +++ /dev/null @@ -1,24 +0,0 @@ -**`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/.typedoc/docs/types/commerce-payment-source-methods.mdx b/.typedoc/docs/types/commerce-payment-source-methods.mdx deleted file mode 100644 index d3c69c4bfbd..00000000000 --- a/.typedoc/docs/types/commerce-payment-source-methods.mdx +++ /dev/null @@ -1,18 +0,0 @@ -**`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/.typedoc/docs/types/commerce-payment-source-resource.mdx b/.typedoc/docs/types/commerce-payment-source-resource.mdx deleted file mode 100644 index 38db54f5f75..00000000000 --- a/.typedoc/docs/types/commerce-payment-source-resource.mdx +++ /dev/null @@ -1,46 +0,0 @@ -**`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/.typedoc/docs/types/commerce-payment-source-status.mdx b/.typedoc/docs/types/commerce-payment-source-status.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/commerce-payment-source-status.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/commerce-payment-status.mdx b/.typedoc/docs/types/commerce-payment-status.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/commerce-payment-status.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/commerce-plan-json.mdx b/.typedoc/docs/types/commerce-plan-json.mdx deleted file mode 100644 index a0a5031abba..00000000000 --- a/.typedoc/docs/types/commerce-plan-json.mdx +++ /dev/null @@ -1,40 +0,0 @@ -**`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_fee` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | -| `annual_monthly_amount` | `number` | **`Experimental`** | - | -| `annual_monthly_amount_formatted` | `string` | **`Experimental`** | - | -| `annual_monthly_fee` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | -| `avatar_url` | `string` | **`Experimental`** | - | -| `currency` | `string` | **`Experimental`** | - | -| `currency_symbol` | `string` | **`Experimental`** | - | -| `description` | `string` | **`Experimental`** | - | -| `features` | [CommerceFeatureJSON](commerce-feature-json.mdx)[] | **`Experimental`** | - | -| `fee` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | -| `for_payer_type` | [`CommercePayerResourceType`](commerce-payer-resource-type.mdx) | **`Experimental`** | - | -| `free_trial_days?` | null \| number | **`Experimental`** | - | -| `free_trial_enabled?` | `boolean` | **`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/.typedoc/docs/types/commerce-plan-resource.mdx b/.typedoc/docs/types/commerce-plan-resource.mdx deleted file mode 100644 index 12be3aab061..00000000000 --- a/.typedoc/docs/types/commerce-plan-resource.mdx +++ /dev/null @@ -1,52 +0,0 @@ -**`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 | -| ------------------------------------------------ | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `annualFee` | [`CommerceMoneyAmount`](commerce-money-amount.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: ``. | - | -| `annualMonthlyFee` | [`CommerceMoneyAmount`](commerce-money-amount.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: ``. | - | -| `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: ``. | - | -| `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: ``. | - | -| `fee` | [`CommerceMoneyAmount`](commerce-money-amount.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. | - | -| `freeTrialDays` | null \| 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: ``. | - | -| `freeTrialEnabled` | `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: ``. | - | -| `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/.typedoc/docs/types/commerce-product-json.mdx b/.typedoc/docs/types/commerce-product-json.mdx deleted file mode 100644 index 012681c4ea5..00000000000 --- a/.typedoc/docs/types/commerce-product-json.mdx +++ /dev/null @@ -1,21 +0,0 @@ -**`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/.typedoc/docs/types/commerce-product-resource.mdx b/.typedoc/docs/types/commerce-product-resource.mdx deleted file mode 100644 index 045ad69697e..00000000000 --- a/.typedoc/docs/types/commerce-product-resource.mdx +++ /dev/null @@ -1,41 +0,0 @@ -**`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/.typedoc/docs/types/commerce-statement-group-json.mdx b/.typedoc/docs/types/commerce-statement-group-json.mdx deleted file mode 100644 index debb37ed037..00000000000 --- a/.typedoc/docs/types/commerce-statement-group-json.mdx +++ /dev/null @@ -1,19 +0,0 @@ -**`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/.typedoc/docs/types/commerce-statement-group.mdx b/.typedoc/docs/types/commerce-statement-group.mdx deleted file mode 100644 index 590ebd9aa9d..00000000000 --- a/.typedoc/docs/types/commerce-statement-group.mdx +++ /dev/null @@ -1,17 +0,0 @@ -**`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/.typedoc/docs/types/commerce-statement-json.mdx b/.typedoc/docs/types/commerce-statement-json.mdx deleted file mode 100644 index 929a1bd120c..00000000000 --- a/.typedoc/docs/types/commerce-statement-json.mdx +++ /dev/null @@ -1,21 +0,0 @@ -**`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/.typedoc/docs/types/commerce-statement-resource.mdx b/.typedoc/docs/types/commerce-statement-resource.mdx deleted file mode 100644 index b400e62aa6c..00000000000 --- a/.typedoc/docs/types/commerce-statement-resource.mdx +++ /dev/null @@ -1,41 +0,0 @@ -**`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/.typedoc/docs/types/commerce-statement-status.mdx b/.typedoc/docs/types/commerce-statement-status.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/commerce-statement-status.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/commerce-statement-totals-json.mdx b/.typedoc/docs/types/commerce-statement-totals-json.mdx deleted file mode 100644 index efc4bbf9ba7..00000000000 --- a/.typedoc/docs/types/commerce-statement-totals-json.mdx +++ /dev/null @@ -1,19 +0,0 @@ -**`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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | -| `grand_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | -| `subtotal` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | -| `tax_total` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | diff --git a/.typedoc/docs/types/commerce-statement-totals.mdx b/.typedoc/docs/types/commerce-statement-totals.mdx deleted file mode 100644 index 9929447a7c7..00000000000 --- a/.typedoc/docs/types/commerce-statement-totals.mdx +++ /dev/null @@ -1,20 +0,0 @@ -**`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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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/.typedoc/docs/types/commerce-subscription-item-json.mdx b/.typedoc/docs/types/commerce-subscription-item-json.mdx deleted file mode 100644 index 448376cf45c..00000000000 --- a/.typedoc/docs/types/commerce-subscription-item-json.mdx +++ /dev/null @@ -1,30 +0,0 @@ -**`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?` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | **`Experimental`** | - | -| `canceled_at` | null \| number | **`Experimental`** | - | -| `created_at` | `number` | **`Experimental`** | - | -| `credit?` | \{ amount: [CommerceMoneyAmountJSON](commerce-money-amount-json.mdx); \} | **`Experimental`** | - | -| `credit.amount` | [`CommerceMoneyAmountJSON`](commerce-money-amount-json.mdx) | - | - | -| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | -| `is_free_trial?` | `boolean` | **`Experimental`** | - | -| `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/.typedoc/docs/types/commerce-subscription-item-resource.mdx b/.typedoc/docs/types/commerce-subscription-item-resource.mdx deleted file mode 100644 index 3c1ecc5216b..00000000000 --- a/.typedoc/docs/types/commerce-subscription-item-resource.mdx +++ /dev/null @@ -1,51 +0,0 @@ -**`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?` | [`CommerceMoneyAmount`](commerce-money-amount.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: [CommerceMoneyAmount](commerce-money-amount.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` | [`CommerceMoneyAmount`](commerce-money-amount.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) | -| `isFreeTrial` | `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: ``. | - | -| `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/.typedoc/docs/types/commerce-subscription-json.mdx b/.typedoc/docs/types/commerce-subscription-json.mdx deleted file mode 100644 index 1a11b26febb..00000000000 --- a/.typedoc/docs/types/commerce-subscription-json.mdx +++ /dev/null @@ -1,27 +0,0 @@ -**`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`** | - | -| `eligible_for_free_trial?` | `boolean` | **`Experimental`** | - | -| `id` | `string` | **`Experimental`** | `ClerkResourceJSON.id` | -| `next_payment?` | \{ amount: [CommerceMoneyAmountJSON](commerce-money-amount-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` | [`CommerceMoneyAmountJSON`](commerce-money-amount-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/.typedoc/docs/types/commerce-subscription-plan-period.mdx b/.typedoc/docs/types/commerce-subscription-plan-period.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/commerce-subscription-plan-period.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/commerce-subscription-resource.mdx b/.typedoc/docs/types/commerce-subscription-resource.mdx deleted file mode 100644 index 23772ca768a..00000000000 --- a/.typedoc/docs/types/commerce-subscription-resource.mdx +++ /dev/null @@ -1,45 +0,0 @@ -**`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: ``. | - | -| `eligibleForFreeTrial?` | `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` | **`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: [CommerceMoneyAmount](commerce-money-amount.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](/docs/references/javascript/types/commerce-subscription-item-resource)[] | **`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/.typedoc/docs/types/commerce-subscription-status.mdx b/.typedoc/docs/types/commerce-subscription-status.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/commerce-subscription-status.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/confirm-checkout-params.mdx b/.typedoc/docs/types/confirm-checkout-params.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/confirm-checkout-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/create-checkout-params.mdx b/.typedoc/docs/types/create-checkout-params.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/create-checkout-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/create-organization-params.mdx b/.typedoc/docs/types/create-organization-params.mdx deleted file mode 100644 index 77db98c5974..00000000000 --- a/.typedoc/docs/types/create-organization-params.mdx +++ /dev/null @@ -1,4 +0,0 @@ -| Property | Type | Description | -| ------------------------- | -------- | ----------------------------- | -| `name` | `string` | The name of the organization. | -| `slug?` | `string` | The slug of the organization. | diff --git a/.typedoc/docs/types/element-object-key.mdx b/.typedoc/docs/types/element-object-key.mdx deleted file mode 100644 index f5fec844683..00000000000 --- a/.typedoc/docs/types/element-object-key.mdx +++ /dev/null @@ -1 +0,0 @@ -Convert a kebab-cased key from ElementsConfig into a camelCased Elements key diff --git a/.typedoc/docs/types/elements-config.mdx b/.typedoc/docs/types/elements-config.mdx deleted file mode 100644 index 603ae040f48..00000000000 --- a/.typedoc/docs/types/elements-config.mdx +++ /dev/null @@ -1,3 +0,0 @@ -A map that describes the possible combinations we need to generate -for each unique base element -Kebab-case is used to differentiate between the container and child elements diff --git a/.typedoc/docs/types/experimental_checkout-button-props.mdx b/.typedoc/docs/types/experimental_checkout-button-props.mdx deleted file mode 100644 index dd556470b00..00000000000 --- a/.typedoc/docs/types/experimental_checkout-button-props.mdx +++ /dev/null @@ -1,23 +0,0 @@ -> **\_\_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/.typedoc/docs/types/experimental_plan-details-button-props.mdx b/.typedoc/docs/types/experimental_plan-details-button-props.mdx deleted file mode 100644 index 4a00cab7d49..00000000000 --- a/.typedoc/docs/types/experimental_plan-details-button-props.mdx +++ /dev/null @@ -1,22 +0,0 @@ -**`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/.typedoc/docs/types/experimental_subscription-details-button-props.mdx b/.typedoc/docs/types/experimental_subscription-details-button-props.mdx deleted file mode 100644 index af7d6709b02..00000000000 --- a/.typedoc/docs/types/experimental_subscription-details-button-props.mdx +++ /dev/null @@ -1,23 +0,0 @@ -> **\_\_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/.typedoc/docs/types/for-payer-type.mdx b/.typedoc/docs/types/for-payer-type.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/for-payer-type.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/get-payment-attempts-params.mdx b/.typedoc/docs/types/get-payment-attempts-params.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/get-payment-attempts-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/get-payment-sources-params.mdx b/.typedoc/docs/types/get-payment-sources-params.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/get-payment-sources-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/get-plans-params.mdx b/.typedoc/docs/types/get-plans-params.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/get-plans-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/get-statements-params.mdx b/.typedoc/docs/types/get-statements-params.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/get-statements-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/get-subscription-params.mdx b/.typedoc/docs/types/get-subscription-params.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/get-subscription-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/get-subscriptions-params.mdx b/.typedoc/docs/types/get-subscriptions-params.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/get-subscriptions-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/get-token.mdx b/.typedoc/docs/types/get-token.mdx deleted file mode 100644 index 60dbf10f036..00000000000 --- a/.typedoc/docs/types/get-token.mdx +++ /dev/null @@ -1,9 +0,0 @@ -## Parameters - -| Parameter | Type | -| ---------- | ----------------- | -| `options?` | `GetTokenOptions` | - -## Returns - -`Promise`\<string \| null\> diff --git a/.typedoc/docs/types/id-selectors.mdx b/.typedoc/docs/types/id-selectors.mdx deleted file mode 100644 index 29c20772b88..00000000000 --- a/.typedoc/docs/types/id-selectors.mdx +++ /dev/null @@ -1 +0,0 @@ -Create a type union consisting of the base element with all valid ids appended diff --git a/.typedoc/docs/types/initialize-payment-source-params.mdx b/.typedoc/docs/types/initialize-payment-source-params.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/initialize-payment-source-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/internal_checkout-props.mdx b/.typedoc/docs/types/internal_checkout-props.mdx deleted file mode 100644 index 59a0f5ad51d..00000000000 --- a/.typedoc/docs/types/internal_checkout-props.mdx +++ /dev/null @@ -1,23 +0,0 @@ -> **\_\_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/.typedoc/docs/types/internal_plan-details-props.mdx b/.typedoc/docs/types/internal_plan-details-props.mdx deleted file mode 100644 index e3190d675dc..00000000000 --- a/.typedoc/docs/types/internal_plan-details-props.mdx +++ /dev/null @@ -1,24 +0,0 @@ -**`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/.typedoc/docs/types/internal_subscription-details-props.mdx b/.typedoc/docs/types/internal_subscription-details-props.mdx deleted file mode 100644 index a1288deb008..00000000000 --- a/.typedoc/docs/types/internal_subscription-details-props.mdx +++ /dev/null @@ -1,23 +0,0 @@ -> **\_\_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/.typedoc/docs/types/jwt-claims.mdx b/.typedoc/docs/types/jwt-claims.mdx deleted file mode 100644 index 16182c24357..00000000000 --- a/.typedoc/docs/types/jwt-claims.mdx +++ /dev/null @@ -1,27 +0,0 @@ -## Deprecated - -Use `JwtPayload` instead. - -## Indexable - -\[`propName`: `string`\]: `unknown` - -Any other JWT Claim Set member. - -## Properties - -| Property | Type | Description | -| ------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| ~~`__raw`~~ | `string` | Encoded token supporting the `getRawString` method. | -| ~~`act?`~~ | \{ [x: string]: unknown; sub: string; \} | JWT Actor - [RFC8693](https://www.rfc-editor.org/rfc/rfc8693.html#name-act-actor-claim). | -| `act.sub` | `string` | - | -| ~~`azp?`~~ | `string` | JWT Authorized party - [RFC7800#section-3](https://tools.ietf.org/html/rfc7800#section-3). | -| ~~`exp`~~ | `number` | JWT Expiration Time - [RFC7519#section-4.1.4](https://tools.ietf.org/html/rfc7519#section-4.1.4). | -| ~~`iat`~~ | `number` | JWT Issued At - [RFC7519#section-4.1.6](https://tools.ietf.org/html/rfc7519#section-4.1.6). | -| ~~`iss`~~ | `string` | JWT Issuer - [RFC7519#section-4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1). | -| ~~`nbf`~~ | `number` | JWT Not Before - [RFC7519#section-4.1.5](https://tools.ietf.org/html/rfc7519#section-4.1.5). | -| ~~`org_id?`~~ | `string` | Active organization ID. | -| ~~`org_role?`~~ | `string` | Active organization role. | -| ~~`org_slug?`~~ | `string` | Active organization slug. | -| ~~`sid`~~ | `string` | Session ID | -| ~~`sub`~~ | `string` | JWT Subject - [RFC7519#section-4.1.2](https://tools.ietf.org/html/rfc7519#section-4.1.2). | diff --git a/.typedoc/docs/types/jwt-header.mdx b/.typedoc/docs/types/jwt-header.mdx deleted file mode 100644 index ad47ca006c3..00000000000 --- a/.typedoc/docs/types/jwt-header.mdx +++ /dev/null @@ -1,3 +0,0 @@ -## Deprecated - -Use `JwtHeader` instead. diff --git a/.typedoc/docs/types/legacy-redirect-props.mdx b/.typedoc/docs/types/legacy-redirect-props.mdx deleted file mode 100644 index 62b50d20394..00000000000 --- a/.typedoc/docs/types/legacy-redirect-props.mdx +++ /dev/null @@ -1,13 +0,0 @@ -> **LegacyRedirectProps** = \{ afterSignInUrl?: string \| null; afterSignUpUrl?: string \| null; redirectUrl?: string \| null; \} - -## Deprecated - -This will be removed in a future release. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------- | --------------------------- | ------------------------------------------------------------------------ | -| ~~`afterSignInUrl?`~~ | string \| null | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | -| ~~`afterSignUpUrl?`~~ | string \| null | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | -| ~~`redirectUrl?`~~ | string \| null | **Deprecated.** Use `fallbackRedirectUrl` or `forceRedirectUrl` instead. | diff --git a/.typedoc/docs/types/localization-resource.mdx b/.typedoc/docs/types/localization-resource.mdx deleted file mode 100644 index 0c2b7715347..00000000000 --- a/.typedoc/docs/types/localization-resource.mdx +++ /dev/null @@ -1,13 +0,0 @@ -A type containing all the possible localization keys the prebuilt Clerk components support. -Users aiming to customize a few strings can also peak at the `data-localization-key` attribute by inspecting -the DOM and updating the corresponding key. -Users aiming to completely localize the components by providing a complete translation can use -the default english resource object from [Clerk's open source repo](https://github.com/clerk/javascript) -as a starting point. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `roles?` | `DeepPartial`\<`DeepLocalizationWithoutObjects`\<\{ [r: string]: string; \}\>\> | **`Experimental`** Add role keys and their localized values, e.g. `roles: { 'org:teacher': 'Teacher'}`. | -| `socialButtonsBlockButtonManyInView?` | `DeepPartial`\<\`$\{string\}\{\{provider\|titleize\}\}$\{string\}\` & \{ \_\_params: UnionToRecordWithPrimitives\; \}\> | It should be used to provide a shorter variation of `socialButtonsBlockButton`. It is explicitly typed, in order to avoid contributions that use LLM tools to generate translations that misinterpret the correct usage of this property. | diff --git a/.typedoc/docs/types/make-default-payment-source-params.mdx b/.typedoc/docs/types/make-default-payment-source-params.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/make-default-payment-source-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/multi-domain-and-or-proxy.mdx b/.typedoc/docs/types/multi-domain-and-or-proxy.mdx deleted file mode 100644 index fceea3d28db..00000000000 --- a/.typedoc/docs/types/multi-domain-and-or-proxy.mdx +++ /dev/null @@ -1,26 +0,0 @@ -You can configure proxy and satellite domains in a few ways: - -1. none of them are set -2. only `proxyUrl` is set -3. `isSatellite` and `proxyUrl` are set -4. `isSatellite` and `domain` are set - -## Type declaration - -| Name | Type | Description | -| -------------- | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `domain?` | `never` | **Required if your application is a satellite application**. Sets the domain of the satellite application. | -| `isSatellite?` | `never` | A boolean that indicates whether the application is a satellite application. | -| `proxyUrl?` | never \| 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`). | - -| Name | Type | -| ------------- | ----------------------------------------------------------- | -| `domain` | string \| (url) => string | -| `isSatellite` | `Exclude`\<`ClerkOptions`\[`"isSatellite"`\], `undefined`\> | -| `proxyUrl?` | `never` | - -| Name | Type | -| ------------- | ----------------------------------------------------------- | -| `domain?` | `never` | -| `isSatellite` | `Exclude`\<`ClerkOptions`\[`"isSatellite"`\], `undefined`\> | -| `proxyUrl` | string \| (url) => string | diff --git a/.typedoc/docs/types/organization-custom-role-key.mdx b/.typedoc/docs/types/organization-custom-role-key.mdx deleted file mode 100644 index d3729132f8f..00000000000 --- a/.typedoc/docs/types/organization-custom-role-key.mdx +++ /dev/null @@ -1,3 +0,0 @@ -`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/roles-permissions#custom-roles) as well. diff --git a/.typedoc/docs/types/organization-domain-resource.mdx b/.typedoc/docs/types/organization-domain-resource.mdx deleted file mode 100644 index 7e8db7659d8..00000000000 --- a/.typedoc/docs/types/organization-domain-resource.mdx +++ /dev/null @@ -1,28 +0,0 @@ -The `OrganizationDomain` object is the model around an organization domain. - -## 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. | - | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`OrganizationDomainResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-domain-verification-status.mdx b/.typedoc/docs/types/organization-domain-verification-status.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/organization-enrollment-mode.mdx b/.typedoc/docs/types/organization-enrollment-mode.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/organization-invitation-resource.mdx b/.typedoc/docs/types/organization-invitation-resource.mdx deleted file mode 100644 index 514156fa13d..00000000000 --- a/.typedoc/docs/types/organization-invitation-resource.mdx +++ /dev/null @@ -1,28 +0,0 @@ -The `OrganizationInvitation` object is the model around an organization invitation. - -## 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. | - | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`OrganizationInvitationResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-invitation-status.mdx b/.typedoc/docs/types/organization-invitation-status.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/organization-membership-request-resource.mdx b/.typedoc/docs/types/organization-membership-request-resource.mdx deleted file mode 100644 index bdd6dfe997d..00000000000 --- a/.typedoc/docs/types/organization-membership-request-resource.mdx +++ /dev/null @@ -1,28 +0,0 @@ -The `OrganizationMembershipRequest` object is the model that describes the request of a user to join an organization. - -## 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. | - | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`OrganizationMembershipRequestResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-membership-resource.mdx b/.typedoc/docs/types/organization-membership-resource.mdx deleted file mode 100644 index b4dc4fa94e1..00000000000 --- a/.typedoc/docs/types/organization-membership-resource.mdx +++ /dev/null @@ -1,28 +0,0 @@ -The `OrganizationMembership` object is the model around an organization membership entity and describes the relationship between users and organizations. - -## 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. | - | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`OrganizationMembershipResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-permission-key.mdx b/.typedoc/docs/types/organization-permission-key.mdx deleted file mode 100644 index 32332de64d2..00000000000 --- a/.typedoc/docs/types/organization-permission-key.mdx +++ /dev/null @@ -1,2 +0,0 @@ -OrganizationPermissionKey is a combination of system and custom permissions. -System permissions are only accessible from FAPI and client-side operations/utils diff --git a/.typedoc/docs/types/organization-resource.mdx b/.typedoc/docs/types/organization-resource.mdx deleted file mode 100644 index ffdffff3e9f..00000000000 --- a/.typedoc/docs/types/organization-resource.mdx +++ /dev/null @@ -1,34 +0,0 @@ -The `Organization` object holds information about an organization, as well as methods for managing it. - -To use these methods, you must have the **Organizations** feature [enabled in your app's settings in the Clerk Dashboard](/docs/organizations/overview#enable-organizations-in-your-application). - -## Properties - -| 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](/docs/references/javascript/types/commerce-subscription-item-resource)\>\> | **`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 - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`OrganizationResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-suggestion-resource.mdx b/.typedoc/docs/types/organization-suggestion-resource.mdx deleted file mode 100644 index 9ab3fff17b3..00000000000 --- a/.typedoc/docs/types/organization-suggestion-resource.mdx +++ /dev/null @@ -1,28 +0,0 @@ -An interface representing an organization suggestion. - -## 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. | - | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`OrganizationSuggestionResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/organization-suggestion-status.mdx b/.typedoc/docs/types/organization-suggestion-status.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/organizations-jwt-claim.mdx b/.typedoc/docs/types/organizations-jwt-claim.mdx deleted file mode 100644 index cd60c4db281..00000000000 --- a/.typedoc/docs/types/organizations-jwt-claim.mdx +++ /dev/null @@ -1,3 +0,0 @@ -## Deprecated - -This type will be removed in the next major version. diff --git a/.typedoc/docs/types/override.mdx b/.typedoc/docs/types/override.mdx deleted file mode 100644 index 6aec62ed955..00000000000 --- a/.typedoc/docs/types/override.mdx +++ /dev/null @@ -1,4 +0,0 @@ -Overrides the type of existing properties -const obj = { a: string, b: number } as const; -type Value = Override -Value contains: { a:string, b: string } diff --git a/.typedoc/docs/types/path-value.mdx b/.typedoc/docs/types/path-value.mdx deleted file mode 100644 index 6b636990561..00000000000 --- a/.typedoc/docs/types/path-value.mdx +++ /dev/null @@ -1,4 +0,0 @@ -Used to read the value of a string path inside an object defined as const -const obj = { a: { b: 'hello' }} as const; -type Value = PathValue -Value is now a union set containing a single type: 'hello' diff --git a/.typedoc/docs/types/payment-gateway.mdx b/.typedoc/docs/types/payment-gateway.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/payment-gateway.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/pending-session-options.mdx b/.typedoc/docs/types/pending-session-options.mdx deleted file mode 100644 index 3b210e465f2..00000000000 --- a/.typedoc/docs/types/pending-session-options.mdx +++ /dev/null @@ -1,7 +0,0 @@ -> **PendingSessionOptions** = \{ treatPendingAsSignedOut?: boolean; \} - -## Properties - -| Property | Type | Description | -| --------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------- | -| `treatPendingAsSignedOut?` | `boolean` | A boolean that indicates whether pending sessions are considered as signed out or not. Defaults to `true`. | diff --git a/.typedoc/docs/types/pending-session-resource.mdx b/.typedoc/docs/types/pending-session-resource.mdx deleted file mode 100644 index 44fa113497e..00000000000 --- a/.typedoc/docs/types/pending-session-resource.mdx +++ /dev/null @@ -1,32 +0,0 @@ -Represents a session resource that has completed sign-in but has pending tasks - -## Properties - -| Property | Type | Description | Overrides | -| ---------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `end` | () => Promise\<[SessionResource](/docs/references/javascript/session)\> | Marks the session as ended. The session will no longer be active for this `Client` and its status will become **ended**. | - | -| `factorVerificationAge` | null \| \[number, number\] | An array where each item represents the number of minutes since the last verification of a first or second factor: `[firstFactorAge, secondFactorAge]`. | - | -| `id` | `string` | The unique identifier for the session. | - | -| `pathRoot` | `string` | The root path of the resource. | - | -| `status` | `"pending"` | The current state of the session. | [`SessionResource`](/docs/references/javascript/session).[`status`](/docs/references/javascript/session#status) | -| `user` | [`UserResource`](/docs/references/javascript/user) | The user associated with the session. | [`SessionResource`](/docs/references/javascript/session).[`user`](/docs/references/javascript/session#user) | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`PendingSessionResource`\> - -#### Inherited from - -[`SessionResource`](/docs/references/javascript/session).[`reload`](/docs/references/javascript/session#reload) diff --git a/.typedoc/docs/types/protect-props.mdx b/.typedoc/docs/types/protect-props.mdx deleted file mode 100644 index caa5998e83e..00000000000 --- a/.typedoc/docs/types/protect-props.mdx +++ /dev/null @@ -1,22 +0,0 @@ -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/.typedoc/docs/types/record-to-path.mdx b/.typedoc/docs/types/record-to-path.mdx deleted file mode 100644 index d89089101d1..00000000000 --- a/.typedoc/docs/types/record-to-path.mdx +++ /dev/null @@ -1,4 +0,0 @@ -Used to construct a type union containing all the keys (even if nested) of an object defined as const -const obj = { a: { b: '' }, c: '' } as const; -type Paths = RecordToPath -Paths contains: 'a' | 'a.b' | 'c' diff --git a/.typedoc/docs/types/redirect-options.mdx b/.typedoc/docs/types/redirect-options.mdx deleted file mode 100644 index b505ddb60ce..00000000000 --- a/.typedoc/docs/types/redirect-options.mdx +++ /dev/null @@ -1,2 +0,0 @@ -Redirect URLs for different actions. -Mainly used to be used to type internal Clerk functions. diff --git a/.typedoc/docs/types/remove-payment-source-params.mdx b/.typedoc/docs/types/remove-payment-source-params.mdx deleted file mode 100644 index 9bd89f7c792..00000000000 --- a/.typedoc/docs/types/remove-payment-source-params.mdx +++ /dev/null @@ -1,10 +0,0 @@ -**`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/.typedoc/docs/types/reverification-config.mdx b/.typedoc/docs/types/reverification-config.mdx deleted file mode 100644 index 7ca39c1bd5a..00000000000 --- a/.typedoc/docs/types/reverification-config.mdx +++ /dev/null @@ -1,10 +0,0 @@ -The `ReverificationConfig` type has the following properties: - -## Type declaration - -"strict" \| "strict_mfa" \| "moderate" \| "lax" - -| Name | Type | Description | -| -------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `afterMinutes` | `SessionVerificationAfterMinutes` | The age of the factor level to check for. Value should be greater than or equal to 1 and less than 99,999. | -| `level` | "first_factor" \| "second_factor" \| "multi_factor" | The reverification level of credentials to check for. | diff --git a/.typedoc/docs/types/saml-strategy.mdx b/.typedoc/docs/types/saml-strategy.mdx deleted file mode 100644 index a8f26d96d35..00000000000 --- a/.typedoc/docs/types/saml-strategy.mdx +++ /dev/null @@ -1,3 +0,0 @@ -## Deprecated - -Use `EnterpriseSSOStrategy` instead. diff --git a/.typedoc/docs/types/sdk-metadata.mdx b/.typedoc/docs/types/sdk-metadata.mdx deleted file mode 100644 index 42ddd4d54c3..00000000000 --- a/.typedoc/docs/types/sdk-metadata.mdx +++ /dev/null @@ -1,9 +0,0 @@ -> **SDKMetadata** = \{ environment?: string; name: string; version: string; \} - -## Properties - -| Property | Type | Description | -| --------------------------------------- | -------- | --------------------------------------------------------------------------- | -| `environment?` | `string` | Typically this will be the `NODE_ENV` that the SDK is currently running in. | -| `name` | `string` | The npm package name of the SDK. | -| `version` | `string` | The npm package version of the SDK. | diff --git a/.typedoc/docs/types/server-get-token-options.mdx b/.typedoc/docs/types/server-get-token-options.mdx deleted file mode 100644 index a63b221731b..00000000000 --- a/.typedoc/docs/types/server-get-token-options.mdx +++ /dev/null @@ -1,10 +0,0 @@ -> **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/.typedoc/docs/types/server-get-token.mdx b/.typedoc/docs/types/server-get-token.mdx deleted file mode 100644 index b0e14e560a8..00000000000 --- a/.typedoc/docs/types/server-get-token.mdx +++ /dev/null @@ -1,11 +0,0 @@ -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/.typedoc/docs/types/session-resource.mdx b/.typedoc/docs/types/session-resource.mdx deleted file mode 100644 index 2651cffa85b..00000000000 --- a/.typedoc/docs/types/session-resource.mdx +++ /dev/null @@ -1,43 +0,0 @@ -The `Session` object is an abstraction over an HTTP session. It models the period of information exchange between a user and the server. - -The `Session` object includes methods for recording session activity and ending the session client-side. For security reasons, sessions can also expire server-side. - -As soon as a [`User`](/docs/references/javascript/user) signs in, Clerk creates a `Session` for the current [`Client`](/docs/references/javascript/client). Clients can have more than one sessions at any point in time, but only one of those sessions will be **active**. - -In certain scenarios, a session might be replaced by another one. This is often the case with [multi-session applications](/docs/authentication/configuration/session-options#multi-session-applications). - -All sessions that are **expired**, **removed**, **replaced**, **ended** or **abandoned** are not considered valid. - -> [!NOTE] -> For more information regarding the different session states, see the [guide on session management](/docs/authentication/configuration/session-options). - -## Properties - -| Property | Type | Description | Overrides | -| ---------------------------------------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `end` | () => Promise\ | Marks the session as ended. The session will no longer be active for this `Client` and its status will become **ended**. | - | -| `factorVerificationAge` | null \| \[number, number\] | An array where each item represents the number of minutes since the last verification of a first or second factor: `[firstFactorAge, secondFactorAge]`. | - | -| `id` | `string` | The unique identifier for the session. | [`ClerkResource`](clerk-resource.mdx).[`id`](clerk-resource.mdx#id) | -| `pathRoot` | `string` | The root path of the resource. | - | -| `status` | `SessionStatus` | The current state of the session. | - | -| `user` | null \| [UserResource](/docs/references/javascript/user) | The user associated with the session. | - | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`SessionResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/session-status-claim.mdx b/.typedoc/docs/types/session-status-claim.mdx deleted file mode 100644 index de597535472..00000000000 --- a/.typedoc/docs/types/session-status-claim.mdx +++ /dev/null @@ -1 +0,0 @@ -The current state of the session which can only be `active` or `pending`. diff --git a/.typedoc/docs/types/session-task.mdx b/.typedoc/docs/types/session-task.mdx deleted file mode 100644 index 12c0552a25e..00000000000 --- a/.typedoc/docs/types/session-task.mdx +++ /dev/null @@ -1,7 +0,0 @@ -Represents the current pending task of a session. - -## Properties - -| Property | Type | Description | -| ---------------------- | ----------------------- | -------------------------------- | -| `key` | `"choose-organization"` | A unique identifier for the task | diff --git a/.typedoc/docs/types/session-verification-level.mdx b/.typedoc/docs/types/session-verification-level.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/session-verification-types.mdx b/.typedoc/docs/types/session-verification-types.mdx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/.typedoc/docs/types/set-active-params.mdx b/.typedoc/docs/types/set-active-params.mdx deleted file mode 100644 index 4bd93404d67..00000000000 --- a/.typedoc/docs/types/set-active-params.mdx +++ /dev/null @@ -1,11 +0,0 @@ -The parameters for the `setActive()` method. - -## Properties - -| Property | Type | Description | -| ----------------------------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ~~`beforeEmit?`~~ | `BeforeEmitCallback` | **Deprecated.** Use `redirectUrl` instead. Callback run just before the active session and/or organization is set to the passed object. Can be used to set up for pre-navigation actions. | -| `navigate?` | `SetActiveNavigate` | A custom navigation function to be called just before the session and/or organization is set. When provided, it takes precedence over the `redirectUrl` parameter for navigation. Example: `await clerk.setActive({ session, navigate: async ({ session }) => { const currentTask = session.currentTask; if (currentTask) { await router.push(`./onboarding/${currentTask.key}`) return } router.push('/dashboard'); } });` | -| `organization?` | null \| string \| [OrganizationResource](/docs/references/javascript/organization) | The organization resource or organization ID/slug (string version) to be set as active in the current session. If `null`, the currently active organization is removed as active. | -| `redirectUrl?` | `string` | The full URL or path to redirect to just before the session and/or organization is set. | -| `session?` | null \| string \| [SignedInSessionResource](/docs/references/javascript/session) | The session resource or session ID (string version) to be set as active. If `null`, the current session is deleted. | diff --git a/.typedoc/docs/types/set-active.mdx b/.typedoc/docs/types/set-active.mdx deleted file mode 100644 index ab8cbd7d5c5..00000000000 --- a/.typedoc/docs/types/set-active.mdx +++ /dev/null @@ -1,9 +0,0 @@ -## Parameters - -| Parameter | Type | -| ----------------- | ------------------------------------------ | -| `setActiveParams` | [`SetActiveParams`](set-active-params.mdx) | - -## Returns - -`Promise`\<`void`\> diff --git a/.typedoc/docs/types/sign-in-resource.mdx b/.typedoc/docs/types/sign-in-resource.mdx deleted file mode 100644 index e6aa39d2aa5..00000000000 --- a/.typedoc/docs/types/sign-in-resource.mdx +++ /dev/null @@ -1,30 +0,0 @@ -The `SignIn` object holds the state of the current sign-in and provides helper methods to navigate and complete the sign-in process. It is used to manage the sign-in lifecycle, including the first and second factor verification, and the creation of a new session. - -## Properties - -| Property | Type | Description | -| ------------------------------------------------------------ | --------------------------------- | ------------------------------------------------------------------------- | -| `id?` | `string` | The unique identifier of the resource. | -| `pathRoot` | `string` | The root path of the resource. | -| `status` | null \| SignInStatus | The current status of the sign-in. | -| ~~`supportedIdentifiers`~~ | SignInIdentifier[] | **Deprecated.** This attribute will be removed in the next major version. | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`SignInResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/sign-out.mdx b/.typedoc/docs/types/sign-out.mdx deleted file mode 100644 index 2ec222553cb..00000000000 --- a/.typedoc/docs/types/sign-out.mdx +++ /dev/null @@ -1,24 +0,0 @@ -## Call Signature - -### Parameters - -| Parameter | Type | -| ---------- | ---------------- | -| `options?` | `SignOutOptions` | - -### Returns - -`Promise`\<`void`\> - -## Call Signature - -### Parameters - -| Parameter | Type | -| ------------------ | ----------------- | -| `signOutCallback?` | `SignOutCallback` | -| `options?` | `SignOutOptions` | - -### Returns - -`Promise`\<`void`\> diff --git a/.typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx b/.typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx deleted file mode 100644 index 2ad5ab70fe0..00000000000 --- a/.typedoc/docs/types/sign-up-authenticate-with-metamask-params.mdx +++ /dev/null @@ -1,3 +0,0 @@ -## Deprecated - -Use `SignUpAuthenticateWithWeb3Params` instead. diff --git a/.typedoc/docs/types/sign-up-resource.mdx b/.typedoc/docs/types/sign-up-resource.mdx deleted file mode 100644 index 46d56bca3dc..00000000000 --- a/.typedoc/docs/types/sign-up-resource.mdx +++ /dev/null @@ -1,29 +0,0 @@ -The `SignUp` object holds the state of the current sign-up and provides helper methods to navigate and complete the sign-up process. Once a sign-up is complete, a new user is created. - -## Properties - -| Property | Type | Description | -| -------------------------------- | --------------------------------- | -------------------------------------- | -| `id?` | `string` | The unique identifier of the resource. | -| `pathRoot` | `string` | The root path of the resource. | -| `status` | null \| SignUpStatus | The current status of the sign-up. | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`SignUpResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/signed-in-session-resource.mdx b/.typedoc/docs/types/signed-in-session-resource.mdx deleted file mode 100644 index a682dc8b4d8..00000000000 --- a/.typedoc/docs/types/signed-in-session-resource.mdx +++ /dev/null @@ -1,2 +0,0 @@ -Represents session resources for users who have completed -the full sign-in flow diff --git a/.typedoc/docs/types/state-selectors.mdx b/.typedoc/docs/types/state-selectors.mdx deleted file mode 100644 index cecc110aacf..00000000000 --- a/.typedoc/docs/types/state-selectors.mdx +++ /dev/null @@ -1 +0,0 @@ -Create a type union of all state + id combinations diff --git a/.typedoc/docs/types/telemetry-log-entry.mdx b/.typedoc/docs/types/telemetry-log-entry.mdx deleted file mode 100644 index 4b91f4af44f..00000000000 --- a/.typedoc/docs/types/telemetry-log-entry.mdx +++ /dev/null @@ -1 +0,0 @@ -Debug log entry interface for telemetry collector diff --git a/.typedoc/docs/types/use-auth-return.mdx b/.typedoc/docs/types/use-auth-return.mdx deleted file mode 100644 index 10bb56dd987..00000000000 --- a/.typedoc/docs/types/use-auth-return.mdx +++ /dev/null @@ -1,61 +0,0 @@ -## Type declaration - -| Name | Type | Description | -| --------------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `actor` | `undefined` | The JWT actor for the session. Holds identifier for the user that is impersonating the current user. Read more about [impersonation](/docs/users/user-impersonation). | -| `getToken` | [`GetToken`](get-token.mdx) | A function that retrieves the current user's session token or a custom JWT template. Returns a promise that resolves to the token. See the [reference doc](/docs/references/javascript/session#get-token). | -| `has` | \{ \} | A function that checks if the user has specific permissions or roles. See the [reference doc](/docs/references/backend/types/auth-object#has). | -| `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. | -| `orgId` | `undefined` | The ID of the user's active organization. | -| `orgRole` | `undefined` | The current user's role in their active organization. | -| `orgSlug` | `undefined` | The URL-friendly identifier of the user's active organization. | -| `sessionClaims` | `undefined` | The current user's [session claims](/docs/backend-requests/resources/session-tokens). | -| `sessionId` | `undefined` | The ID for the current session. | -| `signOut` | [`SignOut`](sign-out.mdx) | A function that signs out the current user. Returns a promise that resolves when complete. See the [reference doc](/docs/references/javascript/clerk#sign-out). | -| `userId` | `undefined` | The ID of the current user. | - -| Name | Type | -| --------------- | ------------------------------ | -| `actor` | `null` | -| `getToken` | [`GetToken`](get-token.mdx) | -| `has()` | (params) => false | -| `isLoaded` | `true` | -| `isSignedIn` | `false` | -| `orgId` | `null` | -| `orgRole` | `null` | -| `orgSlug` | `null` | -| `sessionClaims` | `null` | -| `sessionId` | `null` | -| `signOut` | [`SignOut`](sign-out.mdx) | -| `userId` | `null` | - -| Name | Type | -| --------------- | -------------------------------------------------------------------------------------------- | -| `actor` | [ActClaim](act-claim.mdx) \| null | -| `getToken` | [`GetToken`](get-token.mdx) | -| `has` | [`CheckAuthorizationWithCustomPermissions`](check-authorization-with-custom-permissions.mdx) | -| `isLoaded` | `true` | -| `isSignedIn` | `true` | -| `orgId` | `null` | -| `orgRole` | `null` | -| `orgSlug` | `null` | -| `sessionClaims` | `JwtPayload` | -| `sessionId` | `string` | -| `signOut` | [`SignOut`](sign-out.mdx) | -| `userId` | `string` | - -| Name | Type | -| --------------- | -------------------------------------------------------------------------------------------- | -| `actor` | [ActClaim](act-claim.mdx) \| null | -| `getToken` | [`GetToken`](get-token.mdx) | -| `has` | [`CheckAuthorizationWithCustomPermissions`](check-authorization-with-custom-permissions.mdx) | -| `isLoaded` | `true` | -| `isSignedIn` | `true` | -| `orgId` | `string` | -| `orgRole` | [`OrganizationCustomRoleKey`](organization-custom-role-key.mdx) | -| `orgSlug` | string \| null | -| `sessionClaims` | `JwtPayload` | -| `sessionId` | `string` | -| `signOut` | [`SignOut`](sign-out.mdx) | -| `userId` | `string` | diff --git a/.typedoc/docs/types/use-session-list-return.mdx b/.typedoc/docs/types/use-session-list-return.mdx deleted file mode 100644 index d5e0943a356..00000000000 --- a/.typedoc/docs/types/use-session-list-return.mdx +++ /dev/null @@ -1,13 +0,0 @@ -## Type declaration - -| Name | Type | Description | -| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `sessions` | `undefined` | A list of sessions that have been registered on the client device. | -| `setActive` | `undefined` | A function that sets the active session and/or organization. | - -| Name | Type | -| ----------- | --------------------------------------------------------------------- | -| `isLoaded` | `true` | -| `sessions` | [SessionResource](/docs/references/javascript/session)[] | -| `setActive` | [`SetActive`](set-active.mdx) | diff --git a/.typedoc/docs/types/use-session-return.mdx b/.typedoc/docs/types/use-session-return.mdx deleted file mode 100644 index 58f615aad81..00000000000 --- a/.typedoc/docs/types/use-session-return.mdx +++ /dev/null @@ -1,19 +0,0 @@ -## Type declaration - -| Name | Type | Description | -| ------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------ | -| `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 session for the user. | - -| Name | Type | -| ------------ | ------- | -| `isLoaded` | `true` | -| `isSignedIn` | `false` | -| `session` | `null` | - -| Name | Type | -| ------------ | ---------------------------------------------------------------- | -| `isLoaded` | `true` | -| `isSignedIn` | `boolean` | -| `session` | [`SignedInSessionResource`](/docs/references/javascript/session) | diff --git a/.typedoc/docs/types/use-sign-in-return.mdx b/.typedoc/docs/types/use-sign-in-return.mdx deleted file mode 100644 index 5da1828dd90..00000000000 --- a/.typedoc/docs/types/use-sign-in-return.mdx +++ /dev/null @@ -1,13 +0,0 @@ -## Type declaration - -| Name | Type | Description | -| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `setActive` | `undefined` | A function that sets the active session. | -| `signIn` | `undefined` | An object that contains the current sign-in attempt status and methods to create a new sign-in attempt. | - -| Name | Type | -| ----------- | ---------------------------------------- | -| `isLoaded` | `true` | -| `setActive` | [`SetActive`](set-active.mdx) | -| `signIn` | [`SignInResource`](sign-in-resource.mdx) | diff --git a/.typedoc/docs/types/use-sign-up-return.mdx b/.typedoc/docs/types/use-sign-up-return.mdx deleted file mode 100644 index df2caffca81..00000000000 --- a/.typedoc/docs/types/use-sign-up-return.mdx +++ /dev/null @@ -1,13 +0,0 @@ -## Type declaration - -| Name | Type | Description | -| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `setActive` | `undefined` | A function that sets the active session. | -| `signUp` | `undefined` | An object that contains the current sign-up attempt status and methods to create a new sign-up attempt. | - -| Name | Type | -| ----------- | ------------------------------------------------------- | -| `isLoaded` | `true` | -| `setActive` | [`SetActive`](set-active.mdx) | -| `signUp` | [`SignUpResource`](/docs/references/javascript/sign-up) | diff --git a/.typedoc/docs/types/use-user-return.mdx b/.typedoc/docs/types/use-user-return.mdx deleted file mode 100644 index 960725f16ab..00000000000 --- a/.typedoc/docs/types/use-user-return.mdx +++ /dev/null @@ -1,19 +0,0 @@ -## Type declaration - -| Name | Type | Description | -| ------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------ | -| `isLoaded` | `false` | A boolean that indicates whether Clerk has completed initialization. Initially `false`, becomes `true` once Clerk loads. | -| `isSignedIn` | `undefined` | A boolean that returns `true` if the user is signed in. | -| `user` | `undefined` | The `User` object for the current user. | - -| Name | Type | -| ------------ | ------- | -| `isLoaded` | `true` | -| `isSignedIn` | `false` | -| `user` | `null` | - -| Name | Type | -| ------------ | -------------------------------------------------- | -| `isLoaded` | `true` | -| `isSignedIn` | `true` | -| `user` | [`UserResource`](/docs/references/javascript/user) | diff --git a/.typedoc/docs/types/user-organization-invitation-resource.mdx b/.typedoc/docs/types/user-organization-invitation-resource.mdx deleted file mode 100644 index 78976cef403..00000000000 --- a/.typedoc/docs/types/user-organization-invitation-resource.mdx +++ /dev/null @@ -1,28 +0,0 @@ -The `OrganizationInvitation` object is the model around an organization invitation. - -## 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. | - | - -## Methods - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`UserOrganizationInvitationResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/user-resource.mdx b/.typedoc/docs/types/user-resource.mdx deleted file mode 100644 index 385cf6b9539..00000000000 --- a/.typedoc/docs/types/user-resource.mdx +++ /dev/null @@ -1,38 +0,0 @@ -The `User` object holds all of the information for a single user of your application and provides a set of methods to manage their account. Each `User` has at least one authentication [identifier](/docs/authentication/configuration/sign-up-sign-in-options#identifiers), which might be their email address, phone number, or a username. - -A user can be contacted at their primary email address or primary phone number. They can have more than one registered email address, but only one of them will be their primary email address. This goes for phone numbers as well; a user can have more than one, but only one phone number will be their primary. At the same time, a user can also have one or more external accounts by connecting to [social providers](/docs/authentication/social-connections/oauth) such as Google, Apple, Facebook, and many more. - -Finally, a `User` object holds profile data like the user's name, profile picture, and a set of [metadata](/docs/users/metadata) that can be used internally to store arbitrary information. The metadata are split into `publicMetadata` and `privateMetadata`. Both types are set from the [Backend API](/docs/reference/backend-api){{ target: '_blank' }}, but public metadata can also be accessed from the [Frontend API](/docs/reference/frontend-api){{ target: '_blank' }}. - -The ClerkJS SDK provides some helper [methods](#methods) on the `User` object to help retrieve and update user information and authentication status. - -## Properties - -| 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 - -### reload() - -Reload the resource and return the resource itself. - -#### Parameters - -| Parameter | Type | -| --------- | --------------------------- | -| `p?` | `ClerkResourceReloadParams` | - -#### Returns - -`Promise`\<`UserResource`\> - -#### Inherited from - -[`ClerkResource`](clerk-resource.mdx).[`reload`](clerk-resource.mdx#reload) diff --git a/.typedoc/docs/types/without.mdx b/.typedoc/docs/types/without.mdx deleted file mode 100644 index a4185e8e647..00000000000 --- a/.typedoc/docs/types/without.mdx +++ /dev/null @@ -1 +0,0 @@ -Omit without union flattening From 0c3d485d28e4e38282696c7aafb707b9e94f2d07 Mon Sep 17 00:00:00 2001 From: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Date: Fri, 29 Aug 2025 13:35:51 -0400 Subject: [PATCH 12/22] update --- .typedoc/custom-theme.mjs | 5 ++--- typedoc.config.mjs | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.typedoc/custom-theme.mjs b/.typedoc/custom-theme.mjs index 6a923f5e177..f09559956e9 100644 --- a/.typedoc/custom-theme.mjs +++ b/.typedoc/custom-theme.mjs @@ -47,7 +47,7 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { this.partials = { ...superPartials, /** - * This hides the "Experimental" section from the output (by default). + * This hides the "Experimental" text and "Example" section from the output (by default). * @param {import('typedoc').Comment} model * @param {{ headingLevel?: number; showSummary?: boolean; showTags?: boolean; showReturns?: boolean; isTableColumn?: boolean }} [options] */ @@ -62,8 +62,7 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { const res = superPartials.comment(model, options); - const [line, ...linesToInclude] = res.replace(/^\n\n/, '').split('\n'); - return linesToInclude.join('\n'); + return res.replace(/^\n+/, ''); } return superPartials.comment(model, options); }, diff --git a/typedoc.config.mjs b/typedoc.config.mjs index 4c4846944a9..870eec00936 100644 --- a/typedoc.config.mjs +++ b/typedoc.config.mjs @@ -34,6 +34,7 @@ const typedocPluginMarkdownOptions = { hideModifiers: true, hideDefaults: true, hideInherited: true, + hideOverrides: true, }, fileExtension: '.mdx', excludeScopesInPaths: true, From dea5e8ef5414bcc6b54f74b9ac45aba555e3cded Mon Sep 17 00:00:00 2001 From: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Date: Fri, 29 Aug 2025 13:56:05 -0400 Subject: [PATCH 13/22] update logic for hiding methods section --- .typedoc/custom-theme.mjs | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.typedoc/custom-theme.mjs b/.typedoc/custom-theme.mjs index f09559956e9..2f39b79f2e4 100644 --- a/.typedoc/custom-theme.mjs +++ b/.typedoc/custom-theme.mjs @@ -238,25 +238,15 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { const customizedModel = model; customizedModel.typeParameters = undefined; - // Extract the Accessors group (if any) and prevent default rendering for it const originalGroups = customizedModel.groups; - const experimentalGroups = originalGroups?.find(g => - g?.owningReflection?.comment?.modifierTags.has('@experimental'), - ); - - if (experimentalGroups) { - const groupsWithoutMethods = originalGroups?.filter(g => g.title === 'Properties'); - - customizedModel.groups = groupsWithoutMethods; - const nonAccessorOutput = superPartials.memberWithGroups(customizedModel, options); - customizedModel.groups = originalGroups; + // When an interface extends another interface, typedoc will generate a "Methods" group + // We want to hide this group from being rendered + const groupsWithoutMethods = originalGroups?.filter(g => g.title !== 'Methods'); - return nonAccessorOutput; - } - - const accessorsGroup = originalGroups?.find(g => g.title === 'Accessors'); - const groupsWithoutAccessors = originalGroups?.filter(g => g.title !== 'Accessors'); + // Extract the Accessors group (if any) and prevent default rendering for it + const accessorsGroup = groupsWithoutMethods?.find(g => g.title === 'Accessors'); + const groupsWithoutAccessors = groupsWithoutMethods?.filter(g => g.title !== 'Accessors'); customizedModel.groups = groupsWithoutAccessors; const nonAccessorOutput = superPartials.memberWithGroups(customizedModel, options); From a07e9b067cc8d40cbddbeed087a7c2824e2e3501 Mon Sep 17 00:00:00 2001 From: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Date: Mon, 15 Sep 2025 16:59:44 -0400 Subject: [PATCH 14/22] update experimental tags --- .typedoc/custom-theme.mjs | 20 - .../backend/src/api/endpoints/BillingApi.ts | 12 +- .../backend/src/api/resources/CommercePlan.ts | 4 +- .../src/api/resources/CommerceSubscription.ts | 4 +- .../api/resources/CommerceSubscriptionItem.ts | 4 +- packages/backend/src/api/resources/Feature.ts | 2 +- packages/backend/src/api/resources/JSON.ts | 6 +- packages/clerk-js/src/core/clerk.ts | 6 +- packages/expo/src/provider/ClerkProvider.tsx | 4 +- packages/expo/src/provider/singleton/types.ts | 4 +- .../react/src/components/CheckoutButton.tsx | 4 +- .../src/components/PlanDetailsButton.tsx | 4 +- .../components/SubscriptionDetailsButton.tsx | 5 +- .../react/src/components/uiComponents.tsx | 12 +- packages/react/src/hooks/useClerkSignal.ts | 6 +- packages/shared/src/jwtPayloadParser.ts | 4 +- .../src/react/hooks/useOrganization.tsx | 6 +- .../src/react/hooks/useSubscription.tsx | 4 +- packages/shared/src/react/types.ts | 5 +- packages/types/src/apiKeys.ts | 12 +- packages/types/src/clerk.ts | 71 +- packages/types/src/commerce.ts | 805 +++--------------- packages/types/src/json.ts | 98 +-- packages/types/src/jwtv2.ts | 8 +- packages/types/src/state.ts | 6 +- typedoc.config.mjs | 4 +- 26 files changed, 206 insertions(+), 914 deletions(-) diff --git a/.typedoc/custom-theme.mjs b/.typedoc/custom-theme.mjs index 2f39b79f2e4..cf5c7be0b86 100644 --- a/.typedoc/custom-theme.mjs +++ b/.typedoc/custom-theme.mjs @@ -46,26 +46,6 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { this.partials = { ...superPartials, - /** - * This hides the "Experimental" text and "Example" section from the output (by default). - * @param {import('typedoc').Comment} model - * @param {{ headingLevel?: number; showSummary?: boolean; showTags?: boolean; showReturns?: boolean; isTableColumn?: boolean }} [options] - */ - comment: (model, options) => { - if ( - model.hasModifier('@experimental') && - [ReflectionKind.Class, ReflectionKind.Interface].includes(this.page?.model?.kind) - ) { - model.removeModifier('@experimental'); - model.removeTags('@example'); - model.removeTags('@see'); - - const res = superPartials.comment(model, options); - - return res.replace(/^\n+/, ''); - } - return superPartials.comment(model, options); - }, /** * This hides the "Type parameters" section and the signature title from the output (by default). Shows the signature title if the `@displayFunctionSignature` tag is present. * @param {import('typedoc').SignatureReflection} model diff --git a/packages/backend/src/api/endpoints/BillingApi.ts b/packages/backend/src/api/endpoints/BillingApi.ts index ee136fc3dc6..2c0d5a3e67b 100644 --- a/packages/backend/src/api/endpoints/BillingApi.ts +++ b/packages/backend/src/api/endpoints/BillingApi.ts @@ -25,8 +25,7 @@ type CancelSubscriptionItemParams = { export class BillingAPI extends AbstractAPI { /** - * @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. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ public async getPlanList(params?: GetOrganizationListParams) { return this.request>({ @@ -37,8 +36,7 @@ export class BillingAPI extends AbstractAPI { } /** - * @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. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ public async cancelSubscriptionItem(subscriptionItemId: string, params?: CancelSubscriptionItemParams) { this.requireId(subscriptionItemId); @@ -50,8 +48,7 @@ export class BillingAPI extends AbstractAPI { } /** - * @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. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ public async getOrganizationBillingSubscription(organizationId: string) { this.requireId(organizationId); @@ -62,8 +59,7 @@ export class BillingAPI extends AbstractAPI { } /** - * @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. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ public async getUserBillingSubscription(userId: string) { this.requireId(userId); diff --git a/packages/backend/src/api/resources/CommercePlan.ts b/packages/backend/src/api/resources/CommercePlan.ts index 0bf708be820..5f451417c8b 100644 --- a/packages/backend/src/api/resources/CommercePlan.ts +++ b/packages/backend/src/api/resources/CommercePlan.ts @@ -4,9 +4,9 @@ import { Feature } from './Feature'; import type { CommercePlanJSON } from './JSON'; /** - * The `CommercePlan` object is similar to the [`CommercePlanResource`](/docs/references/javascript/types/commerce-plan-resource) object as it holds information about a plan, as well as methods for managing it. However, the `CommercePlan` object is different in that it is used in the [Backend API](https://clerk.com/docs/reference/backend-api/tag/commerce/get/commerce/plans){{ target: '_blank' }} and is not directly accessible from the Frontend API. + * The `CommercePlan` object is similar to the [`CommercePlanResource`](/docs/references/javascript/types/commerce-plan-resource) object as it holds information about a plan, as well as methods for managing it. However, the `CommercePlan` object is different in that it is used in the [Backend API](https://clerk.com/docs/reference/backend-api/tag/commerce/get/commerce/plans) and is not directly accessible from the Frontend API. * - * @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. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export class CommercePlan { constructor( diff --git a/packages/backend/src/api/resources/CommerceSubscription.ts b/packages/backend/src/api/resources/CommerceSubscription.ts index 9c403b10d94..b2996e0af6e 100644 --- a/packages/backend/src/api/resources/CommerceSubscription.ts +++ b/packages/backend/src/api/resources/CommerceSubscription.ts @@ -4,9 +4,9 @@ import { CommerceSubscriptionItem } from './CommerceSubscriptionItem'; import type { CommerceSubscriptionJSON } from './JSON'; /** - * The `CommerceSubscription` object is similar to the [`CommerceSubscriptionResource`](/docs/references/javascript/types/commerce-subscription-resource) object as it holds information about a subscription, as well as methods for managing it. However, the `CommerceSubscription` object is different in that it is used in the [Backend API](https://clerk.com/docs/reference/backend-api/tag/billing/get/organizations/%7Borganization_id%7D/billing/subscription){{ target: '_blank' }} and is not directly accessible from the Frontend API. + * The `CommerceSubscription` object is similar to the [`CommerceSubscriptionResource`](/docs/references/javascript/types/commerce-subscription-resource) object as it holds information about a subscription, as well as methods for managing it. However, the `CommerceSubscription` object is different in that it is used in the [Backend API](https://clerk.com/docs/reference/backend-api/tag/billing/get/organizations/%7Borganization_id%7D/billing/subscription) and is not directly accessible from the Frontend API. * - * @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. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export class CommerceSubscription { constructor( diff --git a/packages/backend/src/api/resources/CommerceSubscriptionItem.ts b/packages/backend/src/api/resources/CommerceSubscriptionItem.ts index 13e91acbc20..51901effdee 100644 --- a/packages/backend/src/api/resources/CommerceSubscriptionItem.ts +++ b/packages/backend/src/api/resources/CommerceSubscriptionItem.ts @@ -4,9 +4,9 @@ import { CommercePlan } from './CommercePlan'; import type { CommerceSubscriptionItemJSON } from './JSON'; /** - * The `CommerceSubscriptionItem` object is similar to the [`CommerceSubscriptionItemResource`](/docs/references/javascript/types/commerce-subscription-item-resource) object as it holds information about a subscription item, as well as methods for managing it. However, the `CommerceSubscriptionItem` object is different in that it is used in the [Backend API](https://clerk.com/docs/reference/backend-api/tag/commerce/get/commerce/subscription_items){{ target: '_blank' }} and is not directly accessible from the Frontend API. + * The `CommerceSubscriptionItem` object is similar to the [`CommerceSubscriptionItemResource`](/docs/references/javascript/types/commerce-subscription-item-resource) object as it holds information about a subscription item, as well as methods for managing it. However, the `CommerceSubscriptionItem` object is different in that it is used in the [Backend API](https://clerk.com/docs/reference/backend-api/tag/commerce/get/commerce/subscription_items) and is not directly accessible from the Frontend API. * - * @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. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export class CommerceSubscriptionItem { constructor( diff --git a/packages/backend/src/api/resources/Feature.ts b/packages/backend/src/api/resources/Feature.ts index 787f9bb8da4..edd384bdc87 100644 --- a/packages/backend/src/api/resources/Feature.ts +++ b/packages/backend/src/api/resources/Feature.ts @@ -3,7 +3,7 @@ import type { FeatureJSON } from './JSON'; /** * The `Feature` object represents a feature of a subscription plan. * - * @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. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export class Feature { constructor( diff --git a/packages/backend/src/api/resources/JSON.ts b/packages/backend/src/api/resources/JSON.ts index 3c08016c17a..19f1cece6bf 100644 --- a/packages/backend/src/api/resources/JSON.ts +++ b/packages/backend/src/api/resources/JSON.ts @@ -827,8 +827,7 @@ export interface FeatureJSON extends ClerkResourceJSON { } /** - * @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. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePlanJSON extends ClerkResourceJSON { object: typeof ObjectType.CommercePlan; @@ -859,8 +858,7 @@ type CommerceSubscriptionItemStatus = | 'upcoming'; /** - * @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. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceSubscriptionItemJSON extends ClerkResourceJSON { object: typeof ObjectType.CommerceSubscriptionItem; diff --git a/packages/clerk-js/src/core/clerk.ts b/packages/clerk-js/src/core/clerk.ts index 807942113bf..e2c4875daea 100644 --- a/packages/clerk-js/src/core/clerk.ts +++ b/packages/clerk-js/src/core/clerk.ts @@ -1152,8 +1152,7 @@ export class Clerk implements ClerkInterface { }; /** - * @experimental - * This API is in early access and may change in future releases. + * @experimental This API is in early access and may change in future releases. * * Mount a api keys component at the target element. * @param targetNode Target to mount the APIKeys component. @@ -1195,8 +1194,7 @@ export class Clerk implements ClerkInterface { }; /** - * @experimental - * This API is in early access and may change in future releases. + * @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. diff --git a/packages/expo/src/provider/ClerkProvider.tsx b/packages/expo/src/provider/ClerkProvider.tsx index b450bf7622d..82e7e05b08f 100644 --- a/packages/expo/src/provider/ClerkProvider.tsx +++ b/packages/expo/src/provider/ClerkProvider.tsx @@ -23,8 +23,8 @@ export type ClerkProviderProps = Without` component to ensure the user is authenticated. * * @example @@ -43,6 +43,8 @@ import { withClerk } from './withClerk'; * * @throws {Error} When rendered outside of a `` component * @throws {Error} When `for="organization"` is used without an active organization context + * + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export const CheckoutButton = withClerk( ({ clerk, children, ...props }: WithClerkProp>) => { diff --git a/packages/react/src/components/PlanDetailsButton.tsx b/packages/react/src/components/PlanDetailsButton.tsx index f69aae6889c..20778f2603c 100644 --- a/packages/react/src/components/PlanDetailsButton.tsx +++ b/packages/react/src/components/PlanDetailsButton.tsx @@ -6,7 +6,7 @@ import { assertSingleChild, normalizeWithDefaultValue, safeExecute } from '../ut import { withClerk } from './withClerk'; /** - * @experimental A button component that opens the Clerk Plan Details drawer when clicked. This component is part of + * A button component that opens the Clerk Plan Details drawer when clicked. This component is part of * Clerk's Billing feature which is available under a public beta. * * @example @@ -31,7 +31,7 @@ import { withClerk } from './withClerk'; * } * ``` * - * @see https://clerk.com/docs/billing/overview + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export const PlanDetailsButton = withClerk( ({ clerk, children, ...props }: WithClerkProp>) => { diff --git a/packages/react/src/components/SubscriptionDetailsButton.tsx b/packages/react/src/components/SubscriptionDetailsButton.tsx index 8f824f793fe..ef9fe27625b 100644 --- a/packages/react/src/components/SubscriptionDetailsButton.tsx +++ b/packages/react/src/components/SubscriptionDetailsButton.tsx @@ -7,8 +7,7 @@ import { assertSingleChild, normalizeWithDefaultValue, safeExecute } from '../ut import { withClerk } from './withClerk'; /** - * @experimental A button component that opens the Clerk Subscription Details drawer when clicked. This component must be rendered - * inside a `` component to ensure the user is authenticated. + * A button component that opens the Clerk Subscription Details drawer when clicked. This component must be rendered inside a `` component to ensure the user is authenticated. * * @example * ```tsx @@ -38,7 +37,7 @@ import { withClerk } from './withClerk'; * @throws {Error} When rendered outside of a `` component * @throws {Error} When `for="organization"` is used without an active organization context * - * @see https://clerk.com/docs/billing/overview + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export const SubscriptionDetailsButton = withClerk( ({ diff --git a/packages/react/src/components/uiComponents.tsx b/packages/react/src/components/uiComponents.tsx index cd0aa40cc09..bb94755afee 100644 --- a/packages/react/src/components/uiComponents.tsx +++ b/packages/react/src/components/uiComponents.tsx @@ -81,8 +81,8 @@ type UserButtonPropsWithoutCustomPages = Without< userProfileProps?: Pick; /** * Adding `asProvider` will defer rendering until the `` component is mounted. - * This API is experimental and may change at any moment. - * @experimental + * + * @experimental This API is experimental and may change at any moment. * @default undefined */ __experimental_asProvider?: boolean; @@ -99,6 +99,7 @@ type OrganizationSwitcherExportType = typeof _OrganizationSwitcher & { /** * The `` component can be used in conjunction with `asProvider` in order to control rendering * of the `` without affecting its configuration or any custom pages that could be mounted + * * @experimental This API is experimental and may change at any moment. */ __experimental_Outlet: typeof OrganizationSwitcherOutlet; @@ -111,8 +112,8 @@ type OrganizationSwitcherPropsWithoutCustomPages = Without< organizationProfileProps?: Pick; /** * Adding `asProvider` will defer rendering until the `` component is mounted. - * This API is experimental and may change at any moment. - * @experimental + * + * @experimental This API is experimental and may change at any moment. * @default undefined */ __experimental_asProvider?: boolean; @@ -607,8 +608,7 @@ export const PricingTable = withClerk( ); /** - * @experimental - * This component is in early access and may change in future releases. + * @experimental This component is in early access and may change in future releases. */ export const APIKeys = withClerk( ({ clerk, component, fallback, ...props }: WithClerkProp) => { diff --git a/packages/react/src/hooks/useClerkSignal.ts b/packages/react/src/hooks/useClerkSignal.ts index 6d71b8fe2b8..3be64283c53 100644 --- a/packages/react/src/hooks/useClerkSignal.ts +++ b/packages/react/src/hooks/useClerkSignal.ts @@ -52,7 +52,6 @@ function useClerkSignal(signal: 'signIn' | 'signUp'): SignInSignalValue | SignUp /** * This hook allows you to access the Signal-based `SignIn` resource. * - * @experimental This experimental API is subject to change. * @example * import { useSignInSignal } from "@clerk/clerk-react/experimental"; * @@ -60,6 +59,8 @@ function useClerkSignal(signal: 'signIn' | 'signUp'): SignInSignalValue | SignUp * const { signIn, errors, fetchStatus } = useSignInSignal(); * // * } + * + * @experimental This experimental API is subject to change. */ export function useSignInSignal() { return useClerkSignal('signIn'); @@ -68,7 +69,6 @@ export function useSignInSignal() { /** * This hook allows you to access the Signal-based `SignUp` resource. * - * @experimental This experimental API is subject to change. * @example * import { useSignUpSignal } from "@clerk/clerk-react/experimental"; * @@ -76,6 +76,8 @@ export function useSignInSignal() { * const { signUp, errors, fetchStatus } = useSignUpSignal(); * // * } + * + * @experimental This experimental API is subject to change. */ export function useSignUpSignal() { return useClerkSignal('signUp'); diff --git a/packages/shared/src/jwtPayloadParser.ts b/packages/shared/src/jwtPayloadParser.ts index 6c3fe5a15f0..6c34f5a0613 100644 --- a/packages/shared/src/jwtPayloadParser.ts +++ b/packages/shared/src/jwtPayloadParser.ts @@ -69,9 +69,9 @@ function buildOrgPermissions({ } /** - * @experimental - * * Resolves the signed-in auth state from JWT claims. + * + * @experimental */ const __experimental_JWTPayloadToAuthObjectProperties = (claims: JwtPayload): SharedSignedInAuthObjectProperties => { let orgId: string | undefined; diff --git a/packages/shared/src/react/hooks/useOrganization.tsx b/packages/shared/src/react/hooks/useOrganization.tsx index ded4b0dda9e..1ed6ce1e691 100644 --- a/packages/shared/src/react/hooks/useOrganization.tsx +++ b/packages/shared/src/react/hooks/useOrganization.tsx @@ -67,13 +67,14 @@ export type UseOrganizationParams = { */ invitations?: true | PaginatedHookConfig; /** - * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. * If set to `true`, all default properties will be used.
* Otherwise, accepts an object with the following optional properties: *
    *
  • `orgId`: A string that filters the subscriptions by the provided organization ID.
  • *
  • Any of the properties described in [Shared properties](#shared-properties).
  • *
+ * + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ subscriptions?: true | PaginatedHookConfig; }; @@ -112,8 +113,9 @@ export type UseOrganizationReturn = */ invitations: PaginatedResourcesWithDefault; /** - * @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. + * + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ subscriptions: PaginatedResourcesWithDefault; } diff --git a/packages/shared/src/react/hooks/useSubscription.tsx b/packages/shared/src/react/hooks/useSubscription.tsx index a9f03ea96a9..444f88455c2 100644 --- a/packages/shared/src/react/hooks/useSubscription.tsx +++ b/packages/shared/src/react/hooks/useSubscription.tsx @@ -25,9 +25,9 @@ type UseSubscriptionParams = { /** * @internal * - * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. - * * Fetches subscription data for the current user or organization. + * + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export const useSubscription = (params?: UseSubscriptionParams) => { useAssertWrappedByClerkProvider(hookName); diff --git a/packages/shared/src/react/types.ts b/packages/shared/src/react/types.ts index 0a63feeaa4d..c98961bc16e 100644 --- a/packages/shared/src/react/types.ts +++ b/packages/shared/src/react/types.ts @@ -110,12 +110,12 @@ export type PagesOrInfiniteConfig = PaginatedHookConfig<{ */ enabled?: boolean; /** - * @experimental * On `cache` mode, no request will be triggered when the hook is mounted and the data will be fetched from the cache. * * @default undefined * * @hidden + * @experimental */ __experimental_mode?: 'cache'; }>; @@ -137,12 +137,13 @@ export type PagesOrInfiniteOptions = { */ pageSize?: number; /** - * @experimental * On `cache` mode, no request will be triggered when the hook is mounted and the data will be fetched from the cache. * * @default undefined * * @hidden + * + * @experimental */ __experimental_mode?: 'cache'; }; diff --git a/packages/types/src/apiKeys.ts b/packages/types/src/apiKeys.ts index 64f74587b18..7074a7c3571 100644 --- a/packages/types/src/apiKeys.ts +++ b/packages/types/src/apiKeys.ts @@ -21,29 +21,25 @@ export interface APIKeyResource extends ClerkResource { export interface APIKeysNamespace { /** - * @experimental - * This API is in early access and may change in future releases. + * @experimental This API is in early access and may change in future releases. * * Retrieves all API keys for the current user or organization. */ getAll(params?: GetAPIKeysParams): Promise; /** - * @experimental - * This API is in early access and may change in future releases. + * @experimental This API is in early access and may change in future releases. * * Retrieves the secret for a given API key ID. */ getSecret(id: string): Promise; /** - * @experimental - * This API is in early access and may change in future releases. + * @experimental This API is in early access and may change in future releases. * * Creates a new API key. */ create(params: CreateAPIKeyParams): Promise; /** - * @experimental - * This API is in early access and may change in future releases. + * @experimental This API is in early access and may change in future releases. * * Revokes a given API key by ID. */ diff --git a/packages/types/src/clerk.ts b/packages/types/src/clerk.ts index 84fb36a8680..5cbd38b1039 100644 --- a/packages/types/src/clerk.ts +++ b/packages/types/src/clerk.ts @@ -230,22 +230,15 @@ export interface Clerk { user: UserResource | null | undefined; /** - * @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. + * + * @experimental This experimental API is subject to change. */ __internal_state: State; /** - * @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 https://clerk.com/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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ billing: CommerceBillingNamespace; @@ -488,8 +481,8 @@ export interface Clerk { /** * 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. - * @experimental + * + * @experimental This experimental API is subject to change. * @param props Optional user verification configuration parameters. */ __experimental_prefetchOrganizationSwitcher: () => void; @@ -1871,14 +1864,7 @@ export type RevokeAPIKeyParams = { }; /** - * @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 https://clerk.com/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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __internal_CheckoutProps = { appearance?: CheckoutTheme; @@ -1897,14 +1883,7 @@ export type __internal_CheckoutProps = { }; /** - * @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 https://clerk.com/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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __experimental_CheckoutButtonProps = { planId: string; @@ -1925,14 +1904,7 @@ export type __experimental_CheckoutButtonProps = { }; /** - * @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 https://clerk.com/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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __internal_PlanDetailsProps = ( | { @@ -1954,14 +1926,7 @@ export type __internal_PlanDetailsProps = ( }; /** - * @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 https://clerk.com/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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __experimental_PlanDetailsButtonProps = ( | { @@ -1985,14 +1950,7 @@ export type __experimental_PlanDetailsButtonProps = ( }; /** - * @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 https://clerk.com/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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __internal_SubscriptionDetailsProps = { /** @@ -2008,14 +1966,7 @@ export type __internal_SubscriptionDetailsProps = { }; /** - * @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 https://clerk.com/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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __experimental_SubscriptionDetailsButtonProps = { /** diff --git a/packages/types/src/commerce.ts b/packages/types/src/commerce.ts index 59973af134f..e40f869df95 100644 --- a/packages/types/src/commerce.ts +++ b/packages/types/src/commerce.ts @@ -11,135 +11,70 @@ type WithOptionalOrgType = T & { }; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceBillingNamespace { /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getPaymentAttempts: (params: GetPaymentAttemptsParams) => 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getPaymentAttempt: (params: { id: string; orgId?: string }) => 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getPlans: (params?: GetPlansParams) => 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getPlan: (params: { id: string }) => 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getSubscription: (params: GetSubscriptionParams) => Promise; /** * @deprecated Use `getSubscription` to fetch a single subscription with its items - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getSubscriptions: ( params: GetSubscriptionsParams, ) => 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getStatements: (params: GetStatementsParams) => 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getStatement: (params: { id: string; orgId?: string }) => 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ startCheckout: (params: CreateCheckoutParams) => 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CommercePayerResourceType = 'org' | 'user'; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type ForPayerType = 'organization' | 'user'; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CommerceSubscriptionStatus = 'active' | 'ended' | 'upcoming' | 'past_due'; @@ -151,41 +86,21 @@ export type CommerceSubscriptionStatus = 'active' | 'ended' | 'upcoming' | 'past export type CommerceSubscriptionPlanPeriod = 'month' | 'annual'; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePaymentSourceMethods { /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ initializePaymentSource: ( params: Exclude, ) => 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ addPaymentSource: (params: Exclude) => 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getPaymentSources: ( params: Exclude, @@ -193,114 +108,54 @@ export interface CommercePaymentSourceMethods { } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetPlansParams = ClerkPaginationParams<{ /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ for?: ForPayerType; }>; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePlanResource extends ClerkResource { 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ fee: CommerceMoneyAmount; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ annualFee: CommerceMoneyAmount; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ annualMonthlyFee: CommerceMoneyAmount; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. * * Specifies the subscriber type this plan is designed for. * @@ -309,57 +164,27 @@ export interface CommercePlanResource extends ClerkResource { */ forPayerType: CommercePayerResourceType; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ features: CommerceFeatureResource[]; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ freeTrialDays: number | null; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ freeTrialEnabled: boolean; } @@ -403,98 +228,53 @@ export interface CommerceFeatureResource extends ClerkResource { export type CommercePaymentSourceStatus = 'active' | 'expired' | 'disconnected'; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetPaymentSourcesParams = WithOptionalOrgType; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type PaymentGateway = 'stripe' | 'paypal'; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type InitializePaymentSourceParams = WithOptionalOrgType<{ /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ gateway: PaymentGateway; }>; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type AddPaymentSourceParams = WithOptionalOrgType<{ /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ gateway: PaymentGateway; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ paymentToken: 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type RemovePaymentSourceParams = WithOptionalOrgType; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type MakeDefaultPaymentSourceParams = WithOptionalOrgType; /** * The `CommercePaymentSourceResource` type represents a payment source for a checkout session. * - * @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 avoid breaking changes. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePaymentSourceResource extends ClerkResource { /** @@ -546,232 +326,112 @@ export interface CommercePaymentSourceResource extends ClerkResource { } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceInitializedPaymentSourceResource extends ClerkResource { /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CommercePaymentChargeType = 'checkout' | 'recurring'; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CommercePaymentStatus = 'pending' | 'paid' | 'failed'; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePaymentResource extends ClerkResource { 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ amount: CommerceMoneyAmount; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ paymentSource: CommercePaymentSourceResource; /** * @deprecated Use `subscriptionItem` instead. - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ subscription: CommerceSubscriptionItemResource; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ subscriptionItem: CommerceSubscriptionItemResource; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ chargeType: CommercePaymentChargeType; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ status: CommercePaymentStatus; } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetPaymentAttemptsParams = WithOptionalOrgType; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetStatementsParams = WithOptionalOrgType; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CommerceStatementStatus = 'open' | 'closed'; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceStatementResource extends ClerkResource { 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ totals: CommerceStatementTotals; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ status: CommerceStatementStatus; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ groups: CommerceStatementGroup[]; } @@ -779,7 +439,7 @@ export interface CommerceStatementResource extends ClerkResource { /** * The `CommerceStatementGroup` type represents a group of payment items within a statement. * - * @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 avoid breaking changes. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceStatementGroup { /** @@ -793,145 +453,71 @@ export interface CommerceStatementGroup { } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetSubscriptionsParams = WithOptionalOrgType; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetSubscriptionParams = { orgId?: 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CancelSubscriptionParams = WithOptionalOrgType; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ + export interface CommerceSubscriptionItemResource extends ClerkResource { 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ //TODO(@COMMERCE): should this be nullable ? 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ plan: CommercePlanResource; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ planPeriod: CommerceSubscriptionPlanPeriod; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ status: CommerceSubscriptionStatus; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ pastDueAt: Date | null; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ periodEnd: Date | null; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ canceledAt: Date | null; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ amount?: CommerceMoneyAmount; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ credit?: { /** @@ -945,140 +531,68 @@ export interface CommerceSubscriptionItemResource extends ClerkResource { amount: CommerceMoneyAmount; }; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ cancel: (params: CancelSubscriptionParams) => 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 - * ```tsx - * - * ``` + * @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. */ isFreeTrial: 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 - * ```tsx - * - * ``` + * The `CommerceSubscriptionResource` type represents a subscription to a plan. + * + * @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. */ export interface CommerceSubscriptionResource extends ClerkResource { /** - * @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 - * - * ``` + * The unique identifier for the subscription. */ 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 - * ```tsx - * - * ``` + * The date when the subscription became active. */ 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 - * ```tsx - * - * ``` + * The date when the subscription was created. */ 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 - * ```tsx - * - * ``` + * Information about the next payment, including the amount and the date it's due. Returns null if there is no upcoming payment. */ nextPayment: { /** - * @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 - * - * ``` + * The amount of the next payment. */ amount: CommerceMoneyAmount; /** - * @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 - * - * ``` + * The date when the next payment is due. */ date: Date; } | null; /** - * @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 - * - * ``` - * - * When at least one subscription item is past due, this property will get populated. + * The date when the subscription became past due, or `null` if the subscription is not past due. */ pastDueAt: Date | null; /** - * @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 - * - * ``` - * - * Due to the free plan subscription item, the top level subscription can either be `active` or `past_due`. + * The current status of the subscription. Due to the free plan subscription item, the top level subscription can either be `active` or `past_due`. */ status: Extract; /** - * @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 - * - * ``` + * The list of items (plans/features) included in this subscription. */ subscriptionItems: CommerceSubscriptionItemResource[]; /** - * @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 - * - * ``` + * The date when the subscription was last updated, or `null` if it hasn't been updated. */ updatedAt: Date | null; /** - * @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 - * - * ``` + * Whether the payer is eligible for a free trial. */ eligibleForFreeTrial?: boolean; } @@ -1086,7 +600,7 @@ export interface CommerceSubscriptionResource extends ClerkResource { /** * The `CommerceMoneyAmount` type represents a monetary value with currency information. * - * @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 avoid breaking changes. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceMoneyAmount { /** @@ -1110,7 +624,7 @@ export interface CommerceMoneyAmount { /** * The `CommerceCheckoutTotals` type represents the total costs, taxes, and other pricing details for a checkout session. * - * @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 avoid breaking changes. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceCheckoutTotals { /** @@ -1142,36 +656,21 @@ export interface CommerceCheckoutTotals { /** * The `CommerceStatementTotals` type represents the total costs, taxes, and other pricing details for a statement. * - * @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 avoid breaking changes. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface CommerceStatementTotals extends Omit {} /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CreateCheckoutParams = WithOptionalOrgType<{ /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ planId: 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ planPeriod: CommerceSubscriptionPlanPeriod; }>; @@ -1179,7 +678,7 @@ export type CreateCheckoutParams = WithOptionalOrgType<{ /** * The `confirm()` method accepts the following parameters. **Only one of `paymentSourceId`, `paymentToken`, or `useTestCard` should be provided.** * - * @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 avoid breaking changes. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type ConfirmCheckoutParams = | { @@ -1212,7 +711,7 @@ export type ConfirmCheckoutParams = /** * The `CommerceCheckoutResource` type represents information about a checkout session. * - * @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 avoid breaking changes. + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceCheckoutResource extends ClerkResource { /** @@ -1264,113 +763,53 @@ export interface CommerceCheckoutResource extends ClerkResource { */ freeTrialEndsAt: Date | null; /** - * @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 - * - * ``` + * The payer associated with the checkout. */ payer: CommercePayerResource; } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePayerResource extends ClerkResource { /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ imageUrl: string | null; /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ userId?: 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ email?: 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ firstName?: 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ lastName?: 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ organizationId?: 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 - * ```tsx - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ organizationName?: string; } diff --git a/packages/types/src/json.ts b/packages/types/src/json.ts index d34c0a0b8f7..101c650ecdf 100644 --- a/packages/types/src/json.ts +++ b/packages/types/src/json.ts @@ -606,12 +606,7 @@ export interface WaitlistJSON extends ClerkResourceJSON { } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceFeatureJSON extends ClerkResourceJSON { object: 'commerce_feature'; @@ -623,12 +618,7 @@ export interface CommerceFeatureJSON extends ClerkResourceJSON { } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePlanJSON extends ClerkResourceJSON { object: 'commerce_plan'; @@ -659,12 +649,7 @@ export interface CommercePlanJSON extends ClerkResourceJSON { } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePaymentSourceJSON extends ClerkResourceJSON { object: 'commerce_payment_source'; @@ -679,12 +664,7 @@ export interface CommercePaymentSourceJSON extends ClerkResourceJSON { } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceInitializedPaymentSourceJSON extends ClerkResourceJSON { object: 'commerce_payment_source_initialize'; @@ -694,12 +674,7 @@ export interface CommerceInitializedPaymentSourceJSON extends ClerkResourceJSON } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceStatementJSON extends ClerkResourceJSON { object: 'commerce_statement'; @@ -711,12 +686,7 @@ export interface CommerceStatementJSON extends ClerkResourceJSON { } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceStatementGroupJSON extends ClerkResourceJSON { object: 'commerce_statement_group'; @@ -725,12 +695,7 @@ export interface CommerceStatementGroupJSON extends ClerkResourceJSON { } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePaymentJSON extends ClerkResourceJSON { object: 'commerce_payment'; @@ -747,12 +712,7 @@ export interface CommercePaymentJSON extends ClerkResourceJSON { } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceSubscriptionItemJSON extends ClerkResourceJSON { object: 'commerce_subscription_item'; @@ -778,12 +738,7 @@ export interface CommerceSubscriptionItemJSON extends ClerkResourceJSON { } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceSubscriptionJSON extends ClerkResourceJSON { object: 'commerce_subscription'; @@ -808,12 +763,7 @@ export interface CommerceSubscriptionJSON extends ClerkResourceJSON { } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceMoneyAmountJSON { amount: number; @@ -823,12 +773,7 @@ export interface CommerceMoneyAmountJSON { } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceCheckoutTotalsJSON { grand_total: CommerceMoneyAmountJSON; @@ -839,23 +784,13 @@ export interface CommerceCheckoutTotalsJSON { } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface CommerceStatementTotalsJSON extends Omit {} /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceCheckoutJSON extends ClerkResourceJSON { object: 'commerce_checkout'; @@ -875,12 +810,7 @@ export interface CommerceCheckoutJSON extends ClerkResourceJSON { } /** - * @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 - * - * ``` + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePayerJSON extends ClerkResourceJSON { object: 'commerce_payer'; diff --git a/packages/types/src/jwtv2.ts b/packages/types/src/jwtv2.ts index 4337cb2fcfc..ca7f1dc0382 100644 --- a/packages/types/src/jwtv2.ts +++ b/packages/types/src/jwtv2.ts @@ -128,9 +128,9 @@ export type VersionedJwtPayload = } | { /** - * @experimental - * * The version of the JWT payload. + * + * @experimental */ v: 2; @@ -145,9 +145,9 @@ export type VersionedJwtPayload = pla?: string; /** - * @experimental - This structure is subject to change. - * * Active organization information. + * + * @experimental This structure is subject to change. */ o?: { /** diff --git a/packages/types/src/state.ts b/packages/types/src/state.ts index 9ec380be623..4438d92fe57 100644 --- a/packages/types/src/state.ts +++ b/packages/types/src/state.ts @@ -140,21 +140,19 @@ export interface State { signUpSignal: SignUpSignal; /** - * @experimental This experimental API is subject to change. - * * An alias for `effect()` from `alien-signals`, which can be used to subscribe to changes from Signals. * * @see https://github.com/stackblitz/alien-signals#usage + * @experimental This experimental API is subject to change. */ __internal_effect: (callback: () => void) => () => void; /** - * @experimental This experimental API is subject to change. - * * An alias for `computed()` from `alien-signals`, which can be used to create a computed Signal that updates when * its dependencies change. * * @see https://github.com/stackblitz/alien-signals#usage + * @experimental This experimental API is subject to change. */ __internal_computed: (getter: (previousValue?: T) => T) => () => T; } diff --git a/typedoc.config.mjs b/typedoc.config.mjs index 4ec1e0ddb99..c3579d6b165 100644 --- a/typedoc.config.mjs +++ b/typedoc.config.mjs @@ -3,7 +3,7 @@ import fs from 'node:fs'; import { OptionDefaults } from 'typedoc'; const IGNORE_LIST = ['.DS_Store', 'dev-cli', 'expo-passkeys', 'testing', 'themes', 'upgrade']; -const CUSTOM_BLOCK_TAGS = ['@unionReturnHeadings', '@displayFunctionSignature', '@paramExtension']; +const CUSTOM_BLOCK_TAGS = ['@unionReturnHeadings', '@displayFunctionSignature', '@paramExtension', '@experimental']; /** * Return an array of relative paths to all folders in the "packages" folder to be used for the "entryPoints" option. @@ -103,7 +103,7 @@ const config = { excludeNotDocumented: true, gitRevision: 'main', blockTags: [...OptionDefaults.blockTags, ...CUSTOM_BLOCK_TAGS], - modifierTags: [...OptionDefaults.modifierTags], + modifierTags: [...OptionDefaults.modifierTags.filter(tag => tag !== '@experimental')], exclude: ['src/**/*.test.ts', 'src/**/*.test.tsx'], readme: 'none', disableGit: true, From 6ff75ef2e46a0684b05ee7051372f7268783e1c9 Mon Sep 17 00:00:00 2001 From: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Date: Mon, 15 Sep 2025 17:00:49 -0400 Subject: [PATCH 15/22] remove snapshot readme --- .../resources/__tests__/README-snapshots.md | 108 ------------------ 1 file changed, 108 deletions(-) delete mode 100644 packages/clerk-js/src/core/resources/__tests__/README-snapshots.md diff --git a/packages/clerk-js/src/core/resources/__tests__/README-snapshots.md b/packages/clerk-js/src/core/resources/__tests__/README-snapshots.md deleted file mode 100644 index c610f201d23..00000000000 --- a/packages/clerk-js/src/core/resources/__tests__/README-snapshots.md +++ /dev/null @@ -1,108 +0,0 @@ -# Snapshot Testing for Clerk Resources - -This directory contains snapshot tests for Clerk resource classes using Vitest. Snapshot tests help ensure that the structure and serialization of resource objects remain consistent over time. - -## What are Snapshot Tests? - -Snapshot tests capture the output of a function or object and store it as a "snapshot" file. When the test runs again, the current output is compared against the stored snapshot. If they differ, the test fails, alerting you to potential breaking changes. - -## How to Add Snapshot Tests - -### Basic Pattern - -```typescript -describe('ResourceName Snapshots', () => { - it('should match snapshot for resource instance structure', () => { - const resource = new ResourceName({ - // Provide test data that represents a typical resource - id: 'test_123', - name: 'Test Resource', - // ... other properties - }); - - const snapshot = { - id: resource.id, - name: resource.name, - // Include relevant public properties - }; - - expect(snapshot).toMatchSnapshot(); - }); -}); -``` - -### Testing Different States - -```typescript -it('should match snapshot for empty/null state', () => { - const resource = new ResourceName({ - id: 'empty_test', - name: null, - // ... other properties with null/empty values - } as any); // Use 'as any' if TypeScript complains about null values - - expect({ - id: resource.id, - name: resource.name, - }).toMatchSnapshot(); -}); -``` - -### Testing Serialization Methods - -For resources with `__internal_toSnapshot()` methods: - -```typescript -it('should match snapshot for __internal_toSnapshot method', () => { - const resource = new ResourceName(testData); - expect(resource.__internal_toSnapshot()).toMatchSnapshot(); -}); -``` - -## Best Practices - -1. **Use Fixed Dates**: Use `vi.useFakeTimers()` and `vi.setSystemTime()` to ensure consistent timestamps in snapshots. - -2. **Include Relevant Properties**: Focus on public API properties that consumers rely on, not internal implementation details. - -3. **Test Edge Cases**: Include tests for null values, empty states, and different configurations. - -4. **Keep Snapshots Small**: Focus on the essential structure rather than including every property. - -5. **Update When Intentional**: When you intentionally change a resource's structure, update the snapshots using `npm test -- --update-snapshots`. - -## Running Snapshot Tests - -```bash -# Run all resource tests -npm test -- src/core/resources/__tests__/*.spec.ts - -# Run specific test file -npm test -- src/core/resources/__tests__/Client.spec.ts - -# Update snapshots when structure changes intentionally -npm test -- --update-snapshots -``` - -## Examples - -See the following files for examples: - -- `Client.spec.ts` - Complex resource with nested objects -- `Environment.spec.ts` - Resource with configuration objects -- `Image.spec.ts` - Simple resource with basic properties - -## When Snapshots Fail - -When a snapshot test fails: - -1. **Review the diff** to understand what changed -2. **Determine if the change is intentional**: - - If yes: Update the snapshot with `--update-snapshots` - - If no: Fix the code to maintain backward compatibility -3. **Consider the impact** on API consumers -4. **Update documentation** if the public API changed - -## Snapshot Files - -Snapshot files are stored in `__snapshots__/` directories and should be committed to version control. They serve as documentation of your resource structures and help catch unintended changes. From dc69c34e2da1c83f9a474a21e683e83c6c869f62 Mon Sep 17 00:00:00 2001 From: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Date: Mon, 15 Sep 2025 17:01:47 -0400 Subject: [PATCH 16/22] forgot to save --- packages/types/src/commerce.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/types/src/commerce.ts b/packages/types/src/commerce.ts index e40f869df95..9bb89c07193 100644 --- a/packages/types/src/commerce.ts +++ b/packages/types/src/commerce.ts @@ -521,11 +521,7 @@ export interface CommerceSubscriptionItemResource extends ClerkResource { */ credit?: { /** - * @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 - * + * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. * ``` */ amount: CommerceMoneyAmount; From a87f384f340758deb02c5cb109a6f28a4b2cc18e Mon Sep 17 00:00:00 2001 From: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Date: Mon, 15 Sep 2025 17:43:30 -0400 Subject: [PATCH 17/22] cleanup code ticks in comment --- packages/types/src/commerce.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/types/src/commerce.ts b/packages/types/src/commerce.ts index 9bb89c07193..02501012e7f 100644 --- a/packages/types/src/commerce.ts +++ b/packages/types/src/commerce.ts @@ -522,7 +522,6 @@ export interface CommerceSubscriptionItemResource extends ClerkResource { credit?: { /** * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. - * ``` */ amount: CommerceMoneyAmount; }; From a82e880f223b90df00369087a3096d6aec8d8260 Mon Sep 17 00:00:00 2001 From: panteliselef Date: Tue, 16 Sep 2025 20:44:19 +0300 Subject: [PATCH 18/22] drop package.json changes --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 7ebd921f25c..208845ebf3a 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "test:integration:ap-flows": "pnpm test:integration:base --grep @ap-flows", "test:integration:astro": "E2E_APP_ID=astro.* pnpm test:integration:base --grep @astro", "test:integration:base": "pnpm playwright test --config integration/playwright.config.ts", - "test:integration:billing": "E2E_APP_ID=withBilling.next.appRouter pnpm test:integration:base --grep @billing", + "test:integration:billing": "E2E_APP_ID=withBilling.* pnpm test:integration:base --grep @billing", "test:integration:cleanup": "pnpm playwright test --config integration/playwright.cleanup.config.ts", "test:integration:custom": "pnpm test:integration:base --grep @custom", "test:integration:deployment:nextjs": "pnpm playwright test --config integration/playwright.deployments.config.ts", @@ -53,7 +53,6 @@ "test:integration:tanstack-react-start": "E2E_APP_ID=tanstack.react-start pnpm test:integration:base --grep @tanstack-react-start", "test:integration:vue": "E2E_APP_ID=vue.vite pnpm test:integration:base --grep @vue", "test:typedoc": "pnpm typedoc:generate && cd ./.typedoc && vitest run", - "test:typedoc:update": "pnpm typedoc:generate && cd ./.typedoc && vitest --u", "turbo:clean": "turbo daemon clean", "typedoc:generate": "pnpm build:declarations && pnpm typedoc:generate:skip-build", "typedoc:generate:skip-build": "typedoc --tsconfig tsconfig.typedoc.json && rm -rf .typedoc/docs && mv .typedoc/temp-docs .typedoc/docs", From 6dc4f19dcf3f9112c3b60312432d51e6b87cd63d Mon Sep 17 00:00:00 2001 From: panteliselef Date: Tue, 16 Sep 2025 20:47:40 +0300 Subject: [PATCH 19/22] add changeset --- .changeset/quiet-signs-peel.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .changeset/quiet-signs-peel.md diff --git a/.changeset/quiet-signs-peel.md b/.changeset/quiet-signs-peel.md new file mode 100644 index 00000000000..2a7469158c7 --- /dev/null +++ b/.changeset/quiet-signs-peel.md @@ -0,0 +1,10 @@ +--- +'@clerk/clerk-js': patch +'@clerk/backend': patch +'@clerk/shared': patch +'@clerk/clerk-react': patch +'@clerk/types': patch +'@clerk/clerk-expo': patch +--- + +Update jsdocs mentions of `@experimental` tag. From 3c104a0998cde603bc144b2d96be2eefdc2cdc36 Mon Sep 17 00:00:00 2001 From: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Date: Tue, 16 Sep 2025 15:07:04 -0400 Subject: [PATCH 20/22] update pinning reference --- .../backend/src/api/endpoints/BillingApi.ts | 11 +- packages/backend/src/api/factory.ts | 3 +- .../backend/src/api/resources/CommercePlan.ts | 2 +- .../src/api/resources/CommerceSubscription.ts | 2 +- .../api/resources/CommerceSubscriptionItem.ts | 2 +- packages/backend/src/api/resources/Feature.ts | 2 +- packages/backend/src/api/resources/JSON.ts | 4 +- .../react/src/components/CheckoutButton.tsx | 2 +- .../src/components/PlanDetailsButton.tsx | 2 +- .../components/SubscriptionDetailsButton.tsx | 2 +- .../src/react/hooks/useSubscription.tsx | 2 +- packages/types/src/clerk.ts | 14 +- packages/types/src/commerce.ts | 214 +++++++++--------- packages/types/src/json.ts | 28 +-- 14 files changed, 144 insertions(+), 146 deletions(-) diff --git a/packages/backend/src/api/endpoints/BillingApi.ts b/packages/backend/src/api/endpoints/BillingApi.ts index a66367283bd..35f4da09ed0 100644 --- a/packages/backend/src/api/endpoints/BillingApi.ts +++ b/packages/backend/src/api/endpoints/BillingApi.ts @@ -33,7 +33,7 @@ type ExtendSubscriptionItemFreeTrialParams = { export class BillingAPI extends AbstractAPI { /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ public async getPlanList(params?: GetOrganizationListParams) { return this.request>({ @@ -44,7 +44,7 @@ export class BillingAPI extends AbstractAPI { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ public async cancelSubscriptionItem(subscriptionItemId: string, params?: CancelSubscriptionItemParams) { this.requireId(subscriptionItemId); @@ -56,7 +56,7 @@ export class BillingAPI extends AbstractAPI { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ public async extendSubscriptionItemFreeTrial( subscriptionItemId: string, @@ -71,8 +71,7 @@ export class BillingAPI extends AbstractAPI { } /** - * @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. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ public async getOrganizationBillingSubscription(organizationId: string) { this.requireId(organizationId); @@ -83,7 +82,7 @@ export class BillingAPI extends AbstractAPI { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ public async getUserBillingSubscription(userId: string) { this.requireId(userId); diff --git a/packages/backend/src/api/factory.ts b/packages/backend/src/api/factory.ts index 31df669eeb9..46f81d00f5f 100644 --- a/packages/backend/src/api/factory.ts +++ b/packages/backend/src/api/factory.ts @@ -54,8 +54,7 @@ export function createBackendApiClient(options: CreateBackendApiOptions) { betaFeatures: new BetaFeaturesAPI(request), blocklistIdentifiers: new BlocklistIdentifierAPI(request), /** - * @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. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ billing: new BillingAPI(request), clients: new ClientAPI(request), diff --git a/packages/backend/src/api/resources/CommercePlan.ts b/packages/backend/src/api/resources/CommercePlan.ts index 5f451417c8b..225e809a67b 100644 --- a/packages/backend/src/api/resources/CommercePlan.ts +++ b/packages/backend/src/api/resources/CommercePlan.ts @@ -6,7 +6,7 @@ import type { CommercePlanJSON } from './JSON'; /** * The `CommercePlan` object is similar to the [`CommercePlanResource`](/docs/references/javascript/types/commerce-plan-resource) object as it holds information about a plan, as well as methods for managing it. However, the `CommercePlan` object is different in that it is used in the [Backend API](https://clerk.com/docs/reference/backend-api/tag/commerce/get/commerce/plans) and is not directly accessible from the Frontend API. * - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export class CommercePlan { constructor( diff --git a/packages/backend/src/api/resources/CommerceSubscription.ts b/packages/backend/src/api/resources/CommerceSubscription.ts index b2996e0af6e..58f945df24d 100644 --- a/packages/backend/src/api/resources/CommerceSubscription.ts +++ b/packages/backend/src/api/resources/CommerceSubscription.ts @@ -6,7 +6,7 @@ import type { CommerceSubscriptionJSON } from './JSON'; /** * The `CommerceSubscription` object is similar to the [`CommerceSubscriptionResource`](/docs/references/javascript/types/commerce-subscription-resource) object as it holds information about a subscription, as well as methods for managing it. However, the `CommerceSubscription` object is different in that it is used in the [Backend API](https://clerk.com/docs/reference/backend-api/tag/billing/get/organizations/%7Borganization_id%7D/billing/subscription) and is not directly accessible from the Frontend API. * - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export class CommerceSubscription { constructor( diff --git a/packages/backend/src/api/resources/CommerceSubscriptionItem.ts b/packages/backend/src/api/resources/CommerceSubscriptionItem.ts index 51901effdee..19e8ed9c598 100644 --- a/packages/backend/src/api/resources/CommerceSubscriptionItem.ts +++ b/packages/backend/src/api/resources/CommerceSubscriptionItem.ts @@ -6,7 +6,7 @@ import type { CommerceSubscriptionItemJSON } from './JSON'; /** * The `CommerceSubscriptionItem` object is similar to the [`CommerceSubscriptionItemResource`](/docs/references/javascript/types/commerce-subscription-item-resource) object as it holds information about a subscription item, as well as methods for managing it. However, the `CommerceSubscriptionItem` object is different in that it is used in the [Backend API](https://clerk.com/docs/reference/backend-api/tag/commerce/get/commerce/subscription_items) and is not directly accessible from the Frontend API. * - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export class CommerceSubscriptionItem { constructor( diff --git a/packages/backend/src/api/resources/Feature.ts b/packages/backend/src/api/resources/Feature.ts index edd384bdc87..dd91efa965d 100644 --- a/packages/backend/src/api/resources/Feature.ts +++ b/packages/backend/src/api/resources/Feature.ts @@ -3,7 +3,7 @@ import type { FeatureJSON } from './JSON'; /** * The `Feature` object represents a feature of a subscription plan. * - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export class Feature { constructor( diff --git a/packages/backend/src/api/resources/JSON.ts b/packages/backend/src/api/resources/JSON.ts index 2091bf323ab..b5d67828d8f 100644 --- a/packages/backend/src/api/resources/JSON.ts +++ b/packages/backend/src/api/resources/JSON.ts @@ -828,7 +828,7 @@ export interface FeatureJSON extends ClerkResourceJSON { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePlanJSON extends ClerkResourceJSON { object: typeof ObjectType.CommercePlan; @@ -859,7 +859,7 @@ type CommerceSubscriptionItemStatus = | 'upcoming'; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceSubscriptionItemJSON extends ClerkResourceJSON { object: typeof ObjectType.CommerceSubscriptionItem; diff --git a/packages/react/src/components/CheckoutButton.tsx b/packages/react/src/components/CheckoutButton.tsx index f7562972a86..6b0869cd921 100644 --- a/packages/react/src/components/CheckoutButton.tsx +++ b/packages/react/src/components/CheckoutButton.tsx @@ -44,7 +44,7 @@ import { withClerk } from './withClerk'; * @throws {Error} When rendered outside of a `` component * @throws {Error} When `for="organization"` is used without an active organization context * - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export const CheckoutButton = withClerk( ({ clerk, children, ...props }: WithClerkProp>) => { diff --git a/packages/react/src/components/PlanDetailsButton.tsx b/packages/react/src/components/PlanDetailsButton.tsx index 20778f2603c..7ce6c1f3e41 100644 --- a/packages/react/src/components/PlanDetailsButton.tsx +++ b/packages/react/src/components/PlanDetailsButton.tsx @@ -31,7 +31,7 @@ import { withClerk } from './withClerk'; * } * ``` * - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export const PlanDetailsButton = withClerk( ({ clerk, children, ...props }: WithClerkProp>) => { diff --git a/packages/react/src/components/SubscriptionDetailsButton.tsx b/packages/react/src/components/SubscriptionDetailsButton.tsx index ef9fe27625b..618b32dc88e 100644 --- a/packages/react/src/components/SubscriptionDetailsButton.tsx +++ b/packages/react/src/components/SubscriptionDetailsButton.tsx @@ -37,7 +37,7 @@ import { withClerk } from './withClerk'; * @throws {Error} When rendered outside of a `` component * @throws {Error} When `for="organization"` is used without an active organization context * - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export const SubscriptionDetailsButton = withClerk( ({ diff --git a/packages/shared/src/react/hooks/useSubscription.tsx b/packages/shared/src/react/hooks/useSubscription.tsx index d53684ce9ce..99064b74b80 100644 --- a/packages/shared/src/react/hooks/useSubscription.tsx +++ b/packages/shared/src/react/hooks/useSubscription.tsx @@ -27,7 +27,7 @@ type UseSubscriptionParams = { * * Fetches subscription data for the current user or organization. * - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export const useSubscription = (params?: UseSubscriptionParams) => { useAssertWrappedByClerkProvider(hookName); diff --git a/packages/types/src/clerk.ts b/packages/types/src/clerk.ts index 34af2d53465..b0e62ed6897 100644 --- a/packages/types/src/clerk.ts +++ b/packages/types/src/clerk.ts @@ -238,7 +238,7 @@ export interface Clerk { __internal_state: State; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ billing: CommerceBillingNamespace; @@ -1869,7 +1869,7 @@ export type RevokeAPIKeyParams = { }; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __internal_CheckoutProps = { appearance?: CheckoutTheme; @@ -1888,7 +1888,7 @@ export type __internal_CheckoutProps = { }; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __experimental_CheckoutButtonProps = { planId: string; @@ -1909,7 +1909,7 @@ export type __experimental_CheckoutButtonProps = { }; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __internal_PlanDetailsProps = ( | { @@ -1931,7 +1931,7 @@ export type __internal_PlanDetailsProps = ( }; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __experimental_PlanDetailsButtonProps = ( | { @@ -1955,7 +1955,7 @@ export type __experimental_PlanDetailsButtonProps = ( }; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __internal_SubscriptionDetailsProps = { /** @@ -1971,7 +1971,7 @@ export type __internal_SubscriptionDetailsProps = { }; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __experimental_SubscriptionDetailsButtonProps = { /** diff --git a/packages/types/src/commerce.ts b/packages/types/src/commerce.ts index 7971b34f30d..7087fdc925e 100644 --- a/packages/types/src/commerce.ts +++ b/packages/types/src/commerce.ts @@ -11,62 +11,62 @@ type WithOptionalOrgType = T & { }; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceBillingNamespace { /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getPaymentAttempts: (params: GetPaymentAttemptsParams) => 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getPaymentAttempt: (params: { id: string; orgId?: string }) => 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getPlans: (params?: GetPlansParams) => 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getPlan: (params: { id: string }) => 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getSubscription: (params: GetSubscriptionParams) => 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getStatements: (params: GetStatementsParams) => 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getStatement: (params: { id: string; orgId?: string }) => 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ startCheckout: (params: CreateCheckoutParams) => 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CommercePayerResourceType = 'org' | 'user'; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type ForPayerType = 'organization' | 'user'; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CommerceSubscriptionStatus = 'active' | 'ended' | 'upcoming' | 'past_due'; @@ -78,21 +78,21 @@ export type CommerceSubscriptionStatus = 'active' | 'ended' | 'upcoming' | 'past export type CommerceSubscriptionPlanPeriod = 'month' | 'annual'; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePaymentSourceMethods { /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ initializePaymentSource: ( params: Exclude, ) => 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ addPaymentSource: (params: Exclude) => 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getPaymentSources: ( params: Exclude, @@ -100,54 +100,54 @@ export interface CommercePaymentSourceMethods { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetPlansParams = ClerkPaginationParams<{ /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ for?: ForPayerType; }>; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePlanResource extends ClerkResource { 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ fee: CommerceMoneyAmount; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ annualFee: CommerceMoneyAmount; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ annualMonthlyFee: CommerceMoneyAmount; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. * * Specifies the subscriber type this plan is designed for. * @@ -156,27 +156,27 @@ export interface CommercePlanResource extends ClerkResource { */ forPayerType: CommercePayerResourceType; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ features: CommerceFeatureResource[]; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ freeTrialDays: number | null; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ freeTrialEnabled: boolean; } @@ -184,7 +184,7 @@ export interface CommercePlanResource extends ClerkResource { /** * The `CommerceFeatureResource` type represents a feature of a subscription plan. * - * @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. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceFeatureResource extends ClerkResource { /** @@ -220,53 +220,53 @@ export interface CommerceFeatureResource extends ClerkResource { export type CommercePaymentSourceStatus = 'active' | 'expired' | 'disconnected'; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetPaymentSourcesParams = WithOptionalOrgType; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type PaymentGateway = 'stripe' | 'paypal'; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type InitializePaymentSourceParams = WithOptionalOrgType<{ /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ gateway: PaymentGateway; }>; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type AddPaymentSourceParams = WithOptionalOrgType<{ /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ gateway: PaymentGateway; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ paymentToken: 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type RemovePaymentSourceParams = WithOptionalOrgType; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type MakeDefaultPaymentSourceParams = WithOptionalOrgType; /** * The `CommercePaymentSourceResource` type represents a payment source for a checkout session. * - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePaymentSourceResource extends ClerkResource { /** @@ -318,112 +318,112 @@ export interface CommercePaymentSourceResource extends ClerkResource { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceInitializedPaymentSourceResource extends ClerkResource { /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CommercePaymentChargeType = 'checkout' | 'recurring'; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CommercePaymentStatus = 'pending' | 'paid' | 'failed'; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePaymentResource extends ClerkResource { 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ amount: CommerceMoneyAmount; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ paymentSource: CommercePaymentSourceResource; /** * @deprecated Use `subscriptionItem` instead. - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ subscription: CommerceSubscriptionItemResource; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ subscriptionItem: CommerceSubscriptionItemResource; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ chargeType: CommercePaymentChargeType; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ status: CommercePaymentStatus; } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetPaymentAttemptsParams = WithOptionalOrgType; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetStatementsParams = WithOptionalOrgType; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CommerceStatementStatus = 'open' | 'closed'; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceStatementResource extends ClerkResource { 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ totals: CommerceStatementTotals; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ status: CommerceStatementStatus; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ groups: CommerceStatementGroup[]; } @@ -431,7 +431,7 @@ export interface CommerceStatementResource extends ClerkResource { /** * The `CommerceStatementGroup` type represents a group of payment items within a statement. * - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceStatementGroup { /** @@ -445,79 +445,79 @@ export interface CommerceStatementGroup { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetSubscriptionParams = { orgId?: 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CancelSubscriptionParams = WithOptionalOrgType; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceSubscriptionItemResource extends ClerkResource { 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ //TODO(@COMMERCE): should this be nullable ? 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ plan: CommercePlanResource; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ planPeriod: CommerceSubscriptionPlanPeriod; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ status: CommerceSubscriptionStatus; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ pastDueAt: Date | null; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ periodEnd: Date | null; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ canceledAt: Date | null; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ amount?: CommerceMoneyAmount; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ credit?: { /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ amount: CommerceMoneyAmount; }; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ cancel: (params: CancelSubscriptionParams) => 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. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ isFreeTrial: boolean; } @@ -525,7 +525,7 @@ export interface CommerceSubscriptionItemResource extends ClerkResource { /** * The `CommerceSubscriptionResource` type represents a subscription to a plan. * - * @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. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceSubscriptionResource extends ClerkResource { /** @@ -582,7 +582,7 @@ export interface CommerceSubscriptionResource extends ClerkResource { /** * The `CommerceMoneyAmount` type represents a monetary value with currency information. * - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceMoneyAmount { /** @@ -606,7 +606,7 @@ export interface CommerceMoneyAmount { /** * The `CommerceCheckoutTotals` type represents the total costs, taxes, and other pricing details for a checkout session. * - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceCheckoutTotals { /** @@ -638,21 +638,21 @@ export interface CommerceCheckoutTotals { /** * The `CommerceStatementTotals` type represents the total costs, taxes, and other pricing details for a statement. * - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface CommerceStatementTotals extends Omit {} /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CreateCheckoutParams = WithOptionalOrgType<{ /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ planId: 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ planPeriod: CommerceSubscriptionPlanPeriod; }>; @@ -660,7 +660,7 @@ export type CreateCheckoutParams = WithOptionalOrgType<{ /** * The `confirm()` method accepts the following parameters. **Only one of `paymentSourceId`, `paymentToken`, or `useTestCard` should be provided.** * - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type ConfirmCheckoutParams = | { @@ -693,7 +693,7 @@ export type ConfirmCheckoutParams = /** * The `CommerceCheckoutResource` type represents information about a checkout session. * - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceCheckoutResource extends ClerkResource { /** @@ -751,47 +751,47 @@ export interface CommerceCheckoutResource extends ClerkResource { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePayerResource extends ClerkResource { /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ imageUrl: string | null; /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ userId?: 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ email?: 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ firstName?: 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ lastName?: 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ organizationId?: 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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ organizationName?: string; } diff --git a/packages/types/src/json.ts b/packages/types/src/json.ts index 8c7ee24856b..3b25b07c633 100644 --- a/packages/types/src/json.ts +++ b/packages/types/src/json.ts @@ -626,7 +626,7 @@ export interface WaitlistJSON extends ClerkResourceJSON { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceFeatureJSON extends ClerkResourceJSON { object: 'commerce_feature'; @@ -638,7 +638,7 @@ export interface CommerceFeatureJSON extends ClerkResourceJSON { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePlanJSON extends ClerkResourceJSON { object: 'commerce_plan'; @@ -669,7 +669,7 @@ export interface CommercePlanJSON extends ClerkResourceJSON { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePaymentSourceJSON extends ClerkResourceJSON { object: 'commerce_payment_source'; @@ -684,7 +684,7 @@ export interface CommercePaymentSourceJSON extends ClerkResourceJSON { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceInitializedPaymentSourceJSON extends ClerkResourceJSON { object: 'commerce_payment_source_initialize'; @@ -694,7 +694,7 @@ export interface CommerceInitializedPaymentSourceJSON extends ClerkResourceJSON } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceStatementJSON extends ClerkResourceJSON { object: 'commerce_statement'; @@ -706,7 +706,7 @@ export interface CommerceStatementJSON extends ClerkResourceJSON { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceStatementGroupJSON extends ClerkResourceJSON { object: 'commerce_statement_group'; @@ -715,7 +715,7 @@ export interface CommerceStatementGroupJSON extends ClerkResourceJSON { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePaymentJSON extends ClerkResourceJSON { object: 'commerce_payment'; @@ -732,7 +732,7 @@ export interface CommercePaymentJSON extends ClerkResourceJSON { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceSubscriptionItemJSON extends ClerkResourceJSON { object: 'commerce_subscription_item'; @@ -758,7 +758,7 @@ export interface CommerceSubscriptionItemJSON extends ClerkResourceJSON { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceSubscriptionJSON extends ClerkResourceJSON { object: 'commerce_subscription'; @@ -783,7 +783,7 @@ export interface CommerceSubscriptionJSON extends ClerkResourceJSON { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceMoneyAmountJSON { amount: number; @@ -793,7 +793,7 @@ export interface CommerceMoneyAmountJSON { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceCheckoutTotalsJSON { grand_total: CommerceMoneyAmountJSON; @@ -804,13 +804,13 @@ export interface CommerceCheckoutTotalsJSON { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface CommerceStatementTotalsJSON extends Omit {} /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceCheckoutJSON extends ClerkResourceJSON { object: 'commerce_checkout'; @@ -830,7 +830,7 @@ export interface CommerceCheckoutJSON extends ClerkResourceJSON { } /** - * @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](https://docs.renovatebot.com/dependency-pinning/#what-is-dependency-pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePayerJSON extends ClerkResourceJSON { object: 'commerce_payer'; From 76769f0ebc5a27a482a74b3c988e92e3a76697d7 Mon Sep 17 00:00:00 2001 From: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Date: Wed, 17 Sep 2025 14:20:28 -0400 Subject: [PATCH 21/22] fix link --- .../backend/src/api/endpoints/BillingApi.ts | 10 +- .../backend/src/api/resources/CommercePlan.ts | 2 +- .../src/api/resources/CommerceSubscription.ts | 2 +- .../api/resources/CommerceSubscriptionItem.ts | 2 +- packages/backend/src/api/resources/Feature.ts | 2 +- packages/backend/src/api/resources/JSON.ts | 4 +- .../react/src/components/CheckoutButton.tsx | 2 +- .../src/components/PlanDetailsButton.tsx | 2 +- .../components/SubscriptionDetailsButton.tsx | 2 +- .../src/react/hooks/useSubscription.tsx | 2 +- packages/types/src/clerk.ts | 14 +- packages/types/src/commerce.ts | 212 +++++++++--------- packages/types/src/json.ts | 28 +-- 13 files changed, 142 insertions(+), 142 deletions(-) diff --git a/packages/backend/src/api/endpoints/BillingApi.ts b/packages/backend/src/api/endpoints/BillingApi.ts index 35f4da09ed0..8e6dc97f2fe 100644 --- a/packages/backend/src/api/endpoints/BillingApi.ts +++ b/packages/backend/src/api/endpoints/BillingApi.ts @@ -33,7 +33,7 @@ type ExtendSubscriptionItemFreeTrialParams = { export class BillingAPI extends AbstractAPI { /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ public async getPlanList(params?: GetOrganizationListParams) { return this.request>({ @@ -44,7 +44,7 @@ export class BillingAPI extends AbstractAPI { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ public async cancelSubscriptionItem(subscriptionItemId: string, params?: CancelSubscriptionItemParams) { this.requireId(subscriptionItemId); @@ -56,7 +56,7 @@ export class BillingAPI extends AbstractAPI { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ public async extendSubscriptionItemFreeTrial( subscriptionItemId: string, @@ -71,7 +71,7 @@ export class BillingAPI extends AbstractAPI { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ public async getOrganizationBillingSubscription(organizationId: string) { this.requireId(organizationId); @@ -82,7 +82,7 @@ export class BillingAPI extends AbstractAPI { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ public async getUserBillingSubscription(userId: string) { this.requireId(userId); diff --git a/packages/backend/src/api/resources/CommercePlan.ts b/packages/backend/src/api/resources/CommercePlan.ts index 225e809a67b..d23143922f4 100644 --- a/packages/backend/src/api/resources/CommercePlan.ts +++ b/packages/backend/src/api/resources/CommercePlan.ts @@ -6,7 +6,7 @@ import type { CommercePlanJSON } from './JSON'; /** * The `CommercePlan` object is similar to the [`CommercePlanResource`](/docs/references/javascript/types/commerce-plan-resource) object as it holds information about a plan, as well as methods for managing it. However, the `CommercePlan` object is different in that it is used in the [Backend API](https://clerk.com/docs/reference/backend-api/tag/commerce/get/commerce/plans) and is not directly accessible from the Frontend API. * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export class CommercePlan { constructor( diff --git a/packages/backend/src/api/resources/CommerceSubscription.ts b/packages/backend/src/api/resources/CommerceSubscription.ts index 58f945df24d..8dcea408b37 100644 --- a/packages/backend/src/api/resources/CommerceSubscription.ts +++ b/packages/backend/src/api/resources/CommerceSubscription.ts @@ -6,7 +6,7 @@ import type { CommerceSubscriptionJSON } from './JSON'; /** * The `CommerceSubscription` object is similar to the [`CommerceSubscriptionResource`](/docs/references/javascript/types/commerce-subscription-resource) object as it holds information about a subscription, as well as methods for managing it. However, the `CommerceSubscription` object is different in that it is used in the [Backend API](https://clerk.com/docs/reference/backend-api/tag/billing/get/organizations/%7Borganization_id%7D/billing/subscription) and is not directly accessible from the Frontend API. * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export class CommerceSubscription { constructor( diff --git a/packages/backend/src/api/resources/CommerceSubscriptionItem.ts b/packages/backend/src/api/resources/CommerceSubscriptionItem.ts index 19e8ed9c598..0340cdff561 100644 --- a/packages/backend/src/api/resources/CommerceSubscriptionItem.ts +++ b/packages/backend/src/api/resources/CommerceSubscriptionItem.ts @@ -6,7 +6,7 @@ import type { CommerceSubscriptionItemJSON } from './JSON'; /** * The `CommerceSubscriptionItem` object is similar to the [`CommerceSubscriptionItemResource`](/docs/references/javascript/types/commerce-subscription-item-resource) object as it holds information about a subscription item, as well as methods for managing it. However, the `CommerceSubscriptionItem` object is different in that it is used in the [Backend API](https://clerk.com/docs/reference/backend-api/tag/commerce/get/commerce/subscription_items) and is not directly accessible from the Frontend API. * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export class CommerceSubscriptionItem { constructor( diff --git a/packages/backend/src/api/resources/Feature.ts b/packages/backend/src/api/resources/Feature.ts index dd91efa965d..ca3821ddf50 100644 --- a/packages/backend/src/api/resources/Feature.ts +++ b/packages/backend/src/api/resources/Feature.ts @@ -3,7 +3,7 @@ import type { FeatureJSON } from './JSON'; /** * The `Feature` object represents a feature of a subscription plan. * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export class Feature { constructor( diff --git a/packages/backend/src/api/resources/JSON.ts b/packages/backend/src/api/resources/JSON.ts index b5d67828d8f..d2e40456107 100644 --- a/packages/backend/src/api/resources/JSON.ts +++ b/packages/backend/src/api/resources/JSON.ts @@ -828,7 +828,7 @@ export interface FeatureJSON extends ClerkResourceJSON { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePlanJSON extends ClerkResourceJSON { object: typeof ObjectType.CommercePlan; @@ -859,7 +859,7 @@ type CommerceSubscriptionItemStatus = | 'upcoming'; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceSubscriptionItemJSON extends ClerkResourceJSON { object: typeof ObjectType.CommerceSubscriptionItem; diff --git a/packages/react/src/components/CheckoutButton.tsx b/packages/react/src/components/CheckoutButton.tsx index 6b0869cd921..634089aa223 100644 --- a/packages/react/src/components/CheckoutButton.tsx +++ b/packages/react/src/components/CheckoutButton.tsx @@ -44,7 +44,7 @@ import { withClerk } from './withClerk'; * @throws {Error} When rendered outside of a `` component * @throws {Error} When `for="organization"` is used without an active organization context * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export const CheckoutButton = withClerk( ({ clerk, children, ...props }: WithClerkProp>) => { diff --git a/packages/react/src/components/PlanDetailsButton.tsx b/packages/react/src/components/PlanDetailsButton.tsx index 7ce6c1f3e41..20baf173605 100644 --- a/packages/react/src/components/PlanDetailsButton.tsx +++ b/packages/react/src/components/PlanDetailsButton.tsx @@ -31,7 +31,7 @@ import { withClerk } from './withClerk'; * } * ``` * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export const PlanDetailsButton = withClerk( ({ clerk, children, ...props }: WithClerkProp>) => { diff --git a/packages/react/src/components/SubscriptionDetailsButton.tsx b/packages/react/src/components/SubscriptionDetailsButton.tsx index 618b32dc88e..9153414b11c 100644 --- a/packages/react/src/components/SubscriptionDetailsButton.tsx +++ b/packages/react/src/components/SubscriptionDetailsButton.tsx @@ -37,7 +37,7 @@ import { withClerk } from './withClerk'; * @throws {Error} When rendered outside of a `` component * @throws {Error} When `for="organization"` is used without an active organization context * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export const SubscriptionDetailsButton = withClerk( ({ diff --git a/packages/shared/src/react/hooks/useSubscription.tsx b/packages/shared/src/react/hooks/useSubscription.tsx index 99064b74b80..53c48df8c08 100644 --- a/packages/shared/src/react/hooks/useSubscription.tsx +++ b/packages/shared/src/react/hooks/useSubscription.tsx @@ -27,7 +27,7 @@ type UseSubscriptionParams = { * * Fetches subscription data for the current user or organization. * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export const useSubscription = (params?: UseSubscriptionParams) => { useAssertWrappedByClerkProvider(hookName); diff --git a/packages/types/src/clerk.ts b/packages/types/src/clerk.ts index b0e62ed6897..f35bc68abf0 100644 --- a/packages/types/src/clerk.ts +++ b/packages/types/src/clerk.ts @@ -238,7 +238,7 @@ export interface Clerk { __internal_state: State; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ billing: CommerceBillingNamespace; @@ -1869,7 +1869,7 @@ export type RevokeAPIKeyParams = { }; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __internal_CheckoutProps = { appearance?: CheckoutTheme; @@ -1888,7 +1888,7 @@ export type __internal_CheckoutProps = { }; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __experimental_CheckoutButtonProps = { planId: string; @@ -1909,7 +1909,7 @@ export type __experimental_CheckoutButtonProps = { }; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __internal_PlanDetailsProps = ( | { @@ -1931,7 +1931,7 @@ export type __internal_PlanDetailsProps = ( }; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __experimental_PlanDetailsButtonProps = ( | { @@ -1955,7 +1955,7 @@ export type __experimental_PlanDetailsButtonProps = ( }; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __internal_SubscriptionDetailsProps = { /** @@ -1971,7 +1971,7 @@ export type __internal_SubscriptionDetailsProps = { }; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type __experimental_SubscriptionDetailsButtonProps = { /** diff --git a/packages/types/src/commerce.ts b/packages/types/src/commerce.ts index 8ea2729d6e2..2c16de1aea9 100644 --- a/packages/types/src/commerce.ts +++ b/packages/types/src/commerce.ts @@ -11,62 +11,62 @@ type WithOptionalOrgType = T & { }; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceBillingNamespace { /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getPaymentAttempts: (params: GetPaymentAttemptsParams) => 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getPaymentAttempt: (params: { id: string; orgId?: string }) => 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getPlans: (params?: GetPlansParams) => 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getPlan: (params: { id: string }) => 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getSubscription: (params: GetSubscriptionParams) => 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getStatements: (params: GetStatementsParams) => 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getStatement: (params: { id: string; orgId?: string }) => 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ startCheckout: (params: CreateCheckoutParams) => 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CommercePayerResourceType = 'org' | 'user'; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type ForPayerType = 'organization' | 'user'; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CommerceSubscriptionStatus = 'active' | 'ended' | 'upcoming' | 'past_due'; @@ -78,21 +78,21 @@ export type CommerceSubscriptionStatus = 'active' | 'ended' | 'upcoming' | 'past export type CommerceSubscriptionPlanPeriod = 'month' | 'annual'; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePaymentSourceMethods { /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ initializePaymentSource: ( params: Exclude, ) => 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ addPaymentSource: (params: Exclude) => 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ getPaymentSources: ( params: Exclude, @@ -100,54 +100,54 @@ export interface CommercePaymentSourceMethods { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetPlansParams = ClerkPaginationParams<{ /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ for?: ForPayerType; }>; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePlanResource extends ClerkResource { 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ fee: CommerceMoneyAmount; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ annualFee: CommerceMoneyAmount; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ annualMonthlyFee: CommerceMoneyAmount; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. * * Specifies the subscriber type this plan is designed for. * @@ -156,27 +156,27 @@ export interface CommercePlanResource extends ClerkResource { */ forPayerType: CommercePayerResourceType; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ features: CommerceFeatureResource[]; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ freeTrialDays: number | null; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ freeTrialEnabled: boolean; } @@ -184,7 +184,7 @@ export interface CommercePlanResource extends ClerkResource { /** * The `CommerceFeatureResource` type represents a feature of a subscription plan. * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceFeatureResource extends ClerkResource { /** @@ -220,53 +220,53 @@ export interface CommerceFeatureResource extends ClerkResource { export type CommercePaymentSourceStatus = 'active' | 'expired' | 'disconnected'; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetPaymentSourcesParams = WithOptionalOrgType; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type PaymentGateway = 'stripe' | 'paypal'; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type InitializePaymentSourceParams = WithOptionalOrgType<{ /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ gateway: PaymentGateway; }>; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type AddPaymentSourceParams = WithOptionalOrgType<{ /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ gateway: PaymentGateway; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ paymentToken: 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type RemovePaymentSourceParams = WithOptionalOrgType; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type MakeDefaultPaymentSourceParams = WithOptionalOrgType; /** * The `CommercePaymentSourceResource` type represents a payment source for a checkout session. * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePaymentSourceResource extends ClerkResource { /** @@ -318,107 +318,107 @@ export interface CommercePaymentSourceResource extends ClerkResource { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceInitializedPaymentSourceResource extends ClerkResource { /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CommercePaymentChargeType = 'checkout' | 'recurring'; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CommercePaymentStatus = 'pending' | 'paid' | 'failed'; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePaymentResource extends ClerkResource { 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ amount: CommerceMoneyAmount; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ paymentSource: CommercePaymentSourceResource; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ subscriptionItem: CommerceSubscriptionItemResource; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ chargeType: CommercePaymentChargeType; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ status: CommercePaymentStatus; } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetPaymentAttemptsParams = WithOptionalOrgType; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetStatementsParams = WithOptionalOrgType; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CommerceStatementStatus = 'open' | 'closed'; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceStatementResource extends ClerkResource { 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ totals: CommerceStatementTotals; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ status: CommerceStatementStatus; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ groups: CommerceStatementGroup[]; } @@ -426,7 +426,7 @@ export interface CommerceStatementResource extends ClerkResource { /** * The `CommerceStatementGroup` type represents a group of payment items within a statement. * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceStatementGroup { /** @@ -440,79 +440,79 @@ export interface CommerceStatementGroup { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type GetSubscriptionParams = { orgId?: 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CancelSubscriptionParams = WithOptionalOrgType; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceSubscriptionItemResource extends ClerkResource { 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ //TODO(@COMMERCE): should this be nullable ? 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ plan: CommercePlanResource; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ planPeriod: CommerceSubscriptionPlanPeriod; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ status: CommerceSubscriptionStatus; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ pastDueAt: Date | null; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ periodEnd: Date | null; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ canceledAt: Date | null; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ amount?: CommerceMoneyAmount; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ credit?: { /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ amount: CommerceMoneyAmount; }; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ cancel: (params: CancelSubscriptionParams) => 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ isFreeTrial: boolean; } @@ -520,7 +520,7 @@ export interface CommerceSubscriptionItemResource extends ClerkResource { /** * The `CommerceSubscriptionResource` type represents a subscription to a plan. * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceSubscriptionResource extends ClerkResource { /** @@ -577,7 +577,7 @@ export interface CommerceSubscriptionResource extends ClerkResource { /** * The `CommerceMoneyAmount` type represents a monetary value with currency information. * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceMoneyAmount { /** @@ -601,7 +601,7 @@ export interface CommerceMoneyAmount { /** * The `CommerceCheckoutTotals` type represents the total costs, taxes, and other pricing details for a checkout session. * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceCheckoutTotals { /** @@ -633,21 +633,21 @@ export interface CommerceCheckoutTotals { /** * The `CommerceStatementTotals` type represents the total costs, taxes, and other pricing details for a statement. * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface CommerceStatementTotals extends Omit {} /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type CreateCheckoutParams = WithOptionalOrgType<{ /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ planId: 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ planPeriod: CommerceSubscriptionPlanPeriod; }>; @@ -655,7 +655,7 @@ export type CreateCheckoutParams = WithOptionalOrgType<{ /** * The `confirm()` method accepts the following parameters. **Only one of `paymentSourceId`, `paymentToken`, or `useTestCard` should be provided.** * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export type ConfirmCheckoutParams = | { @@ -688,7 +688,7 @@ export type ConfirmCheckoutParams = /** * The `CommerceCheckoutResource` type represents information about a checkout session. * - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceCheckoutResource extends ClerkResource { /** @@ -746,47 +746,47 @@ export interface CommerceCheckoutResource extends ClerkResource { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePayerResource extends ClerkResource { /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ imageUrl: string | null; /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ userId?: 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ email?: 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ firstName?: 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ lastName?: 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ organizationId?: 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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ organizationName?: string; } diff --git a/packages/types/src/json.ts b/packages/types/src/json.ts index 3b25b07c633..9c41cb7861e 100644 --- a/packages/types/src/json.ts +++ b/packages/types/src/json.ts @@ -626,7 +626,7 @@ export interface WaitlistJSON extends ClerkResourceJSON { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceFeatureJSON extends ClerkResourceJSON { object: 'commerce_feature'; @@ -638,7 +638,7 @@ export interface CommerceFeatureJSON extends ClerkResourceJSON { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePlanJSON extends ClerkResourceJSON { object: 'commerce_plan'; @@ -669,7 +669,7 @@ export interface CommercePlanJSON extends ClerkResourceJSON { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePaymentSourceJSON extends ClerkResourceJSON { object: 'commerce_payment_source'; @@ -684,7 +684,7 @@ export interface CommercePaymentSourceJSON extends ClerkResourceJSON { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceInitializedPaymentSourceJSON extends ClerkResourceJSON { object: 'commerce_payment_source_initialize'; @@ -694,7 +694,7 @@ export interface CommerceInitializedPaymentSourceJSON extends ClerkResourceJSON } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceStatementJSON extends ClerkResourceJSON { object: 'commerce_statement'; @@ -706,7 +706,7 @@ export interface CommerceStatementJSON extends ClerkResourceJSON { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceStatementGroupJSON extends ClerkResourceJSON { object: 'commerce_statement_group'; @@ -715,7 +715,7 @@ export interface CommerceStatementGroupJSON extends ClerkResourceJSON { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePaymentJSON extends ClerkResourceJSON { object: 'commerce_payment'; @@ -732,7 +732,7 @@ export interface CommercePaymentJSON extends ClerkResourceJSON { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceSubscriptionItemJSON extends ClerkResourceJSON { object: 'commerce_subscription_item'; @@ -758,7 +758,7 @@ export interface CommerceSubscriptionItemJSON extends ClerkResourceJSON { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceSubscriptionJSON extends ClerkResourceJSON { object: 'commerce_subscription'; @@ -783,7 +783,7 @@ export interface CommerceSubscriptionJSON extends ClerkResourceJSON { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceMoneyAmountJSON { amount: number; @@ -793,7 +793,7 @@ export interface CommerceMoneyAmountJSON { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceCheckoutTotalsJSON { grand_total: CommerceMoneyAmountJSON; @@ -804,13 +804,13 @@ export interface CommerceCheckoutTotalsJSON { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ // eslint-disable-next-line @typescript-eslint/no-empty-object-type export interface CommerceStatementTotalsJSON extends Omit {} /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommerceCheckoutJSON extends ClerkResourceJSON { object: 'commerce_checkout'; @@ -830,7 +830,7 @@ export interface CommerceCheckoutJSON extends ClerkResourceJSON { } /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ export interface CommercePayerJSON extends ClerkResourceJSON { object: 'commerce_payer'; From b36edf5f4b15d47c845beba439c82148f2f5a918 Mon Sep 17 00:00:00 2001 From: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Date: Wed, 17 Sep 2025 14:20:28 -0400 Subject: [PATCH 22/22] fix link --- packages/backend/src/api/factory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/api/factory.ts b/packages/backend/src/api/factory.ts index 46f81d00f5f..6c82869a46e 100644 --- a/packages/backend/src/api/factory.ts +++ b/packages/backend/src/api/factory.ts @@ -54,7 +54,7 @@ export function createBackendApiClient(options: CreateBackendApiOptions) { betaFeatures: new BetaFeaturesAPI(request), blocklistIdentifiers: new BlocklistIdentifierAPI(request), /** - * @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](/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. + * @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](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes. */ billing: new BillingAPI(request), clients: new ClientAPI(request),