Getting Started
Overview
The Tempo Accounts SDK is a TypeScript library for applications and wallets to create, manage, and interact with accounts on Tempo.
Demo
Try sign in and make a payment on Tempo using the Accounts SDK.
Make a Payment
demoQuick Prompt
You can integrate the Accounts SDK, and achieve a flow like the demo above by prompting your agent:
Read docs.tempo.xyz/accounts and integrate Tempo Wallet into my application
Architecture
The Accounts SDK is a router between your application and a signing Adapter (e.g. the Tempo Wallet dialog), exposed as an EIP-1193 Provider.
Adapters handle where keys live and who handles signing. The Accounts SDK currently ships with two adapters:
| Adapter | Description |
|---|---|
| Tempo Wallet | Delegates signing to wallet.tempo.xyz via an iframe dialog or popup. One passkey, one account, portable across apps. |
| Domain-bound Passkeys | The app (or wallet) handles passkey ceremonies and signing in-process on its own domain. |
Your application interacts with the SDK through standard JSON-RPC methods (via Wagmi or Viem).
An example of a high-level flow of an Application requesting for a user to perform an action with their Tempo Wallet is shown below:
Install
The Tempo Accounts SDK is available as an NPM package under accounts
Wagmi Usage
The Tempo Accounts SDK is best used in conjunction with Wagmi to provide a seamless experience for developers and end-users.
Set up Wagmi
Get started with Wagmi by following the official guide.
Configure
After you have set up Wagmi, you can set up the Tempo Accounts SDK by using a Connector from accounts/wagmi.
import { , } from 'wagmi'
import { } from 'wagmi/chains'
import { } from 'accounts/wagmi'
export const = ({
: [],
: [()],
: {
[.]: (),
},
})import { , } from 'wagmi'
import { } from 'wagmi/chains'
import { } from 'accounts/wagmi'
export const = ({
: [],
: [({ : '/auth' })],
: {
[.]: (),
},
})Use Accounts
You can now use Wagmi Hooks like useConnect, or Tempo Hooks like useTransfer.
import { , } from 'wagmi'
function () {
const = ()
const = ()
return ?.(() => (
<
={.}
={() => .({ })}
>
Connect
</>
))
}Next Steps
Embed Tempo Wallet or domain-bound passkeys into your app
Send and accept stablecoin payments on Tempo
Create and manage your own stablecoin on Tempo
Swap between stablecoins on the built-in exchange
Hooks to connect wallets, sign transactions, and more
Hooks to transfer stablecoins, interact with the stablecoin DEX, and read token data
Vanilla + Viem Usage
You can get started with the Tempo Accounts SDK by creating a new Provider instance.
Once set up, you can use the provider to interact with accounts via JSON-RPC, or use Viem Actions with .getClient().
import { } from 'accounts'
import { } from 'viem'
import { } from 'viem/tempo'
const = .()
const { } = await .({
: 'wallet_connect',
})
const = .().(())
const { } = await ..({
: '0x20c0000000000000000000000000000000000001',
: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEbb',
: ('10', 6),
})Examples
Check out these examples to get started with the Tempo Accounts SDK.
| Example | Description | |
|---|---|---|
| Embed Tempo Wallet | Wagmi-based setup using the tempoWallet connector to connect to Tempo Wallets. | Guide |
| Embed Domain-bound Passkeys | Domain-bound passkey example using Wagmi and the webAuthn connector. | Guide |
| CLI + Tempo Wallets | Minimal CLI setup to connect and authorize local keys using Tempo Wallets. | |
| Access Keys + Tempo Wallets | Authorize access keys using Tempo Wallets to submit transactions without prompts. | |
| Access Keys + Domain-bound Passkeys | Authorize access keys using domain-bound Passkeys. | |
| Sponsor Fees + Tempo Wallets | Sponsor transactions via Tempo Wallets. | Guide |
| Sponsor Fees + Domain-bound Passkeys | Sponsor transactions via domain-bound Passkeys. | Guide |
Secure Origins (HTTPS)
The Tempo Accounts SDK is designed to be used on secure origins (HTTPS). If you are using HTTP, it will fallback to using a popup instead of an iframe. This is because WebAuthn is not supported on iframes embedded on insecure origins (HTTP).
Web frameworks typically default to HTTP in development environments. You will need to ensure to turn on HTTPS in development to leverage the iframe dialog.
Portless
Portless replaces port numbers with stable, named .localhost URLs and can enable HTTPS with auto-generated certificates.
npm install -g portless
portless run dev
# → https://myapp.localhostNext.js
HTTPS can be enabled on Next.js' dev server by setting the --experimental-https flag on the next dev command.
next dev --experimental-httpsVite
HTTPS can be enabled on Vite's dev server by installing and configuring the vite-plugin-mkcert plugin.
npm i vite-plugin-mkcertimport { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import mkcert from 'vite-plugin-mkcert'
export default defineConfig({
plugins: [
mkcert(),
react(),
],
})Getting Help
Have questions or building something cool with the Accounts SDK?
Join the Telegram group to chat with the team and other devs: @mpp_devs
Was this helpful?