@usions/sdk 2.34.0 → 2.36.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 +58 -0
- package/package.json +1 -1
- package/src/browser.js +2 -2
- package/src/modules/call-voice.js +165 -0
- package/src/modules/call.js +4 -2
- package/src/modules/core.js +25 -15
- package/src/modules/errors.js +12 -0
- package/src/modules/host-tabs.js +43 -0
- package/src/modules/index.js +2 -1
- package/src/modules/user.js +70 -0
- package/types/index.d.ts +96 -5
package/README.md
CHANGED
|
@@ -287,6 +287,64 @@ const me = await Usion.leaderboard.me(); // { score, rank, total }
|
|
|
287
287
|
`friends()` is scoped to users you've chatted with (your conversations) plus
|
|
288
288
|
yourself. Works in standalone *and* embedded games (rides the backend channel).
|
|
289
289
|
|
|
290
|
+
### Tournament support registration
|
|
291
|
+
|
|
292
|
+
Declare tournament support in the game's service registration. This is
|
|
293
|
+
optional game metadata shared by SDK v2 and v3, separate from `sdk.capabilities`.
|
|
294
|
+
It makes the game eligible for tournament discovery; it does not create an
|
|
295
|
+
active tournament, a bracket, entry fees, prizes, or permission to trust scores.
|
|
296
|
+
Leaderboard or multiplayer support alone does not opt a game in.
|
|
297
|
+
|
|
298
|
+
From the creator's trusted server or development tooling, use the creator REST
|
|
299
|
+
API with the creator's bearer token. Keep that credential out of mini-app code.
|
|
300
|
+
For a new game:
|
|
301
|
+
|
|
302
|
+
```http
|
|
303
|
+
POST /services
|
|
304
|
+
Authorization: Bearer <creator-token>
|
|
305
|
+
Content-Type: application/json
|
|
306
|
+
|
|
307
|
+
{
|
|
308
|
+
"name": "My Game",
|
|
309
|
+
"iframe_url": "https://game.example",
|
|
310
|
+
"tags": ["game"],
|
|
311
|
+
"is_published": true,
|
|
312
|
+
"tournament": { "enabled": true }
|
|
313
|
+
}
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Enable an existing registered game without changing its other settings:
|
|
317
|
+
|
|
318
|
+
```http
|
|
319
|
+
PUT /services/<service-id>
|
|
320
|
+
Authorization: Bearer <creator-token>
|
|
321
|
+
Content-Type: application/json
|
|
322
|
+
|
|
323
|
+
{ "tournament": { "enabled": true } }
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
The service must have the `game` tag. Set `enabled` to `false` to disable;
|
|
327
|
+
omit `tournament` on unrelated updates to preserve the current setting. New
|
|
328
|
+
games default to disabled. Query discoverable, opted-in games with
|
|
329
|
+
`GET /registry/explore/items?section=games&tournament=true`; existing visibility
|
|
330
|
+
and access rules still apply.
|
|
331
|
+
Unpublished or otherwise inaccessible games are not made discoverable by this
|
|
332
|
+
marker; opt-in on an existing game preserves its publication status.
|
|
333
|
+
|
|
334
|
+
For an AI Creator build, put exactly one declaration in the entry HTML:
|
|
335
|
+
|
|
336
|
+
```html
|
|
337
|
+
<meta name="usion:tournament" content="true">
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
Use `content="false"` to disable. Only the exact values `true` and `false` are
|
|
341
|
+
accepted; duplicate declarations or attributes are rejected before publishing.
|
|
342
|
+
Comments, scripts, and other files do not declare support. Omitting the marker
|
|
343
|
+
on a later build preserves the registered value; remove support explicitly
|
|
344
|
+
before changing the service from a game into an app. Hand-built games use the
|
|
345
|
+
creator API above; loading the SDK or adding a marker to an external site does
|
|
346
|
+
not register or change its service.
|
|
347
|
+
|
|
290
348
|
### Matchmaking (play with online strangers)
|
|
291
349
|
|
|
292
350
|
Pair players who don't know each other into a game:
|