Skip to main content
Docs

verifyToken()

Verifies an M2M token. Must be authenticated via a Machine Secret Key.

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

    Custom machine secret key for authentication. If not provided, the SDK will use the value from the environment variable.

  • Name
    token
    Type
    string
    Description

    The M2M token to verify.

Note

Importing clerkClient varies based on your framework. Refer to the Backend SDK overview for usage details, including guidance on how to access the userId and other properties.

const response = await clerkClient.m2m.verifyToken({ 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