Upgrade @mux/ts to version 16, where client.robots calls the Robots GA API, and choose which calls move to v1 now and which stay on the Beta API for the moment.
Version 16 of the Mux TypeScript SDK (@mux/ts) makes the Robots GA API (v1) the default. client.robots now calls /robots/v1, and the Beta API (v0) has moved to client.robotsV0. This guide covers the SDK-specific steps. For field-by-field changes, see Migrate Robots from Beta to GA.
Migrate with your coding agent
Paste this prompt into your agent to review your integration, apply the relevant changes, and test the migration.
Upgraded code can compile and still change behavior
Many Robots calls written for version 15 still compile against version 16, but now send requests to v1. Ask Questions, for example, has the same request shape in both versions. Review every client.robots call after upgrading: either move it to client.robotsV0 to stay on the Beta API for now, or update it for v1.
Switch from @mux/mux-node to @mux/ts. @mux/mux-node was renamed, and 15.5.0 is its final release. Replace the dependency and update your imports:
npm uninstall @mux/mux-node && npm install @mux/ts- import Mux from '@mux/mux-node';
+ import Mux from '@mux/ts';Accept the Robots terms in the Mux Dashboard. Without them, v1 requests return 403.
Update and deploy your webhook handlers so they accept both v0 and v1 events. See Migrate Robots webhooks from Beta to GA.
npm install @mux/ts@^16Version 16 has other breaking changes outside Robots, such as the removal of client.data.realTime. See the SDK's migration guide for the full list.
For each Robots call, either keep it on the Beta API for now or move it to v1.
Stay on the Beta API: switch to client.robotsV0. Its methods are deprecated, and each one points to its v1 replacement. Beta types keep their version 15 names under Mux.RobotsV0; for example, Mux.Robots.WorkflowBinding becomes Mux.RobotsV0.WorkflowBinding.
- await mux.robots.jobs.summarize.create({ parameters: { asset_id } });
+ await mux.robotsV0.jobs.summarize.create({ parameters: { asset_id } });Move to v1: keep client.robots and update the request and response fields. For example, Find Key Moments durations change from milliseconds to seconds:
await mux.robots.jobs.findKeyMoments.create({
parameters: {
asset_id,
- target_duration_ms: { min: 15000, max: 45000 },
+ target_duration: { min: 15, max: 45 },
},
});Renaming target_duration_ms to target_duration without converting the values asks for durations 1,000 times longer.
Existing jobs and Directives keep the API version used to create them. Read and cancel v0 jobs through client.robotsV0, and v1 jobs through client.robots.
The API migration guide lists every field change. In summary:
to_language_code becomes output_language_code, uploaded_track_id becomes track_id, and replaced_tracks becomes replaced_track_ids.workflows becomes bindings, and each binding's params becomes parameters. directives.list() now returns summaries; retrieve a Directive for its full configuration. See Migrate Robots Directives from Beta to GA.Some SDK types are renamed for v1 too:
| Version 15 | Version 16 |
|---|---|
WorkflowBinding | DirectiveBinding |
TrackResourceDeclaration | DirectiveTrackResource |
ShotsResourceDeclaration | DirectiveShotsResource |
NodeState | DirectiveNodeState |
DirectiveRunDetail | DirectiveRun |
In version 15, Mux.Robots.DirectiveRun was the response from creating a run. In version 16, the same name is the full run, which creating a run now returns.
v1 jobs and Directive runs send robots.v1.job.<workflow>.<status> and robots.v1.directive_run.<status> events, typed with payload types such as WebhookSummarizeJob and WebhookDirectiveRun. Beta events keep their names, and their payload types gain a V0 suffix, such as WebhookSummarizeJobV0.
If you stay on v0, the Directive-run event types now describe the run itself in data, which is what Mux delivers, instead of a directive_run wrapper.
@mux/ts version 16, with no @mux/mux-node imports left.client.robots call is either on client.robotsV0 deliberately or updated for v1.