@thestatic-tv/dcl-sdk 2.3.0-dev.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,10 +16,9 @@ This SDK allows DCL scene builders to:
16
16
 
17
17
  | Tier | Price | Features |
18
18
  |------|-------|----------|
19
- | **Lite** | $5/mo | Session/visitor tracking, Guide button, Chat button |
20
- | **Full** | $10/mo | Lite + Guide UI, Chat UI, Heartbeat, Interactions |
21
- | **Pro** | $15/mo | Full + Admin Panel (Video tab, Mod tab) |
22
- | **Custom** | $20/mo | Pro + Custom scene tabs for scene-specific controls |
19
+ | **Free** | $5/mo | Session/visitor tracking only |
20
+ | **Standard** | $10/mo | Free + Guide UI, Chat UI, Heartbeat, Interactions |
21
+ | **Pro** | $15/mo | Standard + Admin Panel (Video tab, Mod tab, Custom scene tabs) |
23
22
 
24
23
  > **All keys use `dcls_` prefix** - the server determines your subscription level.
25
24
  >
@@ -116,7 +115,7 @@ await staticTV.interactions.follow('channel-slug')
116
115
  await staticTV.destroy()
117
116
  ```
118
117
 
119
- ## Lite Mode (Visitor Tracking Only)
118
+ ## Free Tier (Visitor Tracking Only)
120
119
 
121
120
  If you don't have a channel but want to track visitors to your scene:
122
121
 
@@ -139,14 +138,17 @@ export function main() {
139
138
  }
140
139
  ```
141
140
 
142
- 3. Check if running in lite mode:
141
+ 3. Check the current tier:
143
142
 
144
143
  ```typescript
145
- if (staticTV.isLite) {
146
- console.log('Running in lite mode - session tracking only')
144
+ // Check tier (free, standard, or pro)
145
+ console.log('Current tier:', staticTV.tier)
146
+
147
+ if (staticTV.isFree) {
148
+ console.log('Running in free tier - session tracking only')
147
149
  }
148
150
 
149
- // guide, heartbeat, and interactions are null in lite mode
151
+ // guide, heartbeat, and interactions are null in free tier
150
152
  if (staticTV.guide) {
151
153
  const channels = await staticTV.guide.getChannels()
152
154
  }
@@ -173,25 +175,28 @@ Main client class for interacting with thestatic.tv.
173
175
  | Property | Type | Description |
174
176
  |----------|------|-------------|
175
177
  | `keyType` | `'channel' \| 'scene'` | The detected key type |
176
- | `isLite` | `boolean` | `true` if using a scene key (lite mode) |
177
- | `hasProFeatures` | `boolean` | `true` if pro features are enabled |
178
- | `guide` | `GuideModule \| null` | Guide module (null in lite mode) |
178
+ | `tier` | `'free' \| 'standard' \| 'pro'` | Current subscription tier |
179
+ | `isFree` | `boolean` | `true` if free tier (session tracking only) |
180
+ | `hasStandardFeatures` | `boolean` | `true` if standard features enabled |
181
+ | `hasProFeatures` | `boolean` | `true` if pro features enabled |
182
+ | `guide` | `GuideModule \| null` | Guide module (null in free tier) |
179
183
  | `session` | `SessionModule` | Session module (always available) |
180
- | `heartbeat` | `HeartbeatModule \| null` | Heartbeat module (null in lite mode) |
181
- | `interactions` | `InteractionsModule \| null` | Interactions module (null in lite mode) |
182
- | `guideUI` | `GuideUIModule \| null` | Guide UI module (null in lite mode) |
183
- | `chatUI` | `ChatUIModule \| null` | Chat UI module (null in lite mode) |
184
+ | `heartbeat` | `HeartbeatModule \| null` | Heartbeat module (null in free tier) |
185
+ | `interactions` | `InteractionsModule \| null` | Interactions module (null in free tier) |
186
+ | `guideUI` | `GuideUIModule \| null` | Guide UI module (null in free tier) |
187
+ | `chatUI` | `ChatUIModule \| null` | Chat UI module (null in free tier) |
184
188
  | `adminPanel` | `AdminPanelUIModule \| null` | Admin panel (null until enableProFeatures() called) |
189
+ | `isLite` | `boolean` | **Deprecated**: Use `isFree` instead |
185
190
 
186
191
  #### Methods
187
192
 
188
193
  | Method | Description |
189
194
  |--------|-------------|
190
195
  | `enableProFeatures(config)` | Enable Pro tier admin panel |
191
- | `registerSceneTab(tab)` | Add custom scene tab (Custom tier) |
196
+ | `registerSceneTab(tab)` | Add custom scene tab (Pro tier) |
192
197
  | `destroy()` | Cleanup before scene unload |
193
198
 
194
- ### Guide Module (Full Mode Only)
199
+ ### Guide Module (Standard/Pro Tier)
195
200
 
196
201
  ```typescript
