> ## Documentation Index
> Fetch the complete documentation index at: https://docs.turnkey.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Signing transactions

> This is a guide to signing transactions in a server context. While these snippets leverage Ethers, it can be swapped out for other signers in the Viem or Solana contexts. An example for Ethers can be found , and  for Viem in the server context. A similar example with Solana can be found .

<Steps>
  <Step title="Initialize the Server Client">
    ```ts theme={"system"}
    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,
    });
    ```
  </Step>

  <Step title="Initialize an Ethers Provider and Turnkey Signer">
    ```ts theme={"system"}
    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!,
      });
    ```
  </Step>

  <Step title="Call `sendTransaction` with the Turnkey Signer">
    ```ts theme={"system"}
    const transactionRequest = {
      to: "<destination address>",
      value: ethers.parseEther("<amount to send>"),
      type: 2,
    };
    const sendTransaction =
      await connectedSigner.sendTransaction(transactionRequest);
    ```
  </Step>
</Steps>
