Public beta — bugs are expected. Questions or issues? .
Skip to content

AnimStream Studio Widget SDK

Build widgets for livestreams

Build anything from a gift alert to your own fireworks. Start with a template or draw your own animation with Canvas or WebGL.

Package
widget.json · SDK v1 & v2
Modes
Flow alert · Live widget
Testing
Browser or preview API
On this page

Get started

Quickstart

  1. 01
    Choose an example and save it as widget.json.
  2. 02
    Load the file into the preview and adjust the text, layout or colour.
  3. 03
    In Vendor Studio, open Widgets, upload your finished widget.json file and submit it for widget review.

Flow alert

alert

Plays briefly when a flow triggers. In the Flow Wizard, choose a trigger and select the widget from your Store assets.

Download example

Live widget

live

Stays visible as a scene source. Studio supplies current session values for a counter or progress bar.

Download example

Test a widget

Load your widget.json or edit the example directly.

Preview with sample data

AI assistants

Build a widget with AI

Give your assistant the Markdown link and your widget idea. For Codex and Claude Code, the agent kit also includes skills for building, testing and submitting widgets.

Starter prompt
Read https://animstream.com/developers/widgets/index.md. Build a valid widget.json for this idea: [your idea]. Choose a v1 layout or a custom Canvas widget (v2) and a matching example. Check the file against the schema and test it with the preview API. Show me the file and the test results.
Download agent kit

Canvas SDK v2

Draw your own effects

Provide a JavaScript render function for Canvas 2D or WebGL 2. It receives the time, current size, event data and live counters. You control the colours, particles, text, transitions and layout.

JavaScript · program
function render({ ctx, width, height, time, event }) {
  ctx.clearRect(0, 0, width, height);
  ctx.fillStyle = "#91f2ff";
  ctx.beginPath();
  ctx.arc(width / 2, height / 2, 20 + Math.sin(time * 4) * 8, 0, Math.PI * 2);
  ctx.fill();
  ctx.fillText(event.user || "Hello", 12, 22);
}

The fireworks combine rockets, sparks, glowing trails and the viewer's name. Choose Fireworks in the playground or download the complete package.

Reference

Widget manifest

A package is a UTF-8 JSON file up to 256 KiB. Version 1 uses the card, strip or plain layout. Version 2 provides its own render function and can bundle images. The schema defines all fields.

ModeFieldsData from Studio
alertdurationSeconds (1–30 s){user}, {gift}, {count}, {coins}, {level} in headline and detail text
livemetric, goal, showProgressgifts, coins, likes, follows, shares, comments, joins, subscribes

For Flow alerts, use the optional events field to list events for review, such as ["GIFT", "FOLLOW"]. Reviewers get a test button for each event. The streamer sets the actual trigger in their flow.

HTTP API

Preview API

Send the manifest as JSON to POST /api/widget-sdk/preview. The response is a watermarked HTML preview with sample data.

Shell
curl --fail-with-body -sS \
  -H 'Content-Type: application/json' \
  --data-binary @widget.json \
  https://animstream.com/api/widget-sdk/preview -o preview.html
HTTPMeaning
200HTML preview
400Invalid JSON
413File exceeds 256 KiB
422Schema errors with field path and message

Publishing

Share and sell

Track your widget review under My widgets → Submissions. Once approved, your widget can be listed in the Store. With shareInCommunity it can also appear in Studio Community. Set the price to €0 for a free widget. Sales carry a 15% commission.

Submit a widget