Skip to main content

Creates a new OAuth application.

Returns the created OAuthApplication object.

function create(params: CreateOAuthApplicationParams): Promise<OAuthApplication>
  • Name
    name
    Type
    string
    Description

    A descriptive name for the OAuth application (e.g., "My Web App", "My Mobile App"). Maximum length: 256 characters.

  • Name
    public?
    Type
    boolean | null
    Description

    Whether the OAuth application is public. If true, the Proof Key of Code Exchange (PKCE) flow can be used.

  • Name
    redirectUris?
    Type
    string[] | null
    Description

    An array of redirect URIs for the OAuth application.

  • Name
    scopes?
    Type
    string | null
    Description

    Scopes for the OAuth application that dictate the user payload of the OAuth user info endpoint. Available scopes are profile, email, public_metadata, private_metadata. Provide the requested scopes as a string, separated by spaces.

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.oauthApplications.create({
  name: 'oauthapp_123',
  redirect_uris: [''],
  scopes: 'profile email public_metadata',
  public: null,
})

Backend API (BAPI) endpoint

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

Feedback

What did you think of this content?

Last updated on