setLicenseKeyInStudio()v4.0.504
Sets a public Company License key in the config file loaded by a recently focused Remotion Studio.
set-license-key.tsimport {setLicenseKeyInStudio } from '@remotion/studio-protocol'; constresult = awaitsetLicenseKeyInStudio ({licenseKey : `rm_pub_${'a'.repeat (48)}`, }); if (!result .success ) {console .error (result .code ,result .message ); } else {console .log (result .status ); // "license-key-set" }
On success, Studio has added or replaced Config.setPublicLicenseKey() in the loaded remotion.config.ts or remotion.config.js. Studio does not show a confirmation dialog.
Arguments
licenseKey
A public Company License key from remotion.pro. It starts with rm_pub_.
Never pass a private key starting with rm_sec_. Private keys must not be included in client-side code or Remotion config files.
Return value
Returns a promise with a discriminated union.
success
Indicates whether the config file was updated.
status
On success, the value is "license-key-set".
target
On success, contains the project name, Studio origin, and Studio version.
code
On failure, a stable error code such as unsupported-origin, invalid-license-key, no-compatible-studio, studio-upgrade-required, no-configurable-target, target-expired, or no-config-file.
message
A human-readable failure message. Use code for application logic.
Target selection
Ports 3000 through 3009 are probed in parallel. The most recently focused writable Studio project is selected. No active composition is required.
Discovery uses a short-lived, single-use token bound to the requesting origin, selected Studio tab, and license-key operation. Focus Studio shortly before calling setLicenseKeyInStudio().
The operation returns no-config-file if the selected Studio was started without loading a Remotion config file.
Supported origins
The function is available from:
https://remotion.prohttps://www.remotion.pro- HTTP
localhost - HTTP
127.0.0.1
Other origins are rejected before Studio discovery.
Compatibility
| Browsers | Environments | |||||
|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | ||||
Remotion Studio 4.0.504 or newer is required. Browser Studio is not supported.