Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 2.57 KB

README.md

File metadata and controls

47 lines (30 loc) · 2.57 KB

Examples

This directory contains example code for using the Turnkey Go SDK. Each subdirectory contains a self-contained example with its own README and .env file for configuration. The examples demonstrate various authentication flows and features of the Turnkey platform.

Policies

Some examples require specific Turnkey policies to be configured on your organization before they will work. Refer to the Turnkey policy overview for details on how to create and manage policies.

Set up

Note

Please refer to the main README for getting started with setting up your Turnkey environment.

All examples are run from the repo root. For each example:

  1. Copy .env.example to .env in the example's directory and fill in the values.
  2. Run using set -a && source examples/<example>/.env && set +a && go run ./examples/<example>

Refer to each example's README for the exact commands.

Available Examples

  • apikey: Demonstrates how to authenticate using an API key.

  • delegated_access: Shows how to set up delegated access for a sub-organization.

  • otp: Example of using one-time password (OTP) flows for authentication.

  • private_keys: Shows how to manage standalone private keys.

  • signing: Demonstrates how to sign messages and transactions using the SDK.

  • transaction_management: Demonstrates sending sponsored and non-sponsored transactions.

    • ethereum: Send, swap, and list assets on Ethereum.
  • wallets: Shows how to manage wallets and sign transactions with them.

  • whoami: Example of using the WhoAmI endpoint to retrieve the current user's ID.