Skip to main content

ThirdwebSDK.fromSigner

Instantiate the ThirdwebSDK in read-write mode using a Signer.

This is useful when using the SDK on the client-side, such as when using our React SDK.

Use the useSigner hook to get the currently connected wallets signer on the client.

The SDK will be instantiated on the chain that the signer is connected to.

Usage

import { ThirdwebSDK } from "@thirdweb-dev/sdk";

// An example of a signer using the ethers library
import ethers from "ethers";
const signer = new ethers.Wallet("{{private_key}}");

const sdk = ThirdwebSDK.fromSigner(signer);