Supercharged thirdweb SDK with Insight: Faster, More Reliable Blockchain Queries

We're excited to announce a major enhancement to the thirdweb TypeScript SDK that will significantly improve the developer experience when building blockchain applications. With release 5.95.0
, we've supercharged the SDK by integrating it with Insight - our in-house indexer - replacing traditional RPC calls for fetching contract state, events, balances, NFT metadata, and more.
The Power of Insight
Until now, the thirdweb SDK has relied primarily on RPC calls to fetch on-chain data. While functional, this approach sometimes faced limitations in terms of speed, reliability, and functionality. By integrating Insight directly into our SDK, we've addressed these challenges head-on, offering:
- Significantly faster queries for contract events, balances, and NFTs
- Enhanced reliability with reduced dependency on mutli roundtrip RPC calls
- Cross-chain functionality that lets you query data across multiple blockchains in a single call
- Advanced filtering capabilities for more precise data retrieval
What's New in the SDK
New capabilities in the Connect UI components
The Connect UI modal now uses Insight to give your users a full wallet experience directly in your websites:
- Shows all ERC20 token balances
- Show all NFTs
- Shows past transactions of the connected wallet
You can now view all your tokens and NFTs in the connect modal
Supercharged Existing Functions
Your favorite thirdweb functions have been turbocharged with Insight integration:
getContractEvents
getOwnedNFTs
getNFTs
getNFT
These functions now automatically leverage our indexer on supported chains, with a graceful fallback to traditional RPC calls when needed.
If you're already using those functions in your app, no changes needed on your end, you'll just get the improved functionality out of the box.
If for any reason you need to turn off that behavior, you can pass useIndexer: false
to always use RPC.
New Insight Namespace
We've added a dedicated Insight
namespace with powerful new functions:
Insight.getOwnedTokens()
- Get ERC20 tokens owned by an address across multiple chainsInsight.getOwnedNFTs()
- Get NFTs (ERC721 and ERC1155) owned by an addressInsight.getNFTs()
- Get NFTs (ERC721 and ERC1155) for a given contractInsight.getNFT()
- Get NFTs metadata for a given contract and tokenIdInsight.getTransactions()
- Get all transactions for a given wallet addressInsight.getContractEvents()
- Query indexed events with advanced filtering options
You can import those with import { Insight } from "thirdweb"
New Standalone Package: @thirdweb-dev/insight
For developers who need direct access to our indexer API, we've released a standalone package: @thirdweb-dev/insight
. This lightweight API wrapper provides:
- Typed functions, request bodies, and responses
- Always stays in sync with the Insight API
- Perfect for backend applications requiring optimized blockchain data access, without the rest of the SDK
Hands-on Examples
For the existing functions, you will get the improved functionality out of the box without any changes. If you want to use the new multichain capabilities directly, here's some examples using the new Insight
namespace:
Get ERC20 Tokens Across Multiple Chains
With just a few lines of code, you can now retrieve all ERC20 tokens owned by an address across Base, Polygon, and Arbitrum networks simultaneously!
Fetch Owned NFTs
Get Transaction History
Query Indexed Contract Events
Using the Standalone Insight Package
For developers who want low level access to the Insight API with type-safe functions, here's how to use the standalone @thirdweb-dev/insight
package:
Configuration
Example Usage
These functions will map one to one with the Insight OpenAPI spec and will stay in sync as the service changes.
Getting Started
These new features are available now in thirdweb
SDK v5.95.0 and the new @thirdweb-dev/insight
v1.0.0 package.
To get started:
Looking for dotnet/unity? It's already out, head over to the dotnet documentation to learn more.
What's Next?
This Insight integration is just the beginning. We're continuously working to enhance the thirdweb developer experience with more powerful indexing capabilities, additional cross-chain functionality, and deeper integration with our developer tools ecosystem.
Stay tuned for more updates, and as always, happy building!
For more detailed documentation on these new features, visit portal.thirdweb.com.