Skip to content

🎥 Make videos programmatically with React

Merge branch 'main' into feat/depricate-api-key-add-license-key

Pramod132dbcf87646
diff --cc packages/cli/src/render-flows/render.ts
index 7a4e817b71,b05211d249..3f26e857bc
--- a/packages/cli/src/render-flows/render.ts
+++ b/packages/cli/src/render-flows/render.ts
@@@ -716,7 -716,9 +716,8 @@@ export const renderVideoFlow = async (
chromeMode,
mediaCacheSizeInBytes,
onLog,
- apiKey: null,
licenseKey: null,
+ isProduction: null,
});
if (!updatesDontOverwrite) {
updateRenderProgress({newline: true, printToConsole: true});
diff --cc packages/cli/src/render-flows/still.ts
index 1f9e363fb5,fcc33d52b1..694de99c8a
--- a/packages/cli/src/render-flows/still.ts
+++ b/packages/cli/src/render-flows/still.ts
@@@ -420,7 -420,9 +420,8 @@@ export const renderStillFlow = async (
printToConsole: true,
});
},
- apiKey: null,
licenseKey: null,
+ isProduction: null,
});
aggregate.rendering = {
diff --cc packages/cloudrun/src/functions/render-media-single-thread.ts
index 343f31553a,1a8374c2d7..ce7b801dd6
--- a/packages/cloudrun/src/functions/render-media-single-thread.ts
+++ b/packages/cloudrun/src/functions/render-media-single-thread.ts
@@@ -208,7 -208,9 +208,8 @@@ export const renderMediaSingleThread =
hardwareAcceleration: 'disable',
chromeMode: 'headless-shell',
onLog: RenderInternals.defaultOnLog,
- apiKey: null,
licenseKey: null,
+ isProduction: null,
});
const storage = new Storage();
diff --cc packages/cloudrun/src/functions/render-still-single-thread.ts
index 6ca6318015,cc560caab1..3cc6374d31
--- a/packages/cloudrun/src/functions/render-still-single-thread.ts
+++ b/packages/cloudrun/src/functions/render-still-single-thread.ts
@@@ -111,7 -111,9 +111,8 @@@ export const renderStillSingleThread =
chromeMode: 'headless-shell',
mediaCacheSizeInBytes: body.mediaCacheSizeInBytes,
onLog: RenderInternals.defaultOnLog,
- apiKey: null,
licenseKey: null,
+ isProduction: null,
});
Log.info({indent: false, logLevel: body.logLevel}, 'Still rendered');
diff --cc packages/docs/docs/lambda/rendermediaonlambda.mdx
index 36d8ffcfb4,de86b634f0..28e18b87c6
--- a/packages/docs/docs/lambda/rendermediaonlambda.mdx
+++ b/packages/docs/docs/lambda/rendermediaonlambda.mdx
@@@ -341,16 -345,12 +341,22 @@@ Passes `forcePathStyle` to the AWS S3 c
An [identifier](https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html#sc-compare) for the S3 storage class of the rendered media. Default: `undefined` (which is `STANDARD`).
+### `licenseKey?`<AvailableFrom v="4.0.409"/>
+
+<Options id="license-key" />
+
+ ### `isProduction?`<AvailableFrom v="4.0.409"/>
+
+ _default `true`_
+
+ <Options id="is-production" />
+
+### ~~`apiKey?`<AvailableFrom v="4.0.253"/>~~
+
+_deprecated in v4.0.409_
+
+<Options id="api-key" />
+
### ~~`dumpBrowserLogs?`~~
Deprecated in v4.0 in favor of [`logLevel`](#loglevel).
diff --cc packages/docs/docs/lambda/renderstillonlambda.mdx
index a6397fa005,f7a8b2673f..7ee6070793
--- a/packages/docs/docs/lambda/renderstillonlambda.mdx
+++ b/packages/docs/docs/lambda/renderstillonlambda.mdx
@@@ -235,10 -235,12 +235,16 @@@ Passes `forcePathStyle` to the AWS S3 c
An [identifier](https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html#sc-compare) for the S3 storage class of the rendered media. Default: `undefined` (which is `STANDARD`).
+### `licenseKey?`<AvailableFrom v="4.0.409"/>
+
+<Options id="license-key" />
+
+ ### `isProduction?`<AvailableFrom v="4.0.409"/>
+
+ _default `true`_
+
+ <Options id="is-production" />
+
### ~~`dumpBrowserLogs?`~~
Deprecated in v4.0 in favor of [`logLevel`](#loglevel).
diff --cc packages/lambda-client/src/make-lambda-payload.ts
index 69e902e873,db672304ef..55bc4e2c3f
--- a/packages/lambda-client/src/make-lambda-payload.ts
+++ b/packages/lambda-client/src/make-lambda-payload.ts
@@@ -88,9 -88,8 +88,10 @@@ export type InnerRenderMediaOnLambdaInp
metadata: Record<string, string> | null;
storageClass: StorageClass | null;
requestHandler: RequestHandler | null;
+ isProduction: boolean | null;
-} & ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda>;
+} & ToOptions<
+ Omit<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda, 'apiKey'>
+>;
export const makeLambdaRenderMediaPayload = async ({
rendererFunctionName,
diff --cc packages/lambda-client/src/render-media-on-lambda.ts
index ec57b4980c,806b7c68dc..37c6b00384
--- a/packages/lambda-client/src/render-media-on-lambda.ts
+++ b/packages/lambda-client/src/render-media-on-lambda.ts
@@@ -74,16 -74,8 +74,17 @@@ export type RenderMediaOnLambdaInput =
metadata?: Record<string, string> | null;
storageClass?: StorageClass | null;
requestHandler?: RequestHandler;
+ isProduction?: boolean;
-} & Partial<ToOptions<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda>>;
+} & {
+ /**
+ * @deprecated Use `licenseKey` instead
+ */
+ apiKey?: string | null;
+} & Partial<
+ ToOptions<
+ Omit<typeof BrowserSafeApis.optionsMap.renderMediaOnLambda, 'apiKey'>
+ >
+ >;
export type RenderMediaOnLambdaOutput = {
renderId: string;
diff --cc packages/renderer/src/render-media.ts
index eb4eaeb17f,dc69ab5e52..960a54131c
--- a/packages/renderer/src/render-media.ts
+++ b/packages/renderer/src/render-media.ts
@@@ -151,8 -151,9 +151,9 @@@ export type InternalRenderMediaOptions
onArtifact: OnArtifact | null;
metadata: Record<string, string> | null;
onLog: OnLog;
+ licenseKey: string | null;
+ isProduction: boolean | null;
-} & EitherApiKeyOrLicenseKey &
- MoreRenderMediaOptions;
+} & MoreRenderMediaOptions;
type Prettify<T> = {
[K in keyof T]: T[K];
diff --cc packages/renderer/src/render-still.ts
index e9015fc36f,390358ca21..1e47574292
--- a/packages/renderer/src/render-still.ts
+++ b/packages/renderer/src/render-still.ts
@@@ -76,7 -76,8 +76,8 @@@ type InternalRenderStillOptions =
port: number | null;
onArtifact: OnArtifact | null;
onLog: OnLog;
+ isProduction: boolean | null;
-} & ToOptions<typeof optionsMap.renderStill>;
+} & ToOptions<Omit<typeof optionsMap.renderStill, 'apiKey'>>;
export type RenderStillOptions = {
port?: number | null;
@@@ -429,8 -426,8 +426,8 @@@ const internalRenderStillRaw =
return;
}
- registerUsageEvent({
+ LicensingInternals.internalRegisterUsageEvent({
- licenseKey: options.licenseKey ?? options.apiKey ?? null,
+ licenseKey: options.licenseKey,
event: 'cloud-render',
host: null,
succeeded: true,
@@@ -575,7 -575,9 +575,8 @@@ export const renderStill =
chromeMode: chromeMode ?? 'headless-shell',
offthreadVideoThreads: offthreadVideoThreads ?? null,
mediaCacheSizeInBytes: mediaCacheSizeInBytes ?? null,
- apiKey: apiKey ?? null,
- licenseKey: licenseKey ?? null,
+ licenseKey: licenseKey ?? apiKey ?? null,
onLog: defaultOnLog,
+ isProduction: isProduction ?? null,
});
};
diff --cc packages/serverless-client/src/constants.ts
index 79e1b42624,964dcf68a6..42333ef1f2
--- a/packages/serverless-client/src/constants.ts
+++ b/packages/serverless-client/src/constants.ts
@@@ -158,8 -158,10 +158,9 @@@ export type ServerlessStartPayload<Prov
preferLossless: boolean;
forcePathStyle: boolean;
metadata: Record<string, string> | null;
- apiKey: string | null;
licenseKey: string | null;
storageClass: Provider['storageClass'] | null;
+ isProduction: boolean | null;
};
export type ServerlessPayloads<Provider extends CloudProvider> = {
@@@ -300,8 -303,10 +302,9 @@@
deleteAfter: DeleteAfter | null;
streamed: boolean;
forcePathStyle: boolean;
- apiKey: string | null;
licenseKey: string | null;
storageClass: Provider['storageClass'] | null;
+ isProduction: boolean | null;
};
compositions: {
type: ServerlessRoutines.compositions;
diff --cc packages/serverless/src/handlers/still.ts
index c5d3305334,0f3fbedc2f..40745c8627
--- a/packages/serverless/src/handlers/still.ts
+++ b/packages/serverless/src/handlers/still.ts
@@@ -334,7 -334,9 +334,8 @@@ const innerStillHandler = async <Provid
chromeMode: 'headless-shell',
offthreadVideoThreads: params.offthreadVideoThreads,
onLog: RenderInternals.defaultOnLog,
- apiKey: null,
licenseKey: null,
+ isProduction: null,
});
const {size} = await fs.promises.stat(outputPath);
@@@ -362,7 -364,12 +363,12 @@@
forcePathStyle: params.forcePathStyle,
}),
server.closeServer(true),
- sendTelemetryEvent(params.licenseKey, params.logLevel),
+ sendTelemetryEvent({
- licenseKey: params.licenseKey ?? params.apiKey,
++ licenseKey: params.licenseKey,
+ logLevel: params.logLevel,
+ isStill: true,
+ isProduction: params.isProduction ?? true,
+ }),
]);
const estimatedPrice = providerSpecifics.estimatePrice({