401 Unauthorized
What it means
The thirdweb client ID or secret key was not provided or is restricted the API Key configuration.
Common examples:
- The domain is not configured in Allowed Domains.
- If building a mobile app, the bundle ID is not configured in Allowed Bundle IDs.
- If initializing the SDK from the backend, the secret key was not provided.
Solution
Allowed Domains
- Visit the settings for your API key on the thirdweb dashboard
.png?table=block&id=58b89181-a4ef-4705-a329-c1db3515bc92&cache=v2)
- Click on the “Edit” Button and view the settings for allowed domains

- Enter your domain in the allowed domain section & save your settings.
- Use
*
to authorize all subdomains. Example: *.thirdweb.com accepts all sites ending in .thirdweb.com. - Enter
localhost:<port>
to authorize local URL

.png?table=block&id=5d0a7621-bca3-4fd1-9bb6-38668ee8f8df&cache=v2)
Bundle IDs
- Visit the settings for your API key on the thirdweb dashboard
.png?table=block&id=1095d18c-dca3-43b6-91ba-c42ab8f4f772&cache=v2)
- Click on the “Edit” Button and under "Access Restrictions” head over to “Bundle IDs (iOS, Andriod, Games)

- 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: <thirdweb secret key>,
});
Did this answer your question?
😞
😐
🤩