Retrieves the data object for a Topia ecosystem. Requires canUpdateEcosystemDataObjects permission to be set to true for the public key.
OptionalappPublicKey: stringOptionalappJWT: stringOptionalsharedAppPublicKey: stringOptionalsharedAppJWT: stringPopulates the dataObject property with ecosystem-wide data, or returns an error response.
Increments a specific value in the data object for a Topia ecosystem by the amount specified. Must have valid interactive credentials from a visitor in the world.
Returns success or an error response.
This method also allows you to increment a data object value on behalf of another Public Key. It requires canUpdateEcosystemDataObjects permission to be set to true for the Public Key.
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
Sets the data object for a Topia ecosystem.
Returns success or an error response.
This method also allows you to set a data object on behalf of another Public Key. It requires canUpdateEcosystemDataObjects permission to be set to true for the Public Key.
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
Updates the data object for a Topia ecosystem.
Returns success or an error response.
This method also allows you to update a data object on behalf of another Public Key. It requires canUpdateEcosystemDataObjects permission to be set to true for the Public Key.
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 ecosystem.updateDataObject({
[`profiles.${profileId}.itemsCollectedByUser`]: { [dateKey]: { count: 1 }, total: 1 },
[`profileMapper.${profileId}`]: username,
}, {
sharedAppPublicKey: "exampleAppPublicKey",
sharedAppJWT: "exampleAppPublicKeyJWT",
analytics: [{ analyticName: "itemCollected", profileId, uniqueKey: profileId, urlSlug } ],
lock: { lockId: `${assetId}-${resetCount}-${new Date(Math.round(new Date().getTime() / 10000) * 10000)}` },
}
});
const { exampleKey } = ecosystem.dataObject;
Retrieves all inventory items for a given keyholder (app public key).
Populates the inventoryItems property with an array of InventoryItem objects.
Checks a string against the platform's banned words, sentences and emojis.
True when the text matches a banned word, sentence or emoji. Empty input is never banned.
Use this to screen user generated content — a display name, a chat line, a submitted answer — before sending it on, so the app can give immediate feedback instead of having the platform reject it later.
This applies the same matcher the server uses, so a result here should agree with the platform's own check. It is still a courtesy check, not a replacement: the server screens independently and remains the authority.
Matching is by whole word, not substring, so classic is not flagged by a banned ass. Leetspeak (d4rn), spelled-out words (d.a.r.n) and padded endings (go awayyy) are all caught.
The lists are fetched once and cached on first use, so calling this per keystroke costs nothing after the first call. The platform caches them for up to 24 hours, so a change made in HQ may take that long to appear.
OptionaldataOptionaljwtStandardized error handler for all SDK operations.
Standardized error object with properties: data, message, method, params, sdkMethod, stack, status, success, url
This method processes errors from API calls and formats them consistently across the SDK. It extracts relevant error information including:
All errors thrown by SDK methods flow through this handler to ensure consistent error format.
Returns the configured Axios instance for making API calls to Topia's Public API.
The configured Axios client instance with authentication headers.
Create an instance of Ecosystem class with optional session credentials
Example