Purges the CDN cache for an entire bucket.
Maps to DELETE /cdn/{bucket} on the Storage API. The server issues a CDN invalidation for the bucket and returns { message: 'success' }.
Requires the service_role key. The underlying endpoint enforces service_role JWT — calls made with the anon key or a user JWT will be rejected by the server.
Hosted CDN feature. On self-hosted Supabase, the Storage service must have CDN_PURGE_ENDPOINT_URL configured and the purgeCache tenant feature enabled, otherwise the server returns an error.
The unique identifier of the bucket you would like to purge from cache.
Optional purge cache options.
Optional fetch parameters such as an `AbortController` signal.
const { data, error } = await supabase
.storage
.purgeBucketCache('avatars')
const { data, error } = await supabase
.storage
.purgeBucketCache('avatars', { transformations: true })