Skip to content

Decentraland Setup

Everything for Decentraland is in one npm package, @virvixr/dcl (current version 2.25.0). Import from it, not from the internal @virvixr/adapter-dcl or @virvixr/core packages, which aren’t published.

Install

Terminal window
npm install @virvixr/dcl
npx @virvixr/dcl install

Peer dependency: @dcl/sdk 7.26.0 or newer (the HUD scales with the SDK’s virtual canvas, so it isn’t tiny on high-DPI screens).

npx @virvixr/dcl install copies the HUD’s launcher icon to images/virvi/hud-v.png and the Creator Hub script to assets/scene/Scripts/VirviManager.ts. Deploy the icon with the scene. npx @virvixr/dcl sync keeps it up to date.

Version 2 is a rewrite and isn’t compatible with the 0.x (SDK 6) API.

Moving from vlm-dcl

Virvi was called Virtual Land Manager (VLM) until October 2026, and its package was vlm-dcl. That package is no longer updated, and the server it connects to (api.vlm.gg) is gone, so a scene that uses it can’t reach Virvi. If your scene, or an agent working on it, installed vlm-dcl, switch it to @virvixr/dcl:

Terminal window
npm uninstall vlm-dcl
npm install @virvixr/dcl
npx @virvixr/dcl install

Then change from 'vlm-dcl' to from '@virvixr/dcl' and rename what you import. Nothing else in your code changes.

vlm-dcl@virvixr/dcl
createVLMcreateVirvi
startVLMAnalytics, stopVLMAnalyticsstartVirviAnalytics, stopVirviAnalytics
startVLMManagerstartVirviManager
VLMSmartItem, VLMSmartItemProps, VLMManagerOptionsVirviSmartItem, VirviSmartItemProps, VirviManagerOptions
Types VLM, VLMInitConfig, VLMStorageVirvi, VirviInitConfig, VirviStorage
CLI vlm-dcl install, vlm-dcl syncvirvi-dcl install, virvi-dcl sync (or npx @virvixr/dcl …)

A scene added with Import on the Scenes page is switched for you.

Basic usage

import { createVirvi } from '@virvixr/dcl'
export async function main() {
await createVirvi()
}

That’s it. Everything configured for the scene in Virvi renders automatically. The scene’s owner gets the management HUD (top right); visitors see only the content.

Analytics only

import { startVirviAnalytics } from '@virvixr/dcl'
export function main() {
startVirviAnalytics()
}

This collects visits, movement, interactions, video and emote analytics, with no HUD and no live content. No Virvi account is needed. Later, sign in to the dashboard with the wallet that owns the LAND or World and claim the scene to see its data.

createVirvi() starts analytics too. createVirvi({ analytics: false }) turns them off. stopVirviAnalytics() stops them.

Track your own events with virvi.track('bought_ticket', { tier: 'vip' }).

Show your Virvi models on the Decentraland map

For scenes that run your own code: uploaded through Scene Import, or built elsewhere and connected to a Virvi scene. Scenes Virvi builds for you already do this.

import { createVirvi, placeDeployedModels } from '@virvixr/dcl'
export async function main() {
await placeDeployedModels()
await createVirvi()
}

This needs @virvixr/dcl 2.11.0 or later.

Why it’s needed. Decentraland builds the map and the distant view of your scene from a snapshot. To take it, Decentraland runs your scene for a few seconds with no network, so models Virvi adds while the scene is live never get in.

What it does:

  • When Virvi deploys your scene, it adds one file next to yours, virvi/placements.json. It lists where each placed copy of the Virvi models in that deploy goes.
  • placeDeployedModels() reads that file and places those models straight away. Decentraland’s snapshot then has them, and visitors see them before Virvi connects.
  • When createVirvi() connects, it takes those models over without loading them again. It removes any you’ve deleted since, or that belong to another preset.

Without the file (nothing placed, or a deploy from before this existed), it places nothing. It never throws, and it stops waiting after 5 seconds.

Import both functions from @virvixr/dcl, and await the first before calling createVirvi(). Called once Virvi has loaded the scene, placeDeployedModels() does nothing. If you never call it, nothing changes.

When the file changes:

  • Virvi writes the file every time it deploys the scene: a new upload, or a redeploy when you add models. It only lists models that are in that deploy.
  • Moving a model in Virvi doesn’t redeploy the scene on its own. Until the next deploy, the snapshot keeps the earlier positions.
  • Virvi never changes your code or scene.json for this. A virvi/placements.json inside an upload (a “Download live” zip has one) is replaced with the current one.

The map photo. Decentraland re-captures the map by hand, now and then. So even with the snapshot ready, the map picture may take a while to change. Worlds don’t have a satellite map yet.

How to check:

  • On the dashboard: the destination’s card has a Map data line under Last deploy. It says ready (N models), waiting for Decentraland, or that Decentraland didn’t build a snapshot. Virvi checks for 24 hours after each deploy it makes. A scene you deploy yourself shows no Map data line until Virvi deploys it.
  • Directly: open https://abgen-cdn.decentraland.org/LOD/lods-unity/manifests/<entityId>_InitialSceneState.json with the deploy’s entity id. A 200 whose assets list your models means the snapshot is ready.

Configuration

createVirvi(config?) takes:

