Scripting.
Write small scripts that react to your stream and do things only a local app can: press a hotkey, switch an OBS scene, play a sound, call a web API, or send a chat message. Scripts run on your machine, in a sandbox, only with the powers you grant them.
What a script is
A script is a short piece of TypeScript that listens for something on your stream and does something in response. You listen with ot.on('chat.message', handler) or an event like ot.on('alert.redemption', handler), and inside the handler you call an action like ot.playSound('/path/to/airhorn.mp3') or ot.obs.setScene('BRB'). Turn the script on, and it runs every time that event fires.
// Airhorn + a webcam scene when someone redeems Hydrate
ot.on('alert.redemption', (e) => {
if (e.payload.reward_title !== 'Hydrate') return;
ot.playSound('/Users/you/Sounds/airhorn.mp3');
ot.obs.setScene('Webcam');
});Write it in the editor
The Companion has a built-in editor with autocomplete for the whole ot API. Create a script, write your handler, and flip it on in the list. You can also trigger a script by a global hotkey with ot.onHotkey('ctrl+alt+d', handler) or on a timer with ot.onSchedule('@every 5m', handler), not just by stream events.
See exactly what it does
The console traces every action a script takes as it runs, not just the lines you log yourself. Fire a hotkey and you see -> hotkey cmd+space; send a chat line and you see -> chat.send. When something does not happen, the console tells you why, because a denied capability or an error shows up right next to the action that tried it.
Chords and sequences
When you press keys, + joins keys into a chord held together, and an array fires keys one after another. So ot.key('cmd+space') holds Cmd and Space together (opening Spotlight), while ot.hotkey(['a', 'b']) presses A, then B. To hold a chord through the array form, keep it in one element: ot.hotkey(['cmd+space']).
A script can press keys, drive OBS, and post in your chat, so each one only runs with the capabilities you explicitly grant it. Read Permissions & security before you enable a script you did not write.
Let AI write it
Not sure where to start? Use Ask AI to build a script, describe what you want in plain English ("when someone redeems Hydrate, switch to my webcam scene for ten seconds"), and the builder writes a complete, named script for you. It marks every value you might want to change with a 👉 EDIT comment, a sound file, a scene name, a keyword, so you can personalize it in seconds. Generated scripts still start with no powers granted, so you review what it does and grant only what it needs.
See the full scripting API, then read Permissions & security.