197
202
  staticTV.guide.getChannels() // Get all channels (cached 30s)
@@ -210,9 +215,18 @@ staticTV.session.startSession() // Manually start session
210
215
  staticTV.session.endSession() // End session
211
216
  staticTV.session.getSessionId() // Get current session ID
212
217
  staticTV.session.isSessionActive() // Check if session is active
218
+
219
+ // Get scene stats (visitors, sessions, etc.)
220
+ const stats = await staticTV.session.getStats()
221
+ if (stats) {
222
+ console.log('Total sessions today:', stats.totalSessions)
223
+ console.log('Unique visitors:', stats.uniqueVisitors)
224
+ console.log('Total minutes watched:', stats.totalMinutes)
225
+ console.log('You are visitor #', stats.visitorNumber)
226
+ }
213
227
  ```
214
228
 
215
- ### Heartbeat Module (Full Mode Only)
229
+ ### Heartbeat Module (Standard/Pro Tier)
216
230
 
217
231
  Track video watching. Each heartbeat represents 1 minute watched.
218
232
 
@@ -223,7 +237,7 @@ staticTV.heartbeat.getCurrentChannel() // Get currently watched channel
223
237
  staticTV.heartbeat.isCurrentlyWatching() // Check if watching
224
238
  ```
225
239
 
226
- ### Interactions Module (Full Mode Only)
240
+ ### Interactions Module (Standard/Pro Tier)
227
241
 
228
242
  Like and follow channels. Requires wallet connection.
229
243
 
@@ -232,7 +246,7 @@ staticTV.interactions.like(channelSlug) // Like a channel
232
246
  staticTV.interactions.follow(channelSlug) // Follow a channel
233
247
  ```
234
248
 
235
- ### Guide UI Module (Full Mode Only)
249
+ ### Guide UI Module (Standard/Pro Tier)
236
250
 
237
251
  Built-in channel browser UI. You provide a callback to handle video selection.
238
252
 
@@ -269,7 +283,7 @@ staticTV.guideUI.currentVideoId = 'video-id'
269
283
  await staticTV.guideUI.refresh()
270
284
  ```
271
285
 
272
- ### Chat UI Module (Full Mode Only)
286
+ ### Chat UI Module (Standard/Pro Tier)
273
287
 
274
288
  Real-time chat with Firebase authentication.
275
289
 
@@ -325,7 +339,7 @@ export function main() {
325
339
 
326
340
  // Enable admin panel (Pro tier)
327
341
  staticTV.enableProFeatures({
328
- sceneId: 'my-scene', // Your scene ID from thestatic.tv
342
+ // sceneId is optional - defaults to your API key ID
329
343
  title: 'MY SCENE ADMIN', // Panel header title
330
344
  onVideoPlay: (url) => {
331
345
  // Handle video playback in your scene
@@ -365,7 +379,7 @@ if (staticTV.adminPanel.hasAccess) { ... }
365
379
 
366
380
  | Option | Type | Default | Description |
367
381
  |--------|------|---------|-------------|
368
- | `sceneId` | `string` | required | Scene ID for API calls |
382
+ | `sceneId` | `string` | API key ID | Scene ID for API calls (optional - defaults to your API key ID) |
369
383
  | `title` | `string` | `'ADMIN PANEL'` | Header title |
370
384
  | `headerColor` | `{r,g,b,a}` | red | Header background color |
371
385
  | `showVideoTab` | `boolean` | `true` | Show Video tab |
@@ -378,7 +392,7 @@ if (staticTV.adminPanel.hasAccess) { ... }
378
392
  | `footerLink` | `string` | scene page | Link shown in footer |
379
393
  | `debug` | `boolean` | `false` | Enable debug logging |
380
394
 
381
- ### Custom Scene Tabs (Custom Tier)
395
+ ### Custom Scene Tabs (Pro Tier)
382
396
 
383
397
  Add your own scene-specific control tabs to the admin panel:
384
398