1

Initialize the Server Client

import { Turnkey } from "@turnkey/sdk-server";

const turnkeyClient = new Turnkey({
  apiBaseUrl: "https://api.turnkey.com",
  defaultOrganizationId: process.env.TURNKEY_ORGANIZATION_ID,
  apiPrivateKey: process.env.API_PRIVATE_KEY,
  apiPublicKey: process.env.API_PUBLIC_KEY,
});
2

Initialize an Ethers Provider and Turnkey Signer

import { ethers } from "ethers";
import { TurnkeySigner } from "@turnkey/ethers";

const provider = new ethers.JsonRpcProvider(<provider api url>);
const turnkeySigner = new TurnkeySigner({
    client: turnkeyClient.apiClient(),
    organizationId: process.env.ORGANIZATION_ID!,
    signWith: process.env.SIGN_WITH!,
  });
3

Call `sendTransaction` with the Turnkey Signer

const transactionRequest = {
  to: "<destination address>",
  value: ethers.parseEther("<amount to send>"),
  type: 2,
};
const sendTransaction =
  await connectedSigner.sendTransaction(transactionRequest);