Optional
dataOptional
jwtOptional
sceneOptional
scenesOptional
webhooksDrops a scene in a world and returns sceneDropId.
await world.dropScene({
"sceneId": "string",
"position": {
"x": 0,
"y": 0
},
"assetSuffix": "string"
});
{ sceneDropId: sceneId-timestamp, success: true }
Optional
allowOptional
assetOptional
sceneOptional
error?: unknownOptional
message?: stringOptional
params?: objectOptional
sdkRetrieves the data object for a world. Must have valid interactive credentials from a visitor in the world.
await world.fetchDataObject();
const { dataObject } = world;
Retrieves details of a world.
await world.fetchDetails();
const { name } = world;
Retrieve all assets dropped in a world.
await world.fetchDroppedAssets();
const assets = world.droppedAssets;
Retrieve all assets dropped in a world matching sceneDropId.
await world.fetchDroppedAssetsBySceneDropId({
sceneDropId: "sceneDropIdExample",
uniqueName: "optionalUniqueNameExample",
});
const assets = world.droppedAssets;
Optional
uniqueRetrieve all assets dropped in a world matching uniqueName.
await world.fetchDroppedAssetsWithUniqueName();
const assets = world.droppedAssets;
Optional
isOptional
isRetrieve all landmark zone assets dropped in a world.
const zones = await world.fetchLandmarkZones("optionalLandmarkZoneName", "optionalSceneDropIdExample");
Optional
landmarkZoneName: stringOptional
sceneDropId: stringUse fetchScenes instead.
Fetch a list of all scene drop ids in a world that include at least one asset with an interactivePublicKey
await world.fetchSceneDropIds();
{ sceneDropIds: [] }
Fetch a list of all scene drop ids and dropped assets in a world
await world.fetchScenes();
{ "scenes": {
"sceneDropId_1": {
"droppedAssets": {
"droppedAssetId_1": {
"metaName": "hello"
"metaNameReversed": "olleh"
},
"droppedAssetId_2": {
"metaName": "world"
"metaNameReversed": "dlorw"
}
}
},
}
}
Retrieve all webhooks in a world.
await world.fetchWebhooks();
const webhooks = world.webhooks;
Retrieve world analytics by day, week, month, quarter, or year
const analytics = await world.fetchWorldAnalytics({
periodType: "week",
dateValue: 40,
year: 2023,
});
Get all particles available
await world.getAllParticles();
Increments a specific value in the data object for a world by the amount specified. Must have valid interactive credentials from a visitor in the world.
Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id
await world.incrementDataObjectValue("key", 1);
Optional
analytics?: AnalyticType[]Optional
lock?: { Optional
releaseReplace the current scene of a world.
const droppedAssetsToUpdate = [world.droppedAssets["6"], world.droppedAssets["12"]]
const style = {
"textColor": "#abc123",
"textFontFamily": "Arial",
"textSize": 40,
"textWeight": "normal",
"textWidth": 200
}
await world.replaceScene(SCENE_ID);
Sets the data object for a user. Must have valid interactive credentials from a visitor in the world.
Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id
await world.setDataObject({
"exampleKey": "exampleValue",
});
const { dataObject } = world;
Optional
analytics?: AnalyticType[]Optional
lock?: { Optional
releaseTrigger a particle effect at a position in the world
await world.triggerParticle({ name: "Flame" });
Optional
duration?: numberOptional
id?: stringOptional
name?: stringOptional
position?: objectSet close world settings
await world.updateCloseWorldSettings({
controls: {
allowMuteAll: true,
disableHideVideo: true,
isMobileDisabled: false,
isShowingCurrentGuests: false,
},
description: 'Welcome to my world.',
forceAuthOnLogin: false,
height: 2000,
name: 'Example',
spawnPosition: { x: 100, y: 100 },
width: 2000
});
Update multiple custom text dropped assets with a single style while preserving text for specified dropped assets only.
const droppedAssetsToUpdate = [world.droppedAssets["6"], world.droppedAssets["12"]];
const style = {
"textColor": "#abc123",
"textFontFamily": "Arial",
"textSize": 40,
"textWeight": "normal",
"textWidth": 200
};
await world.updateCustomText(droppedAssetsToUpdate, style);
Updates each DroppedAsset instance and world.droppedAssets map.
Updates the data object for a world. Must have valid interactive credentials from a visitor in the world.
Optionally, a lock can be provided with this request to ensure only one update happens at a time between all updates that share the same lock id
await world.updateDataObject({
"exampleKey": "exampleValue",
});
const { dataObject } = world;
Optional
analytics?: AnalyticType[]Optional
lock?: { Optional
releaseUpdate details of a world.
await world.updateDetails({
controls: {
allowMuteAll: true,
disableHideVideo: true,
isMobileDisabled: false,
isShowingCurrentGuests: false,
},
description: 'Welcome to my world.',
forceAuthOnLogin: false,
height: 2000,
name: 'Example',
spawnPosition: { x: 100, y: 100 },
width: 2000
});
Summary
Create an instance of World class with a given url slug and optional attributes and session credentials.
Usage