getUsage()
允许你获取当前 Remotion 许可证的使用情况。 这需要你的密钥,你可以从 remotion.pro 仪表板获取该密钥。
🌐 Allows you to get the current usage of your Remotion license.
This requires your secret key that you can obtain from the remotion.pro dashboard.
你应该只从后端调用此 API,以避免将你的密钥暴露给客户端。
🌐 You should only call this API from the backend to avoid exposing your secret key to the client.
Get the current usage of your licenseimport {getUsage } from '@remotion/licensing'; constusage = awaitgetUsage ({licenseKey : 'rm_sec_xxxxx',since :Date .now () - 1000 * 60 * 60 * 24 * 30, // 30 days ago });console .log (usage ); /* { "webRenders": { "billable": 10, "development": 5, "failed": 2 }, "cloudRenders": { "billable": 10, "development": 5, "failed": 2 }, } */
应用编程接口
🌐 API
一个具有以下属性的对象:
🌐 An object with the following properties:
licenseKeyv4.0.409
类型:string
🌐 Type: string
你的 Remotion 许可密钥。你可以从你的 Remotion.pro 仪表板获取它。
🌐 Your Remotion license key. You can get it from your Remotion.pro dashboard.
since
类型:number
🌐 Type: number
你希望获取使用情况的时间戳。
默认是从当前月份开始的 UTC 时间。
你可以使用的最早时间戳是 90 天前(Date.now() - 90 * 24 * 60 * 60 * 1000)。
🌐 The timestamp since when you want to get the usage.
The default is since the beginning of the current month in UTC.
The lowest timestamp you can use is 90 days ago (Date.now() - 90 * 24 * 60 * 60 * 1000).
apiKey
apiKey在 v4.0.409 中已弃用
🌐 deprecated in v4.0.409
类型:string
🌐 Type: string
你的 Remotion 私密 API 密钥。你可以从你的 Remotion.pro 仪表板获取它。
🌐 Your Remotion secret API key. You can get it from your Remotion.pro dashboard.
返回值
🌐 Return value
一个具有以下属性的对象:
🌐 An object with the following properties:
webRendersv4.0.428
一个具有以下属性的对象:
🌐 An object with the following properties:
billable:可收费的网页渲染次数。development:开发网页渲染的数量(在localhost或其他本地环境上)。failed:失败的网页渲染次数(你无需为它们付费)。
webcodecConversions
webcodecConversions已弃用 - 请改用 webRenders
🌐 deprecated - use webRenders instead
与 webRenders 相同。
🌐 Same as webRenders.
cloudRenders
一个具有以下属性的对象:
🌐 An object with the following properties:
billable:可收费的云渲染数量。development:开发云渲染的数量。failed:云渲染失败的次数。
另请参阅
🌐 See also