Quickstart
Get up and running with Tenzro Platform in under 5 minutes. This guide walks you through installing the SDK, configuring authentication, and making your first API call.
Prerequisites
- A Tenzro Platform account with API access
- Node.js 18+ (for TypeScript) or Rust 1.70+ (for Rust)
- Your API key and tenant ID from the dashboard
Step 1: Install the SDK
TypeScript
npm install @tenzro/platform
# or
yarn add @tenzro/platform
# or
pnpm add @tenzro/platformRust
cargo add tenzro-platformStep 2: Configure Environment
Create a .env file with your credentials:
TENZRO_API_KEY=tz_prod_xxxxxxxxxxxx
TENZRO_TENANT_ID=your-tenant-id
TENZRO_BASE_URL=https://api.platform.tenzro.comStep 3: Initialize the Client
TypeScript
import { TenzroPlatform } from '@tenzro/platform';
const platform = new TenzroPlatform({
apiKey: process.env.TENZRO_API_KEY!,
tenantId: process.env.TENZRO_TENANT_ID!,
baseUrl: process.env.TENZRO_BASE_URL,
});Rust
use tenzro_platform::TenzroPlatform;
let platform = TenzroPlatform::builder()
.api_key(std::env::var("TENZRO_API_KEY")?)
.tenant_id(std::env::var("TENZRO_TENANT_ID")?)
.build()?;Step 4: Make Your First API Call
Let's create a wallet and check its balance:
TypeScript
// Create a new wallet
const wallet = await platform.wallet.create({
name: 'My First Wallet',
type: 'eoa',
chain: 'ethereum',
});
console.log('Wallet created:', wallet.address);
// Get wallet balance
const balance = await platform.wallet.getBalance(wallet.id);
console.log('Balance:', balance);Rust
use tenzro_platform::wallet::{CreateWalletRequest, WalletType, Chain};
// Create a new wallet
let wallet = platform.wallet().create(CreateWalletRequest {
name: "My First Wallet".to_string(),
wallet_type: WalletType::Eoa,
chain: Chain::Ethereum,
}).await?;
println!("Wallet created: {}", wallet.address);
// Get wallet balance
let balance = platform.wallet().get_balance(&wallet.id).await?;
println!("Balance: {:?}", balance);Step 5: Handle Errors
The SDK provides typed errors for all failure cases:
TypeScript
import { TenzroError, RateLimitError, AuthenticationError } from '@tenzro/platform';
try {
const wallet = await platform.wallet.create({ ... });
} catch (error) {
if (error instanceof RateLimitError) {
console.log('Rate limited, retry after:', error.retryAfter);
} else if (error instanceof AuthenticationError) {
console.log('Invalid API key');
} else if (error instanceof TenzroError) {
console.log('API error:', error.message, error.code);
}
}Next Steps
- Explore the API Reference for all available endpoints
- Read the Security Best Practices guide
- Set up webhook notifications for real-time updates
- Learn about multi-tenancy for enterprise deployments