@thestatic-tv/dcl-sdk
v2.5.27
Published
Connect your Decentraland scene to thestatic.tv - full channel lineup, metrics tracking, and interactions
Maintainers
Readme
@thestatic-tv/dcl-sdk
Connect your Decentraland scene to thestatic.tv - the decentralized streaming platform.
Features
- Visitor Analytics - Track visitors and session metrics
- Channel Guide - Display live streams and VODs in your scene
- Watch Metrics - Track video viewing time
- Interactions - Enable likes/follows from within DCL
- Built-in UI - Pre-built Guide and Chat components
- Admin Panel - In-scene controls for Pro tier
Quick Start
Get your API key from thestatic.tv/dashboard (DCL Scenes tab)
Install the SDK:
npm install @thestatic-tv/dcl-sdk- Initialize in your scene:
import { StaticTVClient } from '@thestatic-tv/dcl-sdk'
let staticTV: StaticTVClient
export function main() {
staticTV = new StaticTVClient({
apiKey: 'your_api_key_here'
})
// Session tracking starts automatically
}Example Scene
Clone our starter scene to get up and running quickly:
git clone https://github.com/thestatic-tv/thestatic-dcl-starter.git
cd thestatic-dcl-starter
npm install
npm startBasic Usage
// Get channels (Standard/Pro tier)
const channels = await staticTV.guide.getChannels()
const liveChannels = await staticTV.guide.getLiveChannels()
// Track video watching
staticTV.heartbeat.startWatching('channel-slug')
staticTV.heartbeat.stopWatching()
// User interactions (requires wallet)
await staticTV.interactions.like('channel-slug')
await staticTV.interactions.follow('channel-slug')
// Check your tier
console.log('Tier:', staticTV.tier) // 'free', 'standard', or 'pro'
// Cleanup
await staticTV.destroy()Built-in UI Components
The SDK includes pre-built UI for channel browsing and chat:
staticTV = new StaticTVClient({
apiKey: 'your_api_key',
guideUI: {
onVideoSelect: (video) => {
// Handle video playback
console.log('Playing:', video.name)
}
},
chatUI: {
position: 'right'
}
})
// Initialize UI components
staticTV.guideUI.init()
staticTV.chatUI.init()
// Show/hide
staticTV.guideUI.toggle()
staticTV.chatUI.toggle()Pricing & Tiers
See thestatic.tv/info for current pricing and tier features.
All new keys include a 7-day free trial.
Documentation
Full API reference and Pro tier features (Admin Panel, Custom Tabs) available at:
- Docs: thestatic.tv/info
- Examples: github.com/thestatic-tv/thestatic-dcl-starter
Support
- Discord: thestatic.tv Discord
- Issues: GitHub Issues
License
MIT
