@thestatic-tv/dcl-sdk 2.5.27 → 2.6.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 +17 -7
- package/dist/index.d.mts +54 -10
- package/dist/index.d.ts +54 -10
- package/dist/index.js +133 -93
- package/dist/index.mjs +133 -93
- package/package.json +10 -4
package/README.md
CHANGED
|
@@ -41,11 +41,11 @@ export function main() {
|
|
|
41
41
|
|
|
42
42
|
## Example Scene
|
|
43
43
|
|
|
44
|
-
Clone our starter scene to get up and running quickly:
|
|
44
|
+
Clone our free-tier starter scene to get up and running quickly ([thestatic-dcl-standard](https://github.com/thestatic-tv/thestatic-dcl-standard) and [thestatic-dcl-pro](https://github.com/thestatic-tv/thestatic-dcl-pro) are the Standard and Pro starters):
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
-
git clone https://github.com/thestatic-tv/thestatic-dcl-
|
|
48
|
-
cd thestatic-dcl-
|
|
47
|
+
git clone https://github.com/thestatic-tv/thestatic-dcl-free.git
|
|
48
|
+
cd thestatic-dcl-free
|
|
49
49
|
npm install
|
|
50
50
|
npm start
|
|
51
51
|
```
|
|
@@ -99,23 +99,33 @@ staticTV.guideUI.toggle()
|
|
|
99
99
|
staticTV.chatUI.toggle()
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
## In-world admin, chat and watch time (2.6.0)
|
|
103
|
+
|
|
104
|
+
The Admin Panel, Chat, the watch heartbeat and like/follow send DCL signed requests: Decentraland
|
|
105
|
+
signs each one as the player, and thestatic.tv checks that it came from the scene deployed where
|
|
106
|
+
your scene is registered. Set your scene's parcel (or its World name) on
|
|
107
|
+
[thestatic.tv/dashboard](https://thestatic.tv/dashboard) - without it, none of them work. Versions
|
|
108
|
+
before 2.6.0 named the player's wallet in the request instead, which the server no longer accepts:
|
|
109
|
+
update and redeploy your scene to keep them working. Chill to Earn credits the player who signed
|
|
110
|
+
the heartbeat; a guest's minutes count for the channel but earn nothing, and a guest cannot like
|
|
111
|
+
or follow.
|
|
112
|
+
|
|
102
113
|
## Pricing & Tiers
|
|
103
114
|
|
|
104
115
|
See [thestatic.tv/info](https://thestatic.tv/info) for current pricing and tier features.
|
|
105
116
|
|
|
106
|
-
|
|
117
|
+
New keys start on the free tier (session tracking, no expiry); Standard and Pro are paid upgrades.
|
|
107
118
|
|
|
108
119
|
## Documentation
|
|
109
120
|
|
|
110
121
|
Full API reference and Pro tier features (Admin Panel, Custom Tabs) available at:
|
|
111
122
|
|
|
112
123
|
- **Docs**: [thestatic.tv/info](https://thestatic.tv/info)
|
|
113
|
-
- **Examples**: [github.com/thestatic-tv/thestatic-dcl-
|
|
124
|
+
- **Examples**: [thestatic-dcl-free](https://github.com/thestatic-tv/thestatic-dcl-free), [thestatic-dcl-standard](https://github.com/thestatic-tv/thestatic-dcl-standard), [thestatic-dcl-pro](https://github.com/thestatic-tv/thestatic-dcl-pro)
|
|
114
125
|
|
|
115
126
|
## Support
|
|
116
127
|
|
|
117
|
-
-
|
|
118
|
-
- Issues: [GitHub Issues](https://github.com/thestatic-tv/dcl-sdk/issues)
|
|
128
|
+
- Support: [thestatic.tv/support](https://thestatic.tv/support)
|
|
119
129
|
|
|
120
130
|
## License
|
|
121
131
|
|
package/dist/index.d.mts
CHANGED
|
@@ -87,6 +87,7 @@ interface StaticTVConfig {
|
|
|
87
87
|
debug?: boolean;
|
|
88
88
|
/** Custom API base URL (default: https://thestatic.tv/api/v1/dcl) */
|
|
89
89
|
baseUrl?: string;
|
|
90
|
+
apiUrl?: string;
|
|
90
91
|
/**
|
|
91
92
|
* Player data from DCL - pass from your scene's getPlayer() call
|
|
92
93
|
* @example
|
|
@@ -98,6 +99,18 @@ interface StaticTVConfig {
|
|
|
98
99
|
* })
|
|
99
100
|
*/
|
|
100
101
|
player?: PlayerData;
|
|
102
|
+
/**
|
|
103
|
+
* Custom boundary check function - overrides the SDK's auto-detected parcel bounds.
|
|
104
|
+
* Use this for L-shaped or irregular estates where the bounding box is too large.
|
|
105
|
+
* Return true if the player is physically inside your scene, false if nearby but outside.
|
|
106
|
+
* @example
|
|
107
|
+
* customBoundsCheck: () => {
|
|
108
|
+
* const pos = getPlayerPosition()
|
|
109
|
+
* if (!pos) return false
|
|
110
|
+
* return (pos.x >= 0 && pos.x <= 16 && pos.z >= 0 && pos.z <= 64)
|
|
111
|
+
* }
|
|
112
|
+
*/
|
|
113
|
+
customBoundsCheck?: () => boolean;
|
|
101
114
|
/**
|
|
102
115
|
* Guide UI configuration
|
|
103
116
|
*/
|
|
@@ -172,6 +185,8 @@ interface SessionResponse {
|
|
|
172
185
|
*/
|
|
173
186
|
interface HeartbeatResponse {
|
|
174
187
|
success: boolean;
|
|
188
|
+
/** false when this player's last minute counted under a minute ago (a channel switch) */
|
|
189
|
+
counted?: boolean;
|
|
175
190
|
channelSlug: string;
|
|
176
191
|
sceneOwnerChannel: string;
|
|
177
192
|
version: string;
|
|
@@ -469,7 +484,8 @@ declare class SessionModule {
|
|
|
469
484
|
*/
|
|
470
485
|
get bounds(): SceneBounds$1 | null;
|
|
471
486
|
/**
|
|
472
|
-
* Check if player is currently within scene bounds
|
|
487
|
+
* Check if player is currently within scene bounds.
|
|
488
|
+
* Uses customBoundsCheck from config if provided, otherwise falls back to auto-detected parcel bounds.
|
|
473
489
|
*/
|
|
474
490
|
isPlayerInScene(): boolean;
|
|
475
491
|
/**
|
|
@@ -541,7 +557,10 @@ declare class SessionModule {
|
|
|
541
557
|
/**
|
|
542
558
|
* Heartbeat module - track video watching metrics
|
|
543
559
|
*
|
|
544
|
-
* Only tracks when player is within scene bounds.
|
|
560
|
+
* Only tracks when player is within scene bounds. Each heartbeat is a DCL signed request (2.6.0):
|
|
561
|
+
* the explorer signs it as the player and thestatic.tv credits the minute - and any Sparks - to
|
|
562
|
+
* that proven wallet. It names no wallet: earlier versions sent one, and the server credited
|
|
563
|
+
* whichever account listed it.
|
|
545
564
|
*/
|
|
546
565
|
|
|
547
566
|
declare class HeartbeatModule {
|
|
@@ -561,10 +580,6 @@ declare class HeartbeatModule {
|
|
|
561
580
|
* Stop tracking video watching
|
|
562
581
|
*/
|
|
563
582
|
stopWatching(): void;
|
|
564
|
-
/**
|
|
565
|
-
* Get player wallet - prioritize config, fallback to runtime detection
|
|
566
|
-
*/
|
|
567
|
-
private getWallet;
|
|
568
583
|
/**
|
|
569
584
|
* Send a watching heartbeat (1 heartbeat = 1 minute watched)
|
|
570
585
|
* Only sends if player is within scene bounds
|
|
@@ -582,6 +597,11 @@ declare class HeartbeatModule {
|
|
|
582
597
|
|
|
583
598
|
/**
|
|
584
599
|
* Interactions module - like/follow channels from DCL scenes
|
|
600
|
+
*
|
|
601
|
+
* Each is a DCL signed request (2.6.0): the explorer signs it as the player, and thestatic.tv
|
|
602
|
+
* records the like or follow for that proven wallet. It names no wallet: earlier versions sent
|
|
603
|
+
* one, and the server recorded the interaction for whichever wallet was named. Guests cannot
|
|
604
|
+
* like or follow.
|
|
585
605
|
*/
|
|
586
606
|
|
|
587
607
|
declare class InteractionsModule {
|
|
@@ -688,7 +708,7 @@ declare class ChatUIModule {
|
|
|
688
708
|
private config;
|
|
689
709
|
private _isVisible;
|
|
690
710
|
private _unreadCount;
|
|
691
|
-
private
|
|
711
|
+
private authChecked;
|
|
692
712
|
private isSigningIn;
|
|
693
713
|
private isRegisteredUser;
|
|
694
714
|
private currentUsername;
|
|
@@ -859,6 +879,13 @@ declare class AdminPanelUIModule {
|
|
|
859
879
|
private stopStreamPolling;
|
|
860
880
|
private startCommandPolling;
|
|
861
881
|
private stopCommandPolling;
|
|
882
|
+
/**
|
|
883
|
+
* Every gated admin call is a DCL signed fetch (thestatic.tv STATIC-01, 2026-10-07): the
|
|
884
|
+
* explorer signs it with the player's identity, and the server checks the signature and that it
|
|
885
|
+
* came from the scene deployed at this scene's registered location. A wallet named in a query or
|
|
886
|
+
* body proved nothing and is no longer sent. Returns a fetch-like shape for the call sites.
|
|
887
|
+
*/
|
|
888
|
+
private signedRequest;
|
|
862
889
|
private pollCommands;
|
|
863
890
|
private fetchStreamData;
|
|
864
891
|
private refreshStreamStatus;
|
|
@@ -916,6 +943,7 @@ declare const KEY_TYPE_SCENE = "scene";
|
|
|
916
943
|
declare class StaticTVClient {
|
|
917
944
|
private config;
|
|
918
945
|
private baseUrl;
|
|
946
|
+
readonly apiUrl: string;
|
|
919
947
|
private _keyType;
|
|
920
948
|
private _keyId;
|
|
921
949
|
private _disabled;
|
|
@@ -1028,6 +1056,15 @@ declare class StaticTVClient {
|
|
|
1028
1056
|
* @internal
|
|
1029
1057
|
*/
|
|
1030
1058
|
request<T>(endpoint: string, options?: RequestInit): Promise<T>;
|
|
1059
|
+
/**
|
|
1060
|
+
* Make an API request the explorer signs as the player (DCL signed fetch): thestatic.tv credits
|
|
1061
|
+
* it to that proven wallet and checks it came from this scene - never a wallet the request names.
|
|
1062
|
+
* @internal
|
|
1063
|
+
*/
|
|
1064
|
+
signedRequest<T>(endpoint: string, init?: {
|
|
1065
|
+
method?: string;
|
|
1066
|
+
body?: string;
|
|
1067
|
+
}): Promise<T>;
|
|
1031
1068
|
/**
|
|
1032
1069
|
* Log a debug message (only when debug: true)
|
|
1033
1070
|
* @internal
|
|
@@ -1164,6 +1201,12 @@ declare class StaticTVClient {
|
|
|
1164
1201
|
* Enables modules based on tier level
|
|
1165
1202
|
* @internal
|
|
1166
1203
|
*/
|
|
1204
|
+
/**
|
|
1205
|
+
* The TheStatic scene this SDK runs as - config.sceneId, else the API key's id (they are the same
|
|
1206
|
+
* dcl_scenes doc for unified keys). In-world signed requests name it, and the server checks the
|
|
1207
|
+
* request came from the scene deployed at that scene's registered location.
|
|
1208
|
+
*/
|
|
1209
|
+
getSceneId(): string | undefined;
|
|
1167
1210
|
_enableFeaturesForTier(tier: SDKTier, keyId?: string | null): void;
|
|
1168
1211
|
/**
|
|
1169
1212
|
* @deprecated Use `_enableFeaturesForTier` instead
|
|
@@ -1359,10 +1402,11 @@ interface SceneBounds {
|
|
|
1359
1402
|
*/
|
|
1360
1403
|
declare function getSceneBounds(): Promise<SceneBounds | null>;
|
|
1361
1404
|
/**
|
|
1362
|
-
* Check if player is within scene boundaries
|
|
1363
|
-
*
|
|
1405
|
+
* Check if player is within any of the scene's parcel boundaries.
|
|
1406
|
+
* Checks each parcel individually so irregular/L-shaped estates work correctly.
|
|
1407
|
+
* Returns true if in bounds, false if out of bounds or can't determine.
|
|
1364
1408
|
*/
|
|
1365
|
-
declare function isPlayerInBounds(
|
|
1409
|
+
declare function isPlayerInBounds(_bounds: SceneBounds): boolean;
|
|
1366
1410
|
/**
|
|
1367
1411
|
* Get player's current position
|
|
1368
1412
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -87,6 +87,7 @@ interface StaticTVConfig {
|
|
|
87
87
|
debug?: boolean;
|
|
88
88
|
/** Custom API base URL (default: https://thestatic.tv/api/v1/dcl) */
|
|
89
89
|
baseUrl?: string;
|
|
90
|
+
apiUrl?: string;
|
|
90
91
|
/**
|
|
91
92
|
* Player data from DCL - pass from your scene's getPlayer() call
|
|
92
93
|
* @example
|
|
@@ -98,6 +99,18 @@ interface StaticTVConfig {
|
|
|
98
99
|
* })
|
|
99
100
|
*/
|
|
100
101
|
player?: PlayerData;
|
|
102
|
+
/**
|
|
103
|
+
* Custom boundary check function - overrides the SDK's auto-detected parcel bounds.
|
|
104
|
+
* Use this for L-shaped or irregular estates where the bounding box is too large.
|
|
105
|
+
* Return true if the player is physically inside your scene, false if nearby but outside.
|
|
106
|
+
* @example
|
|
107
|
+
* customBoundsCheck: () => {
|
|
108
|
+
* const pos = getPlayerPosition()
|
|
109
|
+
* if (!pos) return false
|
|
110
|
+
* return (pos.x >= 0 && pos.x <= 16 && pos.z >= 0 && pos.z <= 64)
|
|
111
|
+
* }
|
|
112
|
+
*/
|
|
113
|
+
customBoundsCheck?: () => boolean;
|
|
101
114
|
/**
|
|
102
115
|
* Guide UI configuration
|
|
103
116
|
*/
|
|
@@ -172,6 +185,8 @@ interface SessionResponse {
|
|
|
172
185
|
*/
|
|
173
186
|
interface HeartbeatResponse {
|
|
174
187
|
success: boolean;
|
|
188
|
+
/** false when this player's last minute counted under a minute ago (a channel switch) */
|
|
189
|
+
counted?: boolean;
|
|
175
190
|
channelSlug: string;
|
|
176
191
|
sceneOwnerChannel: string;
|
|
177
192
|
version: string;
|
|
@@ -469,7 +484,8 @@ declare class SessionModule {
|
|
|
469
484
|
*/
|
|
470
485
|
get bounds(): SceneBounds$1 | null;
|
|
471
486
|
/**
|
|
472
|
-
* Check if player is currently within scene bounds
|
|
487
|
+
* Check if player is currently within scene bounds.
|
|
488
|
+
* Uses customBoundsCheck from config if provided, otherwise falls back to auto-detected parcel bounds.
|
|
473
489
|
*/
|
|
474
490
|
isPlayerInScene(): boolean;
|
|
475
491
|
/**
|
|
@@ -541,7 +557,10 @@ declare class SessionModule {
|
|
|
541
557
|
/**
|
|
542
558
|
* Heartbeat module - track video watching metrics
|
|
543
559
|
*
|
|
544
|
-
* Only tracks when player is within scene bounds.
|
|
560
|
+
* Only tracks when player is within scene bounds. Each heartbeat is a DCL signed request (2.6.0):
|
|
561
|
+
* the explorer signs it as the player and thestatic.tv credits the minute - and any Sparks - to
|
|
562
|
+
* that proven wallet. It names no wallet: earlier versions sent one, and the server credited
|
|
563
|
+
* whichever account listed it.
|
|
545
564
|
*/
|
|
546
565
|
|
|
547
566
|
declare class HeartbeatModule {
|
|
@@ -561,10 +580,6 @@ declare class HeartbeatModule {
|
|
|
561
580
|
* Stop tracking video watching
|
|
562
581
|
*/
|
|
563
582
|
stopWatching(): void;
|
|
564
|
-
/**
|
|
565
|
-
* Get player wallet - prioritize config, fallback to runtime detection
|
|
566
|
-
*/
|
|
567
|
-
private getWallet;
|
|
568
583
|
/**
|
|
569
584
|
* Send a watching heartbeat (1 heartbeat = 1 minute watched)
|
|
570
585
|
* Only sends if player is within scene bounds
|
|
@@ -582,6 +597,11 @@ declare class HeartbeatModule {
|
|
|
582
597
|
|
|
583
598
|
/**
|
|
584
599
|
* Interactions module - like/follow channels from DCL scenes
|
|
600
|
+
*
|
|
601
|
+
* Each is a DCL signed request (2.6.0): the explorer signs it as the player, and thestatic.tv
|
|
602
|
+
* records the like or follow for that proven wallet. It names no wallet: earlier versions sent
|
|
603
|
+
* one, and the server recorded the interaction for whichever wallet was named. Guests cannot
|
|
604
|
+
* like or follow.
|
|
585
605
|
*/
|
|
586
606
|
|
|
587
607
|
declare class InteractionsModule {
|
|
@@ -688,7 +708,7 @@ declare class ChatUIModule {
|
|
|
688
708
|
private config;
|
|
689
709
|
private _isVisible;
|
|
690
710
|
private _unreadCount;
|
|
691
|
-
private
|
|
711
|
+
private authChecked;
|
|
692
712
|
private isSigningIn;
|
|
693
713
|
private isRegisteredUser;
|
|
694
714
|
private currentUsername;
|
|
@@ -859,6 +879,13 @@ declare class AdminPanelUIModule {
|
|
|
859
879
|
private stopStreamPolling;
|
|
860
880
|
private startCommandPolling;
|
|
861
881
|
private stopCommandPolling;
|
|
882
|
+
/**
|
|
883
|
+
* Every gated admin call is a DCL signed fetch (thestatic.tv STATIC-01, 2026-10-07): the
|
|
884
|
+
* explorer signs it with the player's identity, and the server checks the signature and that it
|
|
885
|
+
* came from the scene deployed at this scene's registered location. A wallet named in a query or
|
|
886
|
+
* body proved nothing and is no longer sent. Returns a fetch-like shape for the call sites.
|
|
887
|
+
*/
|
|
888
|
+
private signedRequest;
|
|
862
889
|
private pollCommands;
|
|
863
890
|
private fetchStreamData;
|
|
864
891
|
private refreshStreamStatus;
|
|
@@ -916,6 +943,7 @@ declare const KEY_TYPE_SCENE = "scene";
|
|
|
916
943
|
declare class StaticTVClient {
|
|
917
944
|
private config;
|
|
918
945
|
private baseUrl;
|
|
946
|
+
readonly apiUrl: string;
|
|
919
947
|
private _keyType;
|
|
920
948
|
private _keyId;
|
|
921
949
|
private _disabled;
|
|
@@ -1028,6 +1056,15 @@ declare class StaticTVClient {
|
|
|
1028
1056
|
* @internal
|
|
1029
1057
|
*/
|
|
1030
1058
|
request<T>(endpoint: string, options?: RequestInit): Promise<T>;
|
|
1059
|
+
/**
|
|
1060
|
+
* Make an API request the explorer signs as the player (DCL signed fetch): thestatic.tv credits
|
|
1061
|
+
* it to that proven wallet and checks it came from this scene - never a wallet the request names.
|
|
1062
|
+
* @internal
|
|
1063
|
+
*/
|
|
1064
|
+
signedRequest<T>(endpoint: string, init?: {
|
|
1065
|
+
method?: string;
|
|
1066
|
+
body?: string;
|
|
1067
|
+
}): Promise<T>;
|
|
1031
1068
|
/**
|
|
1032
1069
|
* Log a debug message (only when debug: true)
|
|
1033
1070
|
* @internal
|
|
@@ -1164,6 +1201,12 @@ declare class StaticTVClient {
|
|
|
1164
1201
|
* Enables modules based on tier level
|
|
1165
1202
|
* @internal
|
|
1166
1203
|
*/
|
|
1204
|
+
/**
|
|
1205
|
+
* The TheStatic scene this SDK runs as - config.sceneId, else the API key's id (they are the same
|
|
1206
|
+
* dcl_scenes doc for unified keys). In-world signed requests name it, and the server checks the
|
|
1207
|
+
* request came from the scene deployed at that scene's registered location.
|
|
1208
|
+
*/
|
|
1209
|
+
getSceneId(): string | undefined;
|
|
1167
1210
|
_enableFeaturesForTier(tier: SDKTier, keyId?: string | null): void;
|
|
1168
1211
|
/**
|
|
1169
1212
|
* @deprecated Use `_enableFeaturesForTier` instead
|
|
@@ -1359,10 +1402,11 @@ interface SceneBounds {
|
|
|
1359
1402
|
*/
|
|
1360
1403
|
declare function getSceneBounds(): Promise<SceneBounds | null>;
|
|
1361
1404
|
/**
|
|
1362
|
-
* Check if player is within scene boundaries
|
|
1363
|
-
*
|
|
1405
|
+
* Check if player is within any of the scene's parcel boundaries.
|
|
1406
|
+
* Checks each parcel individually so irregular/L-shaped estates work correctly.
|
|
1407
|
+
* Returns true if in bounds, false if out of bounds or can't determine.
|
|
1364
1408
|
*/
|
|
1365
|
-
declare function isPlayerInBounds(
|
|
1409
|
+
declare function isPlayerInBounds(_bounds: SceneBounds): boolean;
|
|
1366
1410
|
/**
|
|
1367
1411
|
* Get player's current position
|
|
1368
1412
|
*/
|