Skip to main content

registerUsageEvent()

为你的 Remotion 许可证注册一个使用点。 允许准确和最新的报告,并在 Remotion 仪表板上跟踪你的使用情况。

🌐 Registers a usage point for your Remotion license.
Allows for accurate and up to date reporting and to track your usage on the Remotion dashboard.

Register a usage point
import {registerUsageEvent} from '@remotion/licensing'; await registerUsageEvent({ licenseKey: 'rm_pub_xxxxx', event: 'cloud-render', host: 'https://myapp.com', succeeded: true, });

应用编程接口

🌐 API

一个具有以下属性的对象:

🌐 An object with the following properties:

licenseKeyv4.0.409

类型:string

🌐 Type: string

你的 Remotion 公共 API 密钥。你可以在你的 Remotion.pro 仪表板上获取它。

🌐 Your Remotion public API key. You can get it from your Remotion.pro dashboard.

event

类型:string

🌐 Type: string

你想注册的事件。这可以是以下之一:

🌐 The event you want to register. This can be one of the following:

  • web-render
  • cloud-render
  • webcodec-conversion (已弃用,请改用 web-render)

host

在这里托管你应用的域名。
这应当是你的前端中 window.location.origin 的计算值。
如果主机是 localhost 或类似的,它将被注册为非计费。

🌐 The domain at here you host your app.
This should be the value of what window.location.origin evaluates to on your frontend.
If the host is localhost or similar, it will be registered as non-billable.

succeeded

无论活动是否成功。
如果活动不成功,它将被登记为不可计费的活动。

🌐 Whether the event was successful or not.
If the event was not successful, it will be registered as a non-billable event.

返回值

🌐 Return value

当事件成功注册时解决的承诺。

🌐 A promise that resolves when the event was successfully registered.

已解析的对象包含两个属性:

🌐 The resolved object contains two properties:

billable

这是否是一个应该计费的事件。

🌐 Whether this was an event that should be billed.

classification

可以是 "billable""development""failed"
你无需为失败的渲染或正在开发中的渲染支付费用。

🌐 Either, "billable", "development" or "failed".
You do not have to pay for failed renders or renders doing development.

另请参阅

🌐 See also