tribo-kit-sdk
v1.1.0
Published
Official SDK for Tribo Ecosystem Mini Apps
Maintainers
Readme
🛡️ TriboKit SDK
🚀 Overview
TriboKit provides a seamless interface for Mini Apps to interact with the Tribo Ecosystem host. It handles wallet connection, secure payments, and more, allowing developers to focus on building great user experiences.
📦 Installation
npm install tribo-kit-sdk🛠️ Quick Start
1. Initialize & Connect
Before performing any action, you must request the user to connect their wallet. This verifies the user's identity via Farcaster and provides their World Chain address.
import { Tribo } from 'tribo-kit-sdk';
const handleConnect = async () => {
const result = await Tribo.connect();
if (result.success) {
console.log("✅ Connected:", result.address);
console.log("👤 Username:", result.username);
console.log("🆔 FID:", result.fid);
} else {
console.error("❌ Connection failed:", result.error);
}
};2. Check Environment
Ensure your app is running inside the Tribo host to enable SDK features.
if (Tribo.isInstalled()) {
console.log("Running inside Tribo Ecosystem");
}📖 API Reference
User Management
| Property | Type | Description |
| :--- | :--- | :--- |
| Tribo.wallet | string \| null | The connected user's World Chain address. |
| Tribo.connected | boolean | Connection status. |
Tribo.connect()
Triggers the connection modal in the host application.
- Returns:
Promise<ConnectResponse>
Payments & Transactions
Tribo.send(params: PayParams) / Tribo.pay(params: PayParams)
Simplified interface for requesting payments or sending tokens.
const result = await Tribo.send({
amount: 0.1,
recipient: "0x...",
description: "Coffee Support",
tokenAddress: "0x..." // Optional: defaults to Native ETH
});Tribo.sendTransaction(params: any)
Request a generic transaction (Swaps, Contract Interactions, etc.). The host handles the signing and execution.
const result = await Tribo.sendTransaction({
to: "0x...",
data: "0x...",
value: "..."
});Tribo.getBalance(address: string, tokenAddress?: string)
Fetches the balance of a specific user for a given token.
const { balance } = await Tribo.getBalance(Tribo.wallet, "0x...");Utilities
Tribo.showInfo(title, description)
Triggers an informational modal within the host application. Perfect for walkthroughs or help text.
Tribo.showInfo('Welcome', 'Thanks for using our Mini App!');Tribo.requestNotificationPermission()
(Coming Soon) Request permission to send push notifications through the Tribo host.
// Currently displays a "Coming Soon" modal in the host
const result = await Tribo.requestNotificationPermission();🔒 Security
The SDK communicates with the host via a secure postMessage bridge. All sensitive operations (signing, private key management) are handled exclusively by the Tribo Host, ensuring user funds are never exposed to individual Mini Apps.
🤝 Contributing
Found a bug or have a feature request? Please open an issue on our GitHub repository.
