Skip to content

🎥 Make videos programmatically with React

Pass missing licenseKey in all the places

Pramod7adf11c4d26d
diff --git a/packages/cli/src/benchmark.ts b/packages/cli/src/benchmark.ts
index 9362fa3e7a..36cb69031f 100644
--- a/packages/cli/src/benchmark.ts
+++ b/packages/cli/src/benchmark.ts
@@ -540,6 +540,7 @@ export const benchmarkCommand = async (
}).value,
onLog: RenderInternals.defaultOnLog,
apiKey: null,
+ licenseKey: null,
},
(run, progress) => {
benchmarkProgress.update(
diff --git a/packages/cli/src/render-flows/render.ts b/packages/cli/src/render-flows/render.ts
index e62bd0dbd7..f4fccb3a61 100644
--- a/packages/cli/src/render-flows/render.ts
+++ b/packages/cli/src/render-flows/render.ts
@@ -683,6 +683,7 @@ export const renderVideoFlow = async ({
mediaCacheSizeInBytes,
onLog,
apiKey: null,
+ licenseKey: null,
});
if (!updatesDontOverwrite) {
updateRenderProgress({newline: true, printToConsole: true});
diff --git a/packages/cli/src/render-flows/still.ts b/packages/cli/src/render-flows/still.ts
index 86dff042e7..93ec6a9508 100644
--- a/packages/cli/src/render-flows/still.ts
+++ b/packages/cli/src/render-flows/still.ts
@@ -402,6 +402,7 @@ export const renderStillFlow = async ({
});
},
apiKey: null,
+ licenseKey: null,
});
aggregate.rendering = {
diff --git a/packages/cloudrun/src/functions/render-media-single-thread.ts b/packages/cloudrun/src/functions/render-media-single-thread.ts
index 3b76bb4ceb..708016f78a 100644
--- a/packages/cloudrun/src/functions/render-media-single-thread.ts
+++ b/packages/cloudrun/src/functions/render-media-single-thread.ts
@@ -209,6 +209,7 @@ export const renderMediaSingleThread = async (
chromeMode: 'headless-shell',
onLog: RenderInternals.defaultOnLog,
apiKey: null,
+ licenseKey: null,
});
const storage = new Storage();
diff --git a/packages/cloudrun/src/functions/render-still-single-thread.ts b/packages/cloudrun/src/functions/render-still-single-thread.ts
index 0ee4b3df62..7de9f5a96d 100644
--- a/packages/cloudrun/src/functions/render-still-single-thread.ts
+++ b/packages/cloudrun/src/functions/render-still-single-thread.ts
@@ -112,6 +112,7 @@ export const renderStillSingleThread = async (
mediaCacheSizeInBytes: body.mediaCacheSizeInBytes,
onLog: RenderInternals.defaultOnLog,
apiKey: null,
+ licenseKey: null,
});
Log.info({indent: false, logLevel: body.logLevel}, 'Still rendered');
diff --git a/packages/it-tests/src/monorepo/go-package.test.ts b/packages/it-tests/src/monorepo/go-package.test.ts
index 66669fd92e..c0c58cce77 100644
--- a/packages/it-tests/src/monorepo/go-package.test.ts
+++ b/packages/it-tests/src/monorepo/go-package.test.ts
@@ -82,6 +82,7 @@ test(
Author: 'Remotion',
},
apiKey: null,
+ licenseKey: null,
storageClass: null,
requestHandler: null,
mediaCacheSizeInBytes: null,
diff --git a/packages/it-tests/src/monorepo/php-package.test.ts b/packages/it-tests/src/monorepo/php-package.test.ts
index 1c196e78ea..0bf761961a 100644
--- a/packages/it-tests/src/monorepo/php-package.test.ts
+++ b/packages/it-tests/src/monorepo/php-package.test.ts
@@ -127,6 +127,7 @@ class Semantic
Author: 'Remotion',
},
apiKey: null,
+ licenseKey: null,
storageClass: null,
requestHandler: null,
mediaCacheSizeInBytes: null,
diff --git a/packages/it-tests/src/monorepo/python-package.test.ts b/packages/it-tests/src/monorepo/python-package.test.ts
index b6b0ebd0dd..3c050ea889 100644
--- a/packages/it-tests/src/monorepo/python-package.test.ts
+++ b/packages/it-tests/src/monorepo/python-package.test.ts
@@ -111,6 +111,7 @@ test('Python package should create the same renderMedia payload as normal Lambda
Author: 'Lunar',
},
apiKey: null,
+ licenseKey: null,
storageClass: null,
mediaCacheSizeInBytes: null,
});
@@ -195,6 +196,7 @@ test('Python package should create the same renderStill payload as normal Lambda
onInit: () => undefined,
forcePathStyle: false,
apiKey: null,
+ licenseKey: null,
storageClass: null,
requestHandler: null,
mediaCacheSizeInBytes: null,
diff --git a/packages/it-tests/src/monorepo/ruby-package.test.ts b/packages/it-tests/src/monorepo/ruby-package.test.ts
index fddbfb7c2f..0dfa7bb488 100644
--- a/packages/it-tests/src/monorepo/ruby-package.test.ts
+++ b/packages/it-tests/src/monorepo/ruby-package.test.ts
@@ -136,6 +136,7 @@ test('Render Media payload', async () => {
Author: 'Lunar',
},
apiKey: null,
+ licenseKey: null,
storageClass: null,
requestHandler: null,
mediaCacheSizeInBytes: null,
@@ -181,6 +182,7 @@ test('Render Still payload', async () => {
onInit: () => undefined,
forcePathStyle: false,
apiKey: null,
+ licenseKey: null,
offthreadVideoThreads: null,
storageClass: null,
requestHandler: null,
diff --git a/packages/lambda-client/src/make-lambda-payload.ts b/packages/lambda-client/src/make-lambda-payload.ts
index 56e2125136..ddb73688ff 100644
--- a/packages/lambda-client/src/make-lambda-payload.ts
+++ b/packages/lambda-client/src/make-lambda-payload.ts
@@ -137,6 +137,7 @@ export const makeLambdaRenderMediaPayload = async ({
forcePathStyle,
metadata,
apiKey,
+ licenseKey,
offthreadVideoThreads,
storageClass,
requestHandler,
@@ -218,6 +219,7 @@ export const makeLambdaRenderMediaPayload = async ({
forcePathStyle: forcePathStyle ?? false,
metadata: metadata ?? null,
apiKey: apiKey ?? null,
+ licenseKey: licenseKey ?? null,
offthreadVideoThreads: offthreadVideoThreads ?? null,
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
storageClass: storageClass ?? null,
@@ -266,6 +268,7 @@ export const makeLambdaRenderStillPayload = async ({
deleteAfter,
forcePathStyle,
apiKey,
+ licenseKey,
storageClass,
requestHandler,
offthreadVideoThreads,
@@ -321,6 +324,7 @@ export const makeLambdaRenderStillPayload = async ({
streamed: true,
forcePathStyle,
apiKey: apiKey ?? null,
+ licenseKey: licenseKey ?? null,
offthreadVideoThreads: offthreadVideoThreads ?? null,
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
storageClass: storageClass ?? null,
diff --git a/packages/lambda-client/src/test/concurrency-payload.test.ts b/packages/lambda-client/src/test/concurrency-payload.test.ts
index ed01f24091..8c859731df 100644
--- a/packages/lambda-client/src/test/concurrency-payload.test.ts
+++ b/packages/lambda-client/src/test/concurrency-payload.test.ts
@@ -49,6 +49,7 @@ test('Should include concurrency field in payload', async () => {
forcePathStyle: false,
metadata: null,
apiKey: null,
+ licenseKey: null,
offthreadVideoCacheSizeInBytes: null,
mediaCacheSizeInBytes: null,
offthreadVideoThreads: null,
@@ -108,6 +109,7 @@ test('Should handle null concurrency', async () => {
forcePathStyle: false,
metadata: null,
apiKey: null,
+ licenseKey: null,
offthreadVideoCacheSizeInBytes: null,
mediaCacheSizeInBytes: null,
offthreadVideoThreads: null,
diff --git a/packages/lambda/src/cli/commands/render/render.ts b/packages/lambda/src/cli/commands/render/render.ts
index ae481082b1..a095391cc7 100644
--- a/packages/lambda/src/cli/commands/render/render.ts
+++ b/packages/lambda/src/cli/commands/render/render.ts
@@ -353,6 +353,8 @@ export const renderCommand = async ({
metadata: metadata ?? null,
apiKey:
parsedLambdaCli[BrowserSafeApis.options.apiKeyOption.cliFlag] ?? null,
+ licenseKey:
+ parsedLambdaCli[BrowserSafeApis.options.licenseKeyOption.cliFlag] ?? null,
storageClass: parsedLambdaCli['storage-class'] ?? null,
requestHandler: null,
});
diff --git a/packages/lambda/src/cli/commands/still.ts b/packages/lambda/src/cli/commands/still.ts
index c05c7e94a9..36d586629e 100644
--- a/packages/lambda/src/cli/commands/still.ts
+++ b/packages/lambda/src/cli/commands/still.ts
@@ -279,6 +279,8 @@ export const stillCommand = async ({
storageClass: parsedLambdaCli['storage-class'] ?? null,
apiKey:
parsedLambdaCli[BrowserSafeApis.options.apiKeyOption.cliFlag] ?? null,
+ licenseKey:
+ parsedLambdaCli[BrowserSafeApis.options.licenseKeyOption.cliFlag] ?? null,
downloadBehavior: {type: 'play-in-browser'},
forceBucketName: parsedLambdaCli['force-bucket-name'] ?? null,
forcePathStyle: parsedLambdaCli['force-path-style'] ?? false,
diff --git a/packages/lambda/src/test/integration/renders/old-version.test.ts b/packages/lambda/src/test/integration/renders/old-version.test.ts
index 669ee6ea09..68a34cebef 100644
--- a/packages/lambda/src/test/integration/renders/old-version.test.ts
+++ b/packages/lambda/src/test/integration/renders/old-version.test.ts
@@ -61,6 +61,7 @@ test(
forcePathStyle: false,
metadata: {Author: 'Lunar'},
apiKey: null,
+ licenseKey: null,
storageClass: null,
mediaCacheSizeInBytes: null,
},
diff --git a/packages/lambda/src/test/integration/webhooks.test.ts b/packages/lambda/src/test/integration/webhooks.test.ts
index 9f96540ee9..96165b5572 100644
--- a/packages/lambda/src/test/integration/webhooks.test.ts
+++ b/packages/lambda/src/test/integration/webhooks.test.ts
@@ -95,6 +95,7 @@ test(
forcePathStyle: false,
metadata: {Author: 'Lunar'},
apiKey: null,
+ licenseKey: null,
storageClass: null,
mediaCacheSizeInBytes: null,
},
@@ -217,6 +218,7 @@ test(
forcePathStyle: false,
metadata: null,
apiKey: null,
+ licenseKey: null,
storageClass: null,
},
timeoutInTest: 1000,
diff --git a/packages/renderer/src/options/index.tsx b/packages/renderer/src/options/index.tsx
index a22a60eb8a..129ef91dc8 100644
--- a/packages/renderer/src/options/index.tsx
+++ b/packages/renderer/src/options/index.tsx
@@ -24,6 +24,7 @@ import {headlessOption} from './headless';
import {imageSequencePatternOption} from './image-sequence-pattern';
import {jpegQualityOption} from './jpeg-quality';
import {audioLatencyHintOption} from './latency-hint';
+import {licenseKeyOption} from './license-key';
import {logLevelOption} from './log-level';
import {metadataOption} from './metadata';
import {mutedOption} from './mute';
@@ -90,6 +91,7 @@ export const allOptions = {
hardwareAccelerationOption,
chromeModeOption,
apiKeyOption,
+ licenseKeyOption,
audioLatencyHintOption,
enableCrossSiteIsolationOption,
imageSequencePatternOption,
diff --git a/packages/serverless-client/src/constants.ts b/packages/serverless-client/src/constants.ts
index 132b60616d..65f8539a04 100644
--- a/packages/serverless-client/src/constants.ts
+++ b/packages/serverless-client/src/constants.ts
@@ -159,6 +159,7 @@ export type ServerlessStartPayload<Provider extends CloudProvider> = {
forcePathStyle: boolean;
metadata: Record<string, string> | null;
apiKey: string | null;
+ licenseKey: string | null;
storageClass: Provider['storageClass'] | null;
};
@@ -218,6 +219,7 @@ export type ServerlessPayloads<Provider extends CloudProvider> = {
forcePathStyle: boolean;
metadata: Record<string, string> | null;
apiKey: string | null;
+ licenseKey: string | null;
storageClass: Provider['storageClass'] | null;
};
status: ServerlessStatusPayload<Provider>;
@@ -301,6 +303,7 @@ export type ServerlessPayloads<Provider extends CloudProvider> = {
streamed: boolean;
forcePathStyle: boolean;
apiKey: string | null;
+ licenseKey: string | null;
storageClass: Provider['storageClass'] | null;
};
compositions: {
diff --git a/packages/serverless/src/handlers/launch.ts b/packages/serverless/src/handlers/launch.ts
index 5e1214f690..8c173e7fdf 100644
--- a/packages/serverless/src/handlers/launch.ts
+++ b/packages/serverless/src/handlers/launch.ts
@@ -724,7 +724,10 @@ export const launchHandler = async <Provider extends CloudProvider>({
});
clearTimeout(webhookDueToTimeout);
- sendTelemetryEvent(params.apiKey ?? null, params.logLevel);
+ sendTelemetryEvent(
+ params.licenseKey ?? params.apiKey ?? null,
+ params.logLevel,
+ );
if (!params.webhook || webhookInvoked) {
return;
diff --git a/packages/serverless/src/handlers/send-telemetry-event.ts b/packages/serverless/src/handlers/send-telemetry-event.ts
index a01af7d116..907379a63e 100644
--- a/packages/serverless/src/handlers/send-telemetry-event.ts
+++ b/packages/serverless/src/handlers/send-telemetry-event.ts
@@ -3,17 +3,17 @@ import type {LogLevel} from '@remotion/renderer';
import {RenderInternals} from '@remotion/renderer';
export const sendTelemetryEvent = async (
- apiKey: string | null,
+ licenseKey: string | null,
logLevel: LogLevel,
) => {
- if (apiKey === null) {
+ if (licenseKey === null) {
return Promise.resolve();
}
try {
// https://www.remotion.dev/docs/licensing
await registerUsageEvent({
- apiKey,
+ apiKey: licenseKey,
event: 'cloud-render',
host: null,
succeeded: true,
diff --git a/packages/serverless/src/handlers/start.ts b/packages/serverless/src/handlers/start.ts
index 6712f7fad7..080ee3af9d 100644
--- a/packages/serverless/src/handlers/start.ts
+++ b/packages/serverless/src/handlers/start.ts
@@ -126,6 +126,7 @@ export const startHandler = async <Provider extends CloudProvider>({
forcePathStyle: params.forcePathStyle,
metadata: params.metadata,
apiKey: params.apiKey,
+ licenseKey: params.licenseKey,
offthreadVideoThreads: params.offthreadVideoThreads,
storageClass: params.storageClass,
mediaCacheSizeInBytes: params.mediaCacheSizeInBytes,
diff --git a/packages/serverless/src/handlers/still.ts b/packages/serverless/src/handlers/still.ts
index eaf768c952..5f3eb0e0ce 100644
--- a/packages/serverless/src/handlers/still.ts
+++ b/packages/serverless/src/handlers/still.ts
@@ -335,6 +335,7 @@ const innerStillHandler = async <Provider extends CloudProvider>(
offthreadVideoThreads: params.offthreadVideoThreads,
onLog: RenderInternals.defaultOnLog,
apiKey: null,
+ licenseKey: null,
});
const {size} = await fs.promises.stat(outputPath);
@@ -362,7 +363,7 @@ const innerStillHandler = async <Provider extends CloudProvider>(
forcePathStyle: params.forcePathStyle,
}),
server.closeServer(true),
- sendTelemetryEvent(params.apiKey, params.logLevel),
+ sendTelemetryEvent(params.licenseKey ?? params.apiKey, params.logLevel),
]);
const estimatedPrice = providerSpecifics.estimatePrice({
diff --git a/packages/web-renderer/src/send-telemetry-event.ts b/packages/web-renderer/src/send-telemetry-event.ts
index c0aa2dac60..31e1dc8422 100644
--- a/packages/web-renderer/src/send-telemetry-event.ts
+++ b/packages/web-renderer/src/send-telemetry-event.ts
@@ -28,7 +28,8 @@ export const sendUsageEvent = async ({
}
await registerUsageEvent({
- apiKey: licenseKey === 'free-license' ? null : licenseKey,
+ apiKey: null,
+ licenseKey: licenseKey === 'free-license' ? null : licenseKey,
event: 'webcodec-conversion',
host,
succeeded,