Detects all contract addresses in your project, then fetches and stores each smart contract’s ABI in memory (inside
improving the performance of the SDK when using functions such as
Once the ABIs are cached locally, the SDK becomes strongly typed when interacting with your smart contracts.
Providing you with Intellisense and type-checking when using functions such as
contract.call, in the TypeScript SDK,
in the React SDK.
npx thirdweb generate
After the first generation, a
thirdweb.json file is created at the root of your project containing configuration for the command:
// An example thirdweb.json file
To add additional contracts to the generation process, add a new object into the
contracts array in the
postinstall script is also created that performs the
after your dependencies are installed; enabling the same ABI caching process and performance improvements in your deployment environments.
You can view and customize the script inside of your
The command recursively checks all files in your project for valid smart contract addresses and fetches the ABIs for each contract.
The ABIs are then stored locally in the projects
Functions that require the fetching of a smart contract such as
useContract will now use the cached ABIs instead of
fetching them each time the function is called. This improves the performance of your application and allows the SDK to become strongly
typed when interacting with your smart contracts.
npx thirdweb generate [options]
Path to project
Optional parameter to use passed in secret key, most useful for continuous integration use cases