Skip to main content

Verifies a M2M token. Must be authenticated by a Machine Secret Key.

Returns the verified M2MToken object.

function verify(params: VerifyM2MTokenParams): Promise<M2MToken>
  • Name
    machineSecretKey?
    Type
    string
    Description

    The custom machine secret key for authentication. If not provided, the SDK will use the value from the environment variables.

  • Name
    token
    Type
    string
    Description

    The M2M token to verify.

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.m2m.verify({ token })

Backend API (BAPI) endpoint

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

Feedback

What did you think of this content?

Last updated on