A URL query string is a data delivery method that provides input data at the end of the URL.
E.g.,https://zep.us/play/{mapHashId}?{parameter}={value}
You can deliver data to a ZEP Space or ZEP Script using a URL query strings.
URL Query String Parameters Available in ZEP
1. name
When users who are not signed in enter a Space, you can set their nickname as the value passed as the name parameter.
Example: https://zep.us/play/{mapHashId}?name=A
⚠️ Make sure to deactivate nickname settings pop-up for guests!
2. customData
You can pass data to ZEP Script player objects.
You can create a whitelist function, such as identifying users by passing user identification information such as SSO token information to ZEP Script.
Example 1
Receive user information with customData and apply it. (Normal app, sidebar app recommended)
App.onJoinPlayer.Add(function (player) {
// Checks if there is customData passed
if (player.customData) {
// Converts customData to object and uses
let playerCustomData = JSON.parse(player.customData);
if (playerCustomData.hasOwnProperty("name")) {
player.name = playerCustomData["name"];
}
if (playerCustomData.hasOwnProperty("moveSpeed")) {
player.moveSpeed = playerCustomData["moveSpeed"];
}
if (playerCustomData.hasOwnProperty("title")) {
player.title = playerCustomData["title"];
}
App.sayToAll("customData applied");
player.sendUpdated();
}
// Displays message if there is no customData passed
else {
App.sayToAll("customData not delivered.");
}
});