This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Get an instance of the thirdweb SDK based on a private key.
const sdk = ThirdwebSDK.fromPrivateKey("SecretPrivateKey", "mainnet");
static fromPrivateKey(privateKey: string, network: ChainOrRpc, options?: SDKOptions, storage?: ThirdwebStorage): ThirdwebSDK;
|privateKey||string||the private key - **DO NOT EXPOSE THIS TO THE PUBLIC**|
|network||ChainOrRpc||the network (chain) to connect to (e.g. "mainnet", "rinkeby", "polygon", "mumbai"...) or a fully formed RPC url|
|options||SDKOptions||(Optional) the SDK options to use|
|storage||ThirdwebStorage||(Optional) optional storage implementation to use|
an instance of the SDK
This should only be used for backend services or scripts, with the private key stored in a secure way. **NEVER** expose your private key to the public in any way.