ThirdwebProvider
The ThirdwebProvider is a wrapper component that provides access to all of the SDK’s hooks and UI components.
API Key
You will require an API key to use thirdweb's infrastructure services with the SDK.
you need to first obtain an API key from the dashboard and then copy the "Client ID" and pass it to the ThirdwebProvider as the clientId prop.
Wrap your app in the ThirdwebProvider to access the SDK’s functionality from anywhere in your app.
The activeChain prop determines which chain you want your app to be operating on.
It defaults to "ethereum" if activeChain prop is not provided.
If you are using one of our default chains, provide the name of the chain as a string to the activeChain prop.
If the chain you are looking for is not one of default supported chains, you can import a chain from the @thirdweb-dev/chains package which has 1000+ chains.
Override the default values (such as an RPC URL) for any given chain.
By default, the @thirdweb-dev/chains provides free-to-use RPCs. No configuration required!
Using the spread syntax,
you can override any properties of a chain, such as the rpc field.
If your chain is not included in the @thirdweb-dev/chains package,
you can provide the chain information yourself to the activeChain prop.
If you are running a local node using a tool such as Hardhat or
Anvil,
provide "localhost" as the activeChain prop, (or Localhost imported from @thirdweb-dev/chains).
Deploy or import your contracts to the dashboard to interact with them.
The configuration object for setting up Auth, allowing users to sign in with their wallet.
| Property | Type | Description | 
|---|---|---|
| authUrl | string | The backend URL of the authentication endpoints. For example, if your endpoints are at /api/auth/login,/api/auth/logout, etc. then this should be set to/api/auth. | 
| domain | string | The frontend domain used to generate the login payload. This domain should match the domain used on your auth backend. | 
| secureStorage | ISecureStorage | Secure storage to use when working with JWT tokens. ** By default auth uses cookies so no need to set this unless you want to specifically use JWT tokens ** | 
When the user has connected their wallet to your site, this flag determines whether or not you want to automatically connect to the last connected wallet when user visits your site again in the future.
Defaults to true
The clientId prop is required to use the thirdweb infrastructure services with the SDK. You can get a client ID by creating an API key on thirdweb dashboard.
This Metadata is passed to the wallet. Some wallets use this information to display the metadata of the app to the user when a user is connecting the wallet to your app.
If no dAppMeta prop is set, it defaults to below object:
| Property | Type | Description | 
|---|---|---|
| name | string | the name of your app | 
| description | string | optional - a description of your app | 
| logoUrl | string | optional - a URL that points to a logo (or favicon) of your app | 
| url | string | optional - the URL where your app is hosted | 
| isDarkMode | boolean | optional - whether to show the connect dialog in dark mode or not | 
Object that contains all text used for thirdweb components.
It allows you to change the language used in UI components or override the texts used in the UI.
You can add support for any language you want just by passing an object with the required strings.
More info in our Locale Reference
If you are using React Query and have your own QueryClient,
you can pass it as the queryClient prop to use this client instead of the SDK's default client.
Override any of the default values for the SDK.
Gas settings, gasless transactions, RPC configuration, and more.
Override the default Storage interface used by the SDK.
Allows you to create an instance of ThirdwebStorage with your own customized config, and pass it to the SDK.
This requires the @thirdweb-dev/storage package to be installed.
An array of chains supported by your app.
You can import chains from @thirdweb-dev/chains which contains 1000+ chains.
If not provided, It defaults to below shown default chains.
An array of wallets that your app supports.
Wallets provided here appear in the ConnectWallet Modal and allow you to use the wallet connection hooks.
Learn more about connecting wallets and the options available.
Sets the theme for all thirdweb components.
By default it is set to "dark".
theme can be set to either "dark" or "light" or a custom theme object.
You can also import the lightTheme or darkTheme functions from @thirdweb-dev/react-native to use the default themes as base and overrides parts of it.
More info in our Theme Reference