Backend Engine Account Support in TS SDK v5.84.0

Access the full catalog of the thirdweb SDK contract extension functions from the backend, with the execution and monitoring of thirdweb engine

Backend Engine Account Support in TS SDK v5.84.0

Backend Engine Account Support

The thirdweb TypeScript sdk v5.84.0 introduces the new engineAccount() function, enabling seamless backend integration with your thirdweb Engine instance. This addition allows developers to leverage the full power of the thirdweb SDK and contract extensions functions in backend environments while benefiting from Engine's performance, reliability, and monitoring capabilities.

Key Features

  • Create Engine-powered accounts for backend transaction handling with nonce and fund management
  • Full access to thirdweb SDK functions and extensions from the backend
  • Built-in transaction monitoring and reliability features

Usage Example

// Initialize engine account with your instance credentials
const engine = engineAccount({
  engineUrl: process.env.ENGINE_URL,
  authToken: process.env.ENGINE_AUTH_TOKEN,
  walletAddress: process.env.ENGINE_WALLET_ADDRESS,
});

// Prepare transactions like usual
const tx = await claimTo({
  contract: getContract({ client, chain, address: "0x..." }),
  to: "0x...",
  tokenId: 0n,
  quantity: 1n,
});

// Send transaction through engine
const result = await sendTransaction({
  account: engine,
  transaction: tx,
});

// Transaction hash is returned once engine submits it onchain
console.log(result.transactionHash);

This update helps backend development workflows by opening up the large catalog of extensions functions available in the SDK. The engineAccount() function serves as a bridge between your backend services and the blockchain, handling transaction preparation, submission, and confirmation in a reliable manner.

For more information about this release, please visit our documentation or join our Discord community for support and discussions.

Happy building! 🛠️