ThirdwebSDKProvider
The ThirdwebSDKProvider is used when you want to provide your own wallet connection logic and just use the thirdweb SDK to
interact with smart contracts and the blockchain. This means you can use everything in the SDK except for wallet connection-related components and hooks.
Wrap your app in the ThirdwebSDKProvider to access the SDK's functionality from anywhere in your app. Provide a signer
prop to inform the SDK of the wallet you want to use, among other configuration options.
Wrap your app in the ThirdwebSDKProvider to access the SDK's functionality from anywhere in your app.
A signer is an abstraction of an Ethereum Account, which can be used to sign messages and initiate transactions.
Since the ThirdwebSDKProvider is used when you want to provide your own wallet connection logic,
you will need to provide a signer prop to inform the SDK of the wallet you want to use to sign transactions.
Libraries such as ethers.js, web3.js, wagmi, etc. all provide ways to get a signer.
To use this signer with the SDK, pass it to the signer prop. If the signer is connected, the SDK will use this wallet
to sign transactions for all write operations on the blockchain.
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.
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 ** | 
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.
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.