Building Your First Web3 App with Tokra in 10 Minutes

Get started with Tokra by building a simple Ethereum wallet balance checker. This tutorial covers authentication, making requests, and handling responses.

Jan 24, 2026

5 min

Let's build a simple app that checks any Ethereum wallet's balance and displays their recent transactions. You'll learn the Tokra basics and have working code in 10 minutes.

Prerequisites

  • Node.js 16+ installed

  • A Tokra API key (get one free at tokra.dev)

  • Basic JavaScript knowledge

Step 1: Setup (2 minutes)

bash

mkdir tokra-demo && cd tokra-demo
npm init -y
npm install @tokra/sdk dotenv
```

Create a `.env` file:
```
TOKRA_API_KEY

Step 2: Connect and Query (5 minutes)

Create index.js:

javascript

const { Tokra } = require('@tokra/sdk');
require('dotenv').config();

const tokra = new Tokra({
  apiKey: process.env.TOKRA_API_KEY,
  chain: 'ethereum' // or 'polygon', 'arbitrum', etc.
});

async function getWalletInfo(address) {
  // Get balance
  const balance = await tokra.eth.getBalance(address);
  console.log(`Balance: ${tokra.utils.fromWei(balance)} ETH`);
  
  // Get recent transactions
  const txs = await tokra.eth.getTransactions(address, { limit: 5 });
  console.log(`Recent transactions: ${txs.length}`);
  
  txs.forEach(tx => {
    console.log(`- ${tx.hash.slice(0, 10)}... | ${tx.value} wei`);
  });
}

// Try Vitalik's address
getWalletInfo('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045');

Step 3: Run It

bash

node index.js
```

You should see output like:
```
Balance: 3847.29 ETH
Recent transactions: 5
- 0x7f3c4d2b... | 0 wei
- 0x9a1e5f8c... | 1000000000000000000

Common Pitfalls

  1. Forgetting to handle Wei conversion: Always use fromWei() for display

  2. Not setting the correct chain: Double-check your chain parameter matches your intent

  3. Rate limit errors: The free tier allows 100K requests/month—plenty for development

Next Steps

  • Add error handling with try/catch

  • Subscribe to new blocks using WebSockets: tokra.eth.subscribe('newBlocks')

  • Query multiple chains by creating separate Tokra instances

  • Explore our ERC-20 token helper methods

Full documentation and more examples at docs.tokra.dev.

Article written by

Alexia Thompson

Create a free website with Framer, the website builder loved by startups, designers and agencies.