How to generate a private key account using the thirdweb SDK

In this guide, we will learn how to generate a private key account using the thirdweb SDK.

💡
If you don’t have a thirdweb clienId, you can use the following guide to create one via the thirdweb dashboard
 

Code:

💡
clientId should be used for frontend applications, whereas secretKey should be used for backend applications.
import { generateAccount } from "thirdweb/wallets";
import { createThirdwebClient } from "thirdweb";

const client = createThirdwebClient({
  clientId: process.env.THIRDWEB_CLIENT_ID,
});

const newPrivatekeyAccount = await generateAccount({ client });

Learn how to secure your API keys in production using the following guide.

 

 

Can’t get this working? If you’ve followed the above and still have issues, contact our support team for help.

Did this answer your question?
😞
😐
🤩