Skip to main content

Examples

Turnkey infrastructure is flexible by default. We intentionally prioritize low-level primitives in our product to avoid creating blockers for developers building new kinds of applications on Turnkey.

That said, we have built out several example services and applications to help illustrate the types of functionality that Turnkey can enable.

SDK code examples

Clone the Turnkey sdk repo here to explore a few “turnkey” examples:

ExampleDescription
with-ethersCreate a new Ethereum address, then sign and broadcast a transaction using the Ethers signer with Infura
with-viemSign and broadcast a transaction using the Turnkey Custom Account and Infura
with-cosmjsCreate a new Cosmos address, then sign and broadcast a transaction on Celestia testnet using the CosmJS signer
with-solanaCreate a new Solana address, then sign and broadcast a transaction on Solana's devnet
with-gnosisCreate new Ethereum addresses, configure a 3/3 Gnosis safe, and create + execute a transaction from it
with-uniswapSign and broadcast a Uniswap v3 trade using the Ethers signer with Infura
with-nonce-managerCreate a new Ethereum address, then sign and broadcast multiple transactions in a sequential or optimistic manner.
with-offlineSign a Turnkey request in offline context
with-federated-passkeysA NextJS app that demonstrates how to use Turnkey to build a federated, webauthn powered authentication flow
with-viem-and-passkeysA NextJS app that demonstrates how to use @turnkey/viem to build a passkey-powered application
sweeperSweep funds from one address to a different address
deployerCompile and deploy a smart contract
rebalancerA demo application which showcases an example of how to use Turnkey for managing multiple types of keys & users
trading-runnerA sample application demonstrating a trading operation, using various private keys, users, and policies, powered by Uniswap.

Demos built with Turnkey

Demo Consumer Wallet (code)

A minimal consumer wallet app powered by Turnkey. Behind the scenes, it uses @turnkey/ethers for signing and WalletConnect (v1) for accessing dapps.

See https://github.com/tkhq/demo-consumer-wallet for the code.

A wallet application showing how users can register and authenticate using passkeys. This demo uses the Turnkey API to create a new Turnkey Sub-Organization for each user, create a testnet Ethereum address and send a transaction on Sepolia (ETH testnet).

homepage screenshot