Usage with TypeScript SDK
thirdweb's Typescript SDK allows you to interact with smart contracts, sign messages, and utilize common standards such as tokens, NFTs, and marketplaces; all with built-in RPC URLs, IPFS gateways, and more.
You can initialize the SDK using a wallet instance as shown below
import { MetaMaskWallet } from "@thirdweb-dev/wallets";
import { ThirdwebSDK } from "@thirdweb-dev/sdk";
// Instantiate the wallet you want to use
const wallet = new MetaMaskWallet();
// connect wallet
await wallet.connect();
// Instantiate the SDK using the wallet
const sdk = ThirdwebSDK.fromWallet(wallet, "ethereum", {
clientId: "YOUR_CLIENT_ID", // Use client id if using on the client side, get it from dashboard settings
secretKey: "YOUR_SECRET_KEY", // Use secret key if using on the server, get it from dashboard settings
});
// sdk is now ready to use