Installation
There are two ways to work with Tribe. The faster path is to install the AI coding skill and let your agent handle the integration. The more hands-on path is to add the SDK yourself. Both end up in the same place.
The AI coding skill
Section titled “The AI coding skill”Install the Tribe skill once, and your coding agent will know how to integrate every feature. It understands the full SDK surface, framework-specific patterns for React, Next.js, Vue, Svelte, and vanilla JS, and the small gotchas that tend to trip people up.
Claude Code
Section titled “Claude Code”Run this in your project root. The skill will be available whenever you work in this project:
curl --create-dirs -so .claude/commands/tribe.md https://tribe.utopian.build/tribe.mdInvoke it with /tribe or just mention what you want to build. Something like “add Google login using Tribe” is enough.
Install it globally so every project has access:
curl --create-dirs -so ~/.claude/commands/tribe.md https://tribe.utopian.build/tribe.mdOpenAI Codex and other agents
Section titled “OpenAI Codex and other agents”Download the SDK reference file and feed it as context to whatever agent you’re using:
curl -so tribe-sdk.md https://tribe.utopian.build/tribe.mdThe file covers every method, both installation options, and idiomatic patterns for all the major frameworks. It’s written as a prompt, so agents pick it up naturally.
What the skill actually does
Section titled “What the skill actually does”Once installed, you can describe what you want in ordinary language and the agent generates working integration code:
Add Google and GitHub social login to my React app using TribeSet up a payment page that accepts SOL and USDC with QR codesAdd a feedback widget to my app using TribeThe agent takes care of boilerplate, error handling, and framework-specific patterns so you don’t have to look up every method signature yourself.
Adding the SDK directly
Section titled “Adding the SDK directly”If you’d rather write the integration by hand, you have two options.
Script tag
Section titled “Script tag”The simplest approach. Drop this into your HTML and you’re done, no build step needed:
<script src="https://api.tribe.utopian.build/sdk.js?site=YOUR_SITE_ID" defer></script>This creates a global Tribe object with every SDK method. Pageview auto-tracking starts immediately.
npm package
Section titled “npm package”npm install @tribecloud/sdkimport { Tribe } from "@tribecloud/sdk";
const tribe = new Tribe({ siteId: "YOUR_SITE_ID", autoTrack: true, // this is the default});You can also use the static factory if you prefer that style:
const tribe = Tribe.init({ siteId: "YOUR_SITE_ID" });Framework notes
Section titled “Framework notes”| Framework | Notes |
|---|---|
| React / Vite | Use the npm package. Initialize once at the app root. |
| Next.js (App Router) | SDK usage must live in "use client" components since it needs browser APIs. |
| Vue / Svelte | Use the npm package. Initialize in your main entry file. |
| Vanilla JS / HTML | Use the script tag. Everything lives on the global Tribe object. |
Finding your Site ID
Section titled “Finding your Site ID”- Open the Tribe dashboard
- Create a new site or select an existing one
- Go to Settings
- Your Site ID is right there