OptionDefaultWhat it does
env'prod''prod' (https://api.virvi.io), 'staging' or 'dev' (http://localhost:3010)
apiUrlfrom envYour server’s HTTP address. For self-hosted Virvi
wssUrlfrom envYour server’s WebSocket address. Set it whenever you set apiUrl
sceneIdnoneThe Virvi scene to show, as content only (see below). Without it, Virvi asks the server what the player gets at this location
enableHudtruefalse hides the management HUD
analyticstruefalse turns automatic analytics off
debugofftrue, or a list of areas, for debug logging
const virvi = await createVirvi({
env: 'prod',
sceneId: '645c3a07-5d49-469f-88f3-1636fd55e701',
debug: true,
})

Leave sceneId out unless you only want to show content. With a sceneId, the scene shows that Virvi scene’s content anywhere, and its team gets the HUD’s Stats tab, but never in-world editing, roles or media tools. Where the scene isn’t set up at that parcel or World, the HUD also says “Set up Virvi at this location to edit”. To edit in-world, leave sceneId out and set Virvi up at the location from the HUD.

One Virvi per scene. Call createVirvi once. A Virvi Manager added in Creator Hub to a scene whose code already calls createVirvi doesn’t start a second one.

Scene metadata

Scenes the Virvi dashboard builds carry their scene ID in scene.json, and Virvi sends it when it signs in. It doesn’t stand in for the sceneId option above:

{
"virvi": {
"sceneId": "645c3a07-5d49-469f-88f3-1636fd55e701"
}
}

Self-hosted Virvi

Point the scene at your server. Set both addresses:

import { createVirvi, startVirviAnalytics } from '@virvixr/dcl'
export async function main() {
await createVirvi({
apiUrl: 'https://virvi.example.com',
wssUrl: 'wss://virvi.example.com',
})
}
// Analytics only, against your server:
// startVirviAnalytics({ apiUrl: 'https://virvi.example.com' })
  • With only apiUrl, the WebSocket still goes to virvi.io. Always set wssUrl too.
  • npx @virvixr/dcl sync --server https://virvi.example.com syncs models from your server.
  • In Creator Hub, fill in the Virvi Manager’s serverUrl field. It derives the WebSocket address from it (https becomes wss), unless you also fill in wssUrl.
  • Sign-ins are verified with Decentraland’s signed fetch. In a local preview (localhost), a non-cloud server can also accept unverified sign-ins when ALLOW_UNVERIFIED_PLATFORM_AUTH=true. Never set that on a public server.

Creator Hub

Easiest: download Virvi Manager from virvi.io/downloads, unzip it into Creator Hub’s Custom Items folder, click Refresh in the Custom Items tab, and drag it into your scene. It carries its own copy of this package, so no terminal is needed. To update it, download the newest one and replace the item; the HUD tells your team when a newer one is out.

With npm: in a terminal in your scene folder, run npm install @virvixr/dcl, then npx @virvixr/dcl install. In Creator Hub, add an entity (for example “Virvi Manager”), add a Script component, and pick VirviManager.ts. An edited VirviManager.ts is left alone by install unless you pass --force; the script an older release installed, unedited, is updated.

Fill in the fields, or leave them:

FieldDefaultMeaning
sceneIdblankBlank: set the scene up from the in-world HUD (needed for in-world editing). A Virvi scene ID shows that scene’s content only (see Configuration)
envprodprod, staging or dev. Anything else runs against prod and logs a warning
serverUrlblankOnly for self-hosted Virvi
wssUrlblankOnly for self-hosted Virvi whose WebSocket is on another host
enableHudonIn-world management HUD for the scene’s team
enableAnalyticsonVisitor analytics
showBeaconoffShow the Virvi Manager’s own marker. It never hides the entity you attach it to
debugoffExtra Virvi logging in the console

One Virvi Manager per scene is enough. A second one uses the first one’s connection, and says so in the console.

The Virvi Manager places your Virvi models before it connects, so they show on the Genesis City map and in the distant view, as in scenes built by Virvi.

Creator Hub actions can call these Virvi Manager methods:

MethodWhat it does
connectConnects to Virvi (it connects on its own when the scene starts)
disconnectDisconnects until connect is called
toggleHudShows or hides the Virvi HUD panel
switchPresetMakes a preset live for everyone. Works for a signed-in host, co-host or editor
claimGiveawayEnters the visitor who triggered it into a giveaway, as the giveaway card’s button does
sendMessageSends a multiplayer message to everyone in the scene (scene code hears it with onMessage)
recordActionRecords a named interaction in the scene’s analytics

What the package exports

ExportWhat it is
createVirvi(config?)Connects the scene to Virvi. Resolves to the Virvi object
startVirviAnalytics(opts?), stopVirviAnalytics()Analytics without the rest. opts: { env?, apiUrl? }
placeDeployedModels()Places deployed Virvi models before the scene connects (see below)
startVirviManager(entity, options?)The Creator Hub script’s entry point. Returns the VirviSmartItem
VirviSmartItem (and the default export)The smart item: the methods in the table above, plus getVirvi() and isConnected()
Types Virvi, VirviInitConfig, VirviStorageFor TypeScript

Developer APIs

import { createVirvi } from '@virvixr/dcl'
export async function main() {
const virvi = await createVirvi()
// Messages between players in the scene (see Multiplayer Events)
virvi.onMessage('game-event', (data) => console.log(data))
// Analytics
virvi.track('level-complete', { level: 3 })
// Element data, once connected
virvi.onStateChange((state) => {
if (state === 'connected') console.log(virvi.storage.videos.configs['my-screen'])
})
}

sendMessage throws until the scene’s room is joined. See How it works for a whenConnected helper.

Platform capabilities

The Decentraland adapter reports:

CapabilitySupported
VideoYes
Spatial audioYes
glTF modelsYes
Custom emotesYes
Player teleportYes
External URLsYes
NFT displayYes
CollidersYes
Screen-space UIYes
Spatial UINo