To programmatically set or get the CORS configuration for a bucket, use one of the client libraries for Cloud Storage. Use the following reference content to get started: