Skip to main content

Usage with TypeScript SDK

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