401 Unauthorized

What it means

The thirdweb client ID or secret key was not provided or is restricted the API Key configuration.

Common examples:

  1. The domain is not configured in Allowed Domains.

  2. If building a mobile app, the bundle ID is not configured in Allowed Bundle IDs.

  3. If initializing the SDK from the backend, the secret key was not provided.

Solution

Allowed Domains

  1. Visit the settings for your API key on the thirdweb dashboard

  2. Click on the “Edit” Button and view the settings for allowed domains

  3. Enter your domain in the allowed domain section & save your settings.

Bundle IDs

  1. Visit the settings for your API key on the thirdweb dashboard

  2. Click on the “Edit” Button and under "Access Restrictions” head over to “Bundle IDs (iOS, Andriod, Games)

  3. Enter you app name in the “Allowed Bundle IDs” input & click on “Save”


Backend SDK

Provide the secret key when initializing the SDK:

const client = createThirdwebClient({
  secretKey: ,
});