Skip to main content

轻客户端

从 v4.0.84 起可用

🌐 available from v4.0.84

可以从 @remotion/cloudrun/client 导入以下方法和类型:

🌐 The following methods and types can be imported from @remotion/cloudrun/client:

import {
  deleteService,
  deleteSite,
  getOrCreateBucket,
  getRegions,
  getServiceInfo,
  getServices,
  getSites,
  renderMediaOnCloudrun,
  renderStillOnCloudrun,
  speculateServiceName,
} from "@remotion/cloudrun/client";

import type {
  RenderMediaOnCloudrunInput,
  RenderStillOnCloudrunInput,
} from "@remotion/cloudrun/client";

这些函数不依赖于我们的渲染器,并且可以例如与 ESBuild 或 Webpack 一起打包(例如在 Next.js 中就是这种情况)。

🌐 These functions don't have any dependencies on our renderer and can be bundled for example with ESBuild or Webpack (like is the case for example in Next.js).

目前不支持在边缘框架(Vercel Edge、Cloudflare Workers)上导入轻客户端。

🌐 Importing the light client on edge frameworks (Vercel Edge, Cloudflare Workers) is currently not supported.

我们不建议直接从浏览器调用这些函数,因为这样会泄露你的 Google 云平台凭据。

相反,这个轻量客户端旨在减小打包包大小,并在你从另一个无服务器函数调用 Remotion Cloud Run API 时避免问题,因此需要打包你的函数代码。

🌐 Instead, this light client is meant to reduce the bundle size and avoid problems if you are calling Remotion Cloud Run APIs from another serverless function and therefore need to bundle your function code.

这个导入例如对于 Next.js 无服务器端点或类似的情况很有用,它会打包服务器端代码。

🌐 This import is useful for example for Next.js serverless endpoints or similar, which bundle the server-side code.