Quick Start Guide
Get started with Isometrik in less than 10 minutes. This guide will walk you through creating your first realtime application.
Prerequisites
- Node.js 18+ or Python 3.9+
- An Isometrik account (sign up at isometrik.com)
- Basic knowledge of JavaScript or Python
Step 1: Install the SDK
JavaScript/TypeScript
npm install @isometrik/clientPython
pip install isometrik-clientStep 2: Get Your API Keys
Log in to your Isometrik dashboard and navigate to the API Keys section. Copy your API key and secret. Keep these secure and never commit them to version control.
Step 3: Create a Room
JavaScript Example
import { IsometrikClient } from '@isometrik/client';
const client = new IsometrikClient({
apiKey: 'your-api-key',
apiSecret: 'your-api-secret'
});
// Create a room
const room = await client.rooms.create({
name: 'my-first-room',
maxParticipants: 10
});
console.log('Room created:', room.id);Python Example
from isometrik import IsometrikClient
client = IsometrikClient(
api_key='your-api-key',
api_secret='your-api-secret'
)
# Create a room
room = client.rooms.create(
name='my-first-room',
max_participants=10
)
print(f'Room created: {room.id}')Step 4: Generate an Access Token
To join a room, participants need an access token. Generate one using your server-side SDK:
// Server-side: Generate token
const token = await client.tokens.create({
roomId: room.id,
participantName: 'user-123',
permissions: {
canPublish: true,
canSubscribe: true
}
});
// Send token to clientStep 5: Connect from Client
// Client-side: Connect to room
import { Room } from '@isometrik/client';
const room = new Room();
await room.connect('wss://your-server.com', token);
// Publish camera and microphone
const localTracks = await room.localParticipant.publishTracks({
audio: true,
video: true
});
// Listen for remote participants
room.on('participantConnected', (participant) => {
console.log('Participant joined:', participant.identity);
participant.on('trackSubscribed', (track) => {
// Attach track to video element
const element = document.getElementById('remote-video');
track.attach(element);
});
});Step 6: Handle Events
Isometrik provides a rich event system for handling room and participant events:
// Room events
room.on('participantConnected', handleParticipantJoined);
room.on('participantDisconnected', handleParticipantLeft);
room.on('trackPublished', handleTrackPublished);
room.on('trackUnpublished', handleTrackUnpublished);
// Participant events
participant.on('trackSubscribed', handleTrackSubscribed);
participant.on('trackUnsubscribed', handleTrackUnsubscribed);Next Steps
- Learn about Authentication and security best practices
- Explore Realtime Media features
- Check out Text & Data channels
- Read the full API Reference
Tip: Need help? Join our Slack community or check out our example applications.