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.

Code Examples

ExampleDescription
demo-consumer-walletA minimal consumer wallet app powered by Turnkey and WalletConnect
demo-passkey-walletA minimal consumer wallet app powered by Turnkey and passkeys
demo-ethers-passkeysA NextJS app that demonstrates how to use @turnkey/ethers to build a passkey-powered application
demo-viem-passkeysA NextJS app that demonstrates how to use @turnkey/viem to build a passkey-powered application
deployerCompile and deploy a smart contract
email-recoveryA NextJS app that demonstrates how to use @turnkey/iframe-stamper to perform email recovery
rebalancerA demo application which showcases an example of how to use Turnkey for managing multiple types of keys & users
sweeperSweep funds from one address to a different address
trading-runnerA sample application demonstrating a trading operation, using various private keys, users, and policies, powered by Uniswap
wallet-exportA NextJS app that demonstrates how to use @turnkey/iframe-stamper to export a wallet as a mnemonic
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-eip-1193-providerExample using a Turnkey-compatible Ethereum provider that adheres to the EIP-1193 standards
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

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).

demo passkey wallet screenshot

See https://wallet.tx.xyz (and https://github.com/tkhq/demo-passkey-wallet for the code).

Demo Ethers Passkeys (code)

A simple application demonstrating how to create sub-organizations, create private keys, and sign with the @turnkey/ethers signer, using passkeys.

ethers ui screenshot

See https://github.com/tkhq/demo-ethers-passkeys for the code.

Demo Viem Passkeys (code)

A similar, simple application demonstrating how to create sub-organizations, create private keys, and sign with the @turnkey/viem signer, using passkeys.

viem ui screenshot

See https://github.com/tkhq/demo-viem-passkeys for the code.