Code a Kick widget: quick start
You can write custom Kick overlays directly in HTML, CSS, and JavaScript using the KickBot widget code editor. KickBot runs your widget inside a sandboxed page, connects to your Kick channel, and exposes the global kb object for live Kick events, settings, saved data, dashboard controls, chat, and TTS.
You need a KickBot account with your Kick channel connected, and a computer (the widget editor requires a desktop screen). Custom widgets are free with no limit on how many you can make. Team moderators need the Widget builder permission in Manage team.
Start from code
Section titled “Start from code”- Open Widgets > Create (kickbot.com/dashboard/widget-create) and click Start from code (kickbot.com/dashboard/widget-create/code).
- Pick one of three starting points:
- Starter widget: A small working example that shows live Kick chat messages.
- A library widget: Search the library and copy any widget as an editable remix.
- Files from your computer: Choose a
.zipfile (up to 20 MB) or a folder that contains anindex.html. KickBot importsindex.html, CSS, JavaScript, andwidget.json(inlining local stylesheet and script references intostyle.cssandscript.js). Images and sounds are not imported; upload them in the editor instead.
- Under Details, enter a Name (up to 80 characters; you can leave it empty) and set the Width and Height in pixels (
800 × 600by default; a library widget keeps its own size). - Click Create widget.
The editor opens in Code view. Use the panel toggles in the top right to show or hide AI, Files, Preview, and Console, or switch between Preview, Code, and Settings in the top bar.
The four files
Section titled “The four files”Every KickBot widget is made of four files:
| File | Purpose | Size limit |
|---|---|---|
index.html | HTML markup only. Do not include <html>, <head>, <body>, <link href="style.css">, or <script src="script.js">; KickBot injects the SDK, CSS, and JavaScript automatically. | 500 KB |
style.css | CSS styles. Keep html and body transparent so the stream shows behind your widget. | 500 KB |
script.js | Plain browser JavaScript. Runs after the HTML is in the page, and kb is ready right away. | 500 KB |
widget.json | Widget size (width, height), settings (up to 60), saved_data labels (up to 30), and controls buttons (up to 8). | 100,000 characters |
You can edit widget.json directly in Code or build settings visually in the Settings tab. The visual editor supports Text, Number, Switch, Color, Font, Choice, Image, Sound, and Video fields, along with drag-to-reorder, sections, and Show only when rules. The Files sidebar also lists uploaded image, sound, and video defaults under assets and shows your total file and saved-data sizes. If you paste a full HTML page, mismatched CSS or JavaScript, or stray wrapper tags into a file, the editor offers a one-click fix with Undo.
For every kb method, event payload, and widget.json field, see KickBot widget SDK reference.

Build your first widget: session follow counter
Section titled “Build your first widget: session follow counter”Create a new widget with Starter widget, then replace the four files below to build a working follow counter with one color setting, one saved count that survives OBS restarts, and one reset button.
1. Define size, settings, saved data, and controls in widget.json
Section titled “1. Define size, settings, saved data, and controls in widget.json”{ "width": 360, "height": 120, "settings": [ { "key": "accent", "type": "color", "label": "Accent color", "default": "#53FC18" } ], "saved_data": [ { "key": "follows", "type": "number", "label": "Follows this session", "default": 0 } ], "controls": [ { "id": "reset", "label": "Reset count", "confirm": true } ]}2. Add the markup in index.html
Section titled “2. Add the markup in index.html”<div class="card"> <span class="label">Session follows</span> <span id="count" class="count">0</span></div>3. Style the card in style.css
Section titled “3. Style the card in style.css”html,body { margin: 0; width: 100%; height: 100%; background: transparent;}
.card { box-sizing: border-box; width: 100%; height: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-radius: 14px; background: rgba(14, 15, 18, 0.88); border-left: 5px solid var(--accent, #53fc18); color: #ffffff; font-family: Inter, system-ui, sans-serif;}
.label { font-size: 16px; font-weight: 600; opacity: 0.85;}
.count { font-size: 42px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent, #53fc18);}4. Wire up events, saved data, controls, and settings in script.js
Section titled “4. Wire up events, saved data, controls, and settings in script.js”const countEl = document.getElementById('count');let follows = 0;
function applySettings(settings) { document.documentElement.style.setProperty('--accent', settings.accent || '#53FC18');}
function render() { countEl.textContent = String(follows);}
applySettings(kb.settings);
kb.store .get('follows') .then((saved) => { follows = typeof saved === 'number' ? saved : 0; render(); }) .catch((err) => console.error('Failed to load follows:', err));
kb.on('follow', (e) => { follows += 1; render(); console.log('Follow from', e.user.username); kb.store.set('follows', follows).catch((err) => console.error('Failed to save follows:', err));});
kb.on('control', ({ id }) => { if (id !== 'reset') return; follows = 0; render(); kb.store.set('follows', follows).catch((err) => console.error('Failed to reset follows:', err));});
kb.on('settings', (next) => { applySettings(next);});5. Test it
Section titled “5. Test it”- Click Follow in the test bar to watch the counter increment and see the viewer’s name logged in Console.
- Open the Saved data tab at the bottom to verify
followsupdated. - Switch to Preview at the top of the editor and click Reset count under Actions in the test bar to test your control button. In the editor it runs at once, without the confirm popup. On the widget’s settings page, Actions asks first.
- Click Clear test events when finished testing.
Console, Events, and Saved data tabs
Section titled “Console, Events, and Saved data tabs”The bottom strip in the editor has three tabs:
- Console: Shows
console.log,console.info,console.warn, andconsole.erroroutput plus runtime errors with file and line numbers. Simulated chat and TTS output from test events appears here too. Click Fix with AI next to an error to send it to KickBot AI chat (this uses one of your monthly KickBot AI messages). The console clears each time your code reloads. - Events: Lists test events sent during this editing session with timestamps and whether each event came from you or from a connected AI app.
- Saved data: Shows live key-value pairs stored with
kb.storein the editor preview. The preview starts from your channel’s saved data; changes written inside the preview stay in the preview. On your installed widget’s settings page in My widgets, streamers can inspect, edit, or reset values defined undersaved_data(up to 3 MB per installed widget, 512 KB per value).
Test events
Section titled “Test events”Use the test buttons below or next to the preview to trigger sample events: Follow, Sub, Gifted subs, KICKs, Tip, Raid, Chat message, TTS, and AI image. When your code listens for Pinned message, Unpin, Stream start, Stream end, or chat commands (!command), those buttons appear too. Events your code does not listen for appear dimmed. Your controls buttons show under Actions in Preview view; test them there.
Sizes and preview modes
Section titled “Sizes and preview modes”Set width (50 to 3840 px) and height (50 to 2160 px) in widget.json, or click the size in the Preview toolbar to edit it directly. Use these preview modes to check layout and readability:
- Close-up: Inspect the widget at Fit or real size (
100%) on Studio, Game, Moving, Bright, or None backgrounds. - On stream: See your widget at real scale on a 1920 × 1080 stream canvas and drag it to test placement (position in the preview does not change OBS).
Click Reload preview (the round arrow next to the preview) to load the widget again from the start.
How settings reach your code
Section titled “How settings reach your code”- Initial values:
kb.settings.<key>is ready as soon asscript.jsstarts, filled with the streamer’s values or yourdefaultvalues fromwidget.json. - Live updates: Listen to
kb.on('settings', (next) => ...)to apply setting changes without reloading the widget. If a widget does not register asettingslistener, KickBot restarts the widget with the new settings. - Fonts: For any setting with
"type": "font", KickBot loads the selected Google Font stylesheet automatically. Setfont-familyin CSS or JavaScript with a fallback font. - Conditional settings (
show_if): Hiding a setting withshow_ifonly hides it in the dashboard. Its value stays inkb.settings, so check the controlling setting in your code.
Saving and Versions
Section titled “Saving and Versions”Your changes save automatically in the editor. The status indicator shows Not saved yet, Saving, or All changes saved. If widget.json has an error, nothing is saved: the top bar shows Some changes were not saved and the error appears under widget.json until you fix it.
Each save updates your own installed copy and reloads it in OBS automatically. Other channels using a published version of your widget do not receive edits until you publish a new version.
Click Versions in the top bar to browse earlier saved snapshots and click Restore to roll back. KickBot saves your current files as Before a restore before replacing them.
Add to OBS
Section titled “Add to OBS”Click Add to OBS in the top right of the editor to reveal and copy your private widget URL along with the exact width and height for your OBS browser source. Click Put it in a scene to add the widget to a KickBot scene instead; see Combine widgets in KickBot scenes and Add a KickBot overlay to OBS.
A widget only counts live events and chat commands while it is open in OBS (or another streaming app such as Streamlabs Desktop, Meld Studio, XSplit, vMix, PRISM Live Studio, or Lightstream).
Next steps
Section titled “Next steps”- KickBot widget SDK reference: every
kbevent payload, channel property, saved data method, chat and TTS helper, andwidget.jsonfield. - Publish and share a widget: run the automatic library check, add preview pictures, and share via the library or a direct link.
- Build a Kick widget with KickBot AI: ask the built-in AI chat to generate or update code inside the editor.
- Build a Kick widget with your own AI: connect Claude, ChatGPT, Cursor, or Codex over MCP to edit and test your files directly.