packages/docs/docs/cloudrun/getsites.mdx
Gets an array of Remotion projects in Cloud Storage, in your GCP project.
The projects are located in the sites/ subdirectory of your Cloud Storage bucket. Remember - you should only have one bucket for Remotion Cloud Run per region, therefore you do not need to specify the name of the bucket for this function.
Gets all sites and logs information about them.
import {getSites} from '@remotion/cloudrun';
const {sites, buckets} = await getSites('europe-west4');
for (const site of sites) {
console.log(site.id); // A unique ID for referring to that project
console.log(site.bucketName); // In which bucket the site resides in.
console.log(site.bucketRegion); // In which region the bucket resides in.
console.log(site.serveUrl); // URL of the deployed site that you can pass to `renderMediaOnCloudRun()`
}
for (const bucket of buckets) {
console.log(bucket.name); // The name of the Cloud Storage bucket.
console.log(bucket.creationDate); // A unix timestamp of when the site was created.
console.log(bucket.region); // 'europe-west4'
}
An object with the following properties:
regionThe GCP region which you want to query. Alternatively, you can pass 'all regions' to return sites across all regions.
import {getSites} from '@remotion/cloudrun';
const {sites, buckets} = await getSites('all regions');
A promise resolving to an object with the following properties:
sitesAn array of deployed Remotion projects that you can use for rendering.
Each item contains the following properties:
idA unique identifier for that project.
bucketNameThe bucket in which the project resides in.
bucketRegionThe region in which the bucket resides in.
serveUrlURL of the deployed site. You can pass it into renderMediaOnCloudRun() to render a video or audio.
bucketsAn array of all buckets in the selected region in your account that start with remotioncloudrun-.
:::info You should only have 1 bucket per region for all your Remotion projects. :::
Each item contains the following properties:
regionThe region the bucket resides in.
nameThe name of the bucket. Cloud Storage buckets have globally unique names.
creationDateA UNIX timestamp of the point when the bucket was first created.