Skip to main content

Updates the current instance.

function update(params: UpdateParams): Promise<void>
  • Name
    allowedOrigins?
    Type
    string[]
    Description

    For browser-like stacks such as browser extensions, Electron, or Capacitor.js, the instance allowed origins need to be updated with the request origin value. For Chrome extensions popup, background, or service worker pages the origin is chrome-extension://extension_uiid. For Electron apps the default origin is http://localhost:3000. For Capacitor.js, the origin is capacitor://localhost.

  • Name
    clerkJsVersion?
    Type
    string | null
    Description

    The npm version for @clerk/clerk-js.

  • Name
    developmentOrigin?
    Type
    string | null
    Description

    The development origin for the instance.

  • Name
    enhancedEmailDeliverability?
    Type
    boolean | null
    Description

    Whether the instance should send emails from "" instead of your domain. This can be helpful if you do not have a high domain reputation.

  • Name
    hibp?
    Type
    boolean | null
    Description

    Whether the instance should be using the Have I Been Pwned (HIBP) service to check passwords for breaches.

  • Name
    preferredSignInStrategyWhenPasswordRequired?
    Type
    "password" | "otp" | "" | null
    Description

    Overrides the sign-in strategy that is preferred when a password is required. The value is only consulted when a password is required, and is dormant otherwise. Pass an empty string to clear the override. Passing null or undefined leaves the current value unchanged.

  • Name
    supportEmail?
    Type
    string | null
    Description

    The support email for the instance.

  • Name
    testMode?
    Type
    boolean | null
    Description

    Toggles test mode for this instance, allowing the use of test email addresses and phone numbers. Defaults to true for development instances.

  • Name
    urlBasedSessionSyncing?
    Type
    boolean | null
    Description

    Whether the instance should use URL-based session syncing in development mode (i.e. without third-party cookies).

Note

Using clerkClient varies based on the SDK you're using. Refer to the overview for usage details, including guidance on how to access the userId and other properties.

const response = await clerkClient.instances.update({
  testMode: true,
})

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint PATCH/instance. See the BAPI reference for more information.

Feedback

What did you think of this content?

Last updated on