Node.js client and CLI for Cloudmotion. Upload Remotion bundles and start renders from Node scripts and CI.
API docs: cloudmotion.dev/docs.
npm i cloudmotionexport CLOUDMOTION_TOKEN=cm_...Upload a Remotion bundle directory (after npx remotion bundle), then start a render:
npx cloudmotion bundles upload dist/bundle --bundle-id my-project
npx cloudmotion render \
--bundle-id my-project \
--composition-id MyCompRe-uploading under the same bundle ID replaces the latest bundle used for renders. The render command prints progress to stderr and the output URL on stdout when finished.
Pass token in the client constructor (the SDK does not read environment variables).
import { createClient } from 'cloudmotion'
const client = createClient({ token: 'cm_...' })
const bundle = await client.uploadBundle({
bundleDir: 'dist/bundle',
bundleId: 'my-project',
})
const { renderId } = await client.renderMedia({
bundleId: bundle.bundleId,
compositionId: 'MyComp',
inputProps: { title: 'Hello' },
})
let status = await client.getRenderProgress(renderId)
while (status.status !== 'completed' && status.status !== 'failed') {
await new Promise(r => setTimeout(r, 2000))
status = await client.getRenderProgress(renderId)
}
console.log(status.outputUrl)createClient({ token, fetch? }): optional customfetch(e.g. for timeouts or logging)client.uploadBundle({ bundleDir, bundleId, onUploadProgress? }): returns{ bundleId, uploadId, remotionVersion, runtimeReady }client.renderMedia(input)/client.renderStill(input): returns{ renderId }client.getRenderProgress(renderId): poll{ status, progress, error?, outputUrl? }
See cloudmotion.dev/docs.
# Start render
curl "https://api.cloudmotion.dev/v1/renders" \
-H "Authorization: Bearer cm_..." \
--json '{"bundleId":"my-project","compositionId":"MyComp","kind":"media"}'
# Poll status
curl "https://api.cloudmotion.dev/v1/renders/$RENDER_ID" \
-H "Authorization: Bearer cm_..."