@thestatic-tv/dcl-sdk 2.9.0 → 2.10.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 +141 -2
- package/dist/index.d.mts +536 -6
- package/dist/index.d.ts +536 -6
- package/dist/index.js +1632 -230
- package/dist/index.mjs +1616 -217
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -116,7 +116,7 @@ no - nothing is proven, and nothing is sent or stored.
|
|
|
116
116
|
|
|
117
117
|
SDK versions before 2.8.0 drop the flag and play every pick at once.
|
|
118
118
|
|
|
119
|
-
## Deleting the channel from the Admin Panel (
|
|
119
|
+
## Deleting the channel from the Admin Panel (2.9.0)
|
|
120
120
|
|
|
121
121
|
Since 2026-11-13 thestatic.tv deletes a channel's recordings with it, vaulted ones too, and only once the caller
|
|
122
122
|
has been shown how many. The Admin Panel's Delete asks first: it reads what the channel holds and opens a confirm
|
|
@@ -127,6 +127,143 @@ the same count, it is shown again. A channel a pending report names cannot be de
|
|
|
127
127
|
Earlier SDK versions send the delete with no count: thestatic.tv still deletes a channel that holds no recording for
|
|
128
128
|
them, and refuses one that does, in words that point to the scene's page on thestatic.tv, which can delete it.
|
|
129
129
|
|
|
130
|
+
## Kick and ban (2.10.0)
|
|
131
|
+
|
|
132
|
+
On the Pro tier, a ban from the Admin Panel's Mod tab, or from your scene's page on thestatic.tv, reaches a visitor
|
|
133
|
+
who is already inside, and KICK ALL works. Each visitor's copy of the scene reads its own standing from thestatic.tv:
|
|
134
|
+
at load, on entering the scene, once a minute while inside, and at once when a kick names its wallet.
|
|
135
|
+
|
|
136
|
+
- **Banned:** the SDK raises a wall over each of your parcels (any shape of scene, an L included), moves the visitor
|
|
137
|
+
to just above the walls if they are inside one, and shows them only a notice. No guide, chat, admin panel or SDK
|
|
138
|
+
video while it lasts. The walls start 1 m in from your scene's outer edges, so someone walking in from outside sees
|
|
139
|
+
the notice before they reach a wall.
|
|
140
|
+
- **KICK ALL:** every visitor who cannot moderate the scene gets the same for two minutes. Moderators stay.
|
|
141
|
+
- **Your parcels only:** the SDK never moves anyone outside your scene's own parcels, read from its scene.json. If it
|
|
142
|
+
cannot read them, the notice still shows and nobody is moved.
|
|
143
|
+
|
|
144
|
+
Your scene's own media is yours to stop. Pass `onBlockedChange`, or read `staticTV.isVisitorBlocked`:
|
|
145
|
+
|
|
146
|
+
```typescript
|
|
147
|
+
staticTV = new StaticTVClient({
|
|
148
|
+
apiKey: 'dcls_your_pro_key',
|
|
149
|
+
onBlockedChange: (blocked, standing) => {
|
|
150
|
+
if (blocked) radio.stop()
|
|
151
|
+
}
|
|
152
|
+
})
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
If you draw the SDK's panels in your own UI renderer, keep drawing `staticTV.adminPanel?.getComponent()`: for a
|
|
156
|
+
blocked visitor it is the notice. Hide your own panels while `staticTV.isVisitorBlocked` is true.
|
|
157
|
+
|
|
158
|
+
Earlier versions saved the ban and moved nobody. A banned visitor was told at their next load and sent to a point
|
|
159
|
+
under the ground, which Decentraland ignores, and KICK ALL did nothing unless the scene handled `onCommand`.
|
|
160
|
+
|
|
161
|
+
## Scene controls (2.10.0, Venue tier)
|
|
162
|
+
|
|
163
|
+
On the Venue tier, your scene declares its own controls: a named group of options, with an optional OFF and an optional
|
|
164
|
+
persist. The SDK draws them as a CONTROLS tab in the Admin Panel, first in the bar. A press runs your handler at once
|
|
165
|
+
in the presser's copy and reaches every visitor's copy through your scene's command queue on thestatic.tv; the same
|
|
166
|
+
buttons appear on your scene's page there, where an admin can press them from a browser. A control with `persist`
|
|
167
|
+
keeps its current option on thestatic.tv, so a visitor who arrives later sees the same state.
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
staticTV = new StaticTVClient({
|
|
171
|
+
apiKey: 'dcls_your_venue_key',
|
|
172
|
+
controls: [{
|
|
173
|
+
id: 'digifog',
|
|
174
|
+
label: 'DigiFog',
|
|
175
|
+
options: [
|
|
176
|
+
{ id: 'stars', label: 'Dancing Stars' },
|
|
177
|
+
{ id: 'pulse', label: 'Club Pulse' },
|
|
178
|
+
{ id: 'upbeat', label: 'Upbeat' }
|
|
179
|
+
],
|
|
180
|
+
off: true, // an OFF button, which sends 'off'
|
|
181
|
+
persist: true, // the current option is saved and applied at load
|
|
182
|
+
onChange: (option) => {
|
|
183
|
+
if (option === 'off') fog.stop()
|
|
184
|
+
else fog.play(option)
|
|
185
|
+
}
|
|
186
|
+
}]
|
|
187
|
+
})
|
|
188
|
+
// or at any time after: staticTV.registerControls([...])
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
- Ids are slugs (`a-z`, `0-9`, `-`, up to 32 characters; `off` is reserved), labels 1 to 40 characters, 1 to 24
|
|
192
|
+
options a control, at most 20 controls a scene. thestatic.tv checks these when the SDK uploads the declaration
|
|
193
|
+
(ids and labels only, never your code) from an admin's copy, and checks every press against it.
|
|
194
|
+
- `onChange` runs in every visitor's copy with the option's id, or `'off'`. It also runs at load with the saved
|
|
195
|
+
option of a persist control, before the first command poll, so make it safe to run more than once.
|
|
196
|
+
- The tab shows one line for the last press: `Sent to everyone`, or `Not sent: no access`, `Not sent: HTTP n`,
|
|
197
|
+
`Not sent: network error`. In a local preview thestatic.tv refuses the send (a preview is not the deployed
|
|
198
|
+
scene), so the line reads `Not sent: no access`; the option still runs in your own copy.
|
|
199
|
+
- On a Pro scene without Venue the SDK keeps the controls and draws, uploads and runs none of them.
|
|
200
|
+
|
|
201
|
+
The in-world Video and Broadcast buttons reach every visitor now too: PLAY NOW, Play on Screen, Play 1-5, Stop,
|
|
202
|
+
PLAYBACK Play, Reset Default and BROADCAST each do what they did in the presser's copy and queue the same for
|
|
203
|
+
everyone, with a status line in the same words. Earlier versions reached the presser's copy alone.
|
|
204
|
+
|
|
205
|
+
## Private mode and the citizen check (2.10.0, Venue tier)
|
|
206
|
+
|
|
207
|
+
On the Venue tier, an admin can make the scene private: open only to TheStatic.tv citizens (visitors whose wallet is
|
|
208
|
+
linked to a TheStatic.tv account) and to the scene's own admins. Switch it from the Admin Panel's MOD tab (PRIVATE
|
|
209
|
+
MODE, ON or OFF) or from your scene's page on thestatic.tv. thestatic.tv decides who may switch it and who gets in;
|
|
210
|
+
every visitor's copy reads its own standing within a few seconds of the switch.
|
|
211
|
+
|
|
212
|
+
- **Kept out:** a visitor who is not admitted gets what a ban gives (the walls over your parcels, the move above them,
|
|
213
|
+
only the notice), and the notice reads PRIVATE EVENT with a BECOME A CITIZEN button that opens thestatic.tv's sign-in
|
|
214
|
+
page. Once they link their wallet they get in at their next read, within a minute.
|
|
215
|
+
- **Precedence:** banned, then kicked, then private. `staticTV.visitorStanding` reads `'private'` and `onBlockedChange`
|
|
216
|
+
is called with `(true, 'private')`, so stop your own media there as for a ban.
|
|
217
|
+
- **The switch's line:** `Sent to everyone`, or `Not sent: no access`, `Not sent: HTTP n`, `Not sent: network error`.
|
|
218
|
+
|
|
219
|
+
For a citizens-only door of your own, ask the SDK instead of calling thestatic.tv:
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
async function onDoorClicked() {
|
|
223
|
+
if (await staticTV.checkCitizen()) openDoor()
|
|
224
|
+
else staticTV.showNotification('Citizens only. Sign in at thestatic.tv')
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
`staticTV.visitorIsCitizen` is the last answer (false before one). `checkCitizen()` reads it fresh, or returns the last
|
|
229
|
+
answer when it is under 5 seconds old, and never waits more than 10 seconds (then it answers the last one). Both answer
|
|
230
|
+
false without the Pro tier's Admin Panel, and on a scene without the Venue tier (thestatic.tv answers it to Venue scenes alone). A scene on an SDK from before private mode is open whatever the switch says.
|
|
231
|
+
|
|
232
|
+
## Frames (2.10.0, Venue tier)
|
|
233
|
+
|
|
234
|
+
On the Venue tier, your scene declares its picture frames: spots it places itself, each with an id, a label for your
|
|
235
|
+
scene's page on thestatic.tv and an optional default picture. Every visitor's copy reads what each frame shows at load
|
|
236
|
+
and hands it to your `onContent`; when you save or reset a frame on your scene's page, every copy reads again within a
|
|
237
|
+
few seconds. Clicks are counted on your scene's page, and the count restarts with each new picture.
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
staticTV = new StaticTVClient({
|
|
241
|
+
apiKey: 'dcls_your_venue_key',
|
|
242
|
+
frames: [{
|
|
243
|
+
id: 'f00',
|
|
244
|
+
label: 'Ground floor, west wall',
|
|
245
|
+
default: { image: 'https://example.com/poster.png', text: 'Your ad here', link: 'https://example.com' },
|
|
246
|
+
onContent: (c) => showPicture(frameEntity, c.image, c.text) // c: { image, text, link, version }
|
|
247
|
+
}]
|
|
248
|
+
})
|
|
249
|
+
// or at any time after: staticTV.registerFrames([...])
|
|
250
|
+
|
|
251
|
+
// in the frame's own pointer handler:
|
|
252
|
+
staticTV.openFrame('f00') // opens the frame's link and, on Venue, counts the click
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
- Ids are slugs (`a-z`, `0-9`, `-`, up to 32 characters), labels 1 to 40 characters, at most 64 frames a scene. A
|
|
256
|
+
default's image and link are `https:` URLs up to 1000 characters, its text up to 120. thestatic.tv checks these when
|
|
257
|
+
the SDK uploads the declaration (ids, labels and defaults, never your code) from an admin's copy.
|
|
258
|
+
- `onContent` gets the frame's saved content, else its default with version `default`; a frame with neither gets no
|
|
259
|
+
call. It runs again whenever what the frame shows changes. If a read fails, the frames keep what they show.
|
|
260
|
+
- `openFrame(id)` opens only a link the SDK knows for that frame: the one saved on your scene's page, else the
|
|
261
|
+
default's, and only an `https:` one. With the Venue tier it also counts the click. Nothing happens for an id you
|
|
262
|
+
did not declare.
|
|
263
|
+
- Without the Venue tier the frames are kept and nothing is read, shown or counted, so your scene draws what an empty
|
|
264
|
+
frame looks like (its default). A click still opens the default's `https:` link, so the frame works before the Venue
|
|
265
|
+
tier is on.
|
|
266
|
+
|
|
130
267
|
## In-world admin, chat, watch time (2.6.0) and session tracking (2.7.0)
|
|
131
268
|
|
|
132
269
|
The Admin Panel, Chat, the watch heartbeat and like/follow send DCL signed requests: Decentraland
|
|
@@ -147,7 +284,9 @@ it updates.
|
|
|
147
284
|
|
|
148
285
|
See [thestatic.tv/info](https://thestatic.tv/info) for current pricing and tier features.
|
|
149
286
|
|
|
150
|
-
New keys start on the free tier (session tracking, no expiry); Standard and Pro are paid upgrades.
|
|
287
|
+
New keys start on the free tier (session tracking, no expiry); Standard and Pro are paid upgrades. Venue is Pro plus
|
|
288
|
+
the event features (scene controls, frames, private mode); thestatic.tv sets it on a Pro key, and `staticTV.tier` still
|
|
289
|
+
reads `'pro'` for a Venue scene (`staticTV.hasVenueFeatures` says Venue).
|
|
151
290
|
|
|
152
291
|
## Documentation
|
|
153
292
|
|