Ship your mascot in an app
An app key lets an app or a website play your mascot's canvas without a backend. You put the key inside the app or the web page. It belongs to one mascot and can only read that mascot's released canvases, so it never exposes your account: someone who digs it out of the app gets what the app already has.
How it works
- Send a version of the canvas. On the canvas page, click the button at the top right that says where the mascot is ("Not in apps yet", "Version 3 · changes"), then Send version. Over the API or MCP this is a release (
release_canvas). An app key never sees drafts. - Get your link in the same panel: one link that carries the canvas and an app key,
https://api.masko.ai/v1/canvases/CANVAS_ID/delivery?key=masko_app_…, with code for the web, React and iPhone. The key is shown once. You can also create a key with the API, withcreate_app_keyover MCP, or in Get Links → App keys on the mascot page. - Put the link in your app. The panel shows Connected once an installed copy has asked for it.
- The app asks for the canvas's latest release, downloads its files, keeps them and plays them with the Masko player. On iPhone, iPad and Mac, and on the web from player 0.1.13, the player does all of this from the link; a website does it straight from the page, with no server (play a canvas).
- Send a new version whenever you like: the app gets it the next time it asks, for example every hour. No new app version is needed. Use this version on an older one sends it back to apps as the next version.
One link, or the link and the key
An app can carry the key inside the link, …/delivery?key=masko_app_…, or send it apart as Authorization: Bearer masko_app_…. Both work on every request below. Only app keys are read from a link, never your account API key, and when a header also holds a key, the header wins.
The Masko player takes that one link: on the web and on iPhone, iPad and Mac from 0.1.18, on Android, React Native and Flutter from 0.1.19.
<script src="https://cdn.jsdelivr.net/npm/@masko/player/dist/masko-player.js"></script>
<script>
MaskoPlayer.mount(document.getElementById('mascot'), {
url: 'https://api.masko.ai/v1/canvases/CANVAS_ID/delivery?key=masko_app_YOUR_APP_KEY'
});
</script>Play it with the Masko player
On iPhone, iPad and Mac (Masko player 0.1.12 and later), give the player the canvas's URL and the app key:
import MaskoPlayer
let player = MaskoPlayer(
url: URL(string: "https://api.masko.ai/v1/canvases/CANVAS_ID/delivery")!,
appKey: "masko_app_YOUR_APP_KEY")
MaskoView(player: player) // or MaskoPlayerView(player: player)
player.set("pointerHover", true)The player asks for the latest release, downloads every file once and keeps it, so the mascot plays offline. It asks again at launch and every hour. A new release is used once all its files are downloaded, and it takes over when the mascot's first pose starts its loop again, so nothing jumps; the values your app set carry over. The files live in the app's Application Support folder, left out of backups. Before the first release has arrived, the values you set choose the first pose and fire calls are dropped.
The rest of this page is what the player does for you there, and on Android, React Native and Flutter from player 0.1.19 (loadCanvas(url), <MaskoView url>, MaskoView(url:)). An app with its own server, or an older player, makes the request itself and gives the delivery to the player.
What an app key can read
| Request | With an app key |
|---|---|
GET /v1/canvases/{canvasId}/delivery, the canvas's latest release | Yes, for every canvas of its mascot |
GET /v1/canvases/{canvasId}/releases/{releaseId}/delivery, one release | Yes, for every canvas of its mascot |
| A canvas of another mascot | 404, as if it did not exist |
| Anything else: the mascot's settings, its other images, stickers, drafts, generating, credits | 403 |
The app sees exactly what the canvas plays. For other files of the mascot, such as stickers or images that no canvas uses, turn on hosting for permanent public links on assets.masko.ai.
Create an app key
In Studio, open the mascot, click Get Links and open the App keys tab: name the key after the app (for example "My app for Mac"), create it and copy it. Over MCP, your agent calls create_app_key. Or call the API with your API key:
curl -X POST https://api.masko.ai/v1/mascots/MASCOT_ID/app-keys \
-H "Authorization: Bearer masko_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "My app for Mac"}'key appears only in this response: Masko keeps a hash, never the key. A mascot can have 20 active app keys; make one per app so you can revoke them separately.
Read the latest release
The app sends its app key as a bearer token, or inside the link as key. Ask for your platform with target (apple for iPhone, iPad and Mac, android, windows, web, or esp32 for ESP32 boards) and add formats=av1 for the lighter AV1 files the Masko player plays in apps. Masko-Install-Id is optional: a random UUID the installed copy keeps, so you can see how many copies are active. Nothing else about the device is recorded.
curl "https://api.masko.ai/v1/canvases/CANVAS_ID/delivery?target=apple&formats=av1" \
-H "Authorization: Bearer masko_app_YOUR_APP_KEY" \
-H "Masko-Install-Id: 6f0c0e5a-1f0b-4a57-9d0a-2b7c5c1d9e11"
# The same with the key in the link
curl "https://api.masko.ai/v1/canvases/CANVAS_ID/delivery?key=masko_app_YOUR_APP_KEY&target=apple&formats=av1"GET /v1/canvases/{canvasId}/releases/{releaseId}/delivery returns one release in the same shape, to pin an app to it.
What a release holds
The delivery describes everything the mascot can do in the app:
- Poses are
runtimeGraph.nodes. Each has anid, anameandtransparentThumbnailUrl, its still picture with a transparent background.initialNodeis the pose it starts on. - Animations are
runtimeGraph.edges. An edge from one pose to another is a move. An edge whosesourceandtargetare the same pose plays on that pose: the first one withoutconditionsis the pose's loop, and the others play when their conditions hold, or now and then.videosholds the file for your target (av1,hevc,webmorstacked),durationits length in seconds. Edges withsource: "*"have no file: they choose the pose to go to when an input is on. - Inputs are
runtimeGraph.inputs: the names your app sends withsetorfire, such asbehavior::pointerHoverwhile the pointer is over the mascot, or your ownaction::snack.conditionson each edge say which input plays it. - Capabilities, when the canvas has them, are
runtimeGraph.capabilities: each behavior and action with a shortnameanddescriptionof what the mascot does, to show in your app's settings.
So an app lists its mascot's poses and animations from nodes and edges, and the Masko player runs the rules for it: your app only says what is happening. Canvas graphs explains every field.
Keep the files
The file links are signed and stop working after one to two days (deliveryAccess.signedUrlExpiresAt), so download the files when the delivery arrives and keep them:
- Name each file after its link's path, without the query: the path never changes, only the signature does.
- Download only the files you do not have yet.
- Rewrite the links in the delivery to your local
file://URLs, leave outdeliveryAccess, and give that delivery to the player. - Ask again later, for example at launch and every hour. The same
release_idmeans nothing changed; a new one means a new release to download. Switch to it once every file is there.
Offline, the app keeps playing what it has. Ship the first pose's loop inside the app so the mascot appears before the first download.
See and revoke keys
GET /v1/mascots/MASCOT_ID/app-keys lists the active keys with their last_used_at and installs_7d, the installed copies that asked in the last 7 days. The App keys tab shows the same, and the canvas panel's Apps line adds up every key of the mascot. Revoking a key stops it at once: apps that carry it keep what they downloaded and stop receiving new releases. Ship a new app version with a new key to bring them back.
curl -X DELETE https://api.masko.ai/v1/mascots/MASCOT_ID/app-keys/APP_KEY_ID \
-H "Authorization: Bearer masko_YOUR_API_KEY"