Protect API Key in Vue SPA
Vue / SPA cannot safely store REST API production keys. Vault-bound headers reach https://jsonplaceholder.typicode.com/users/{{query.userId}} on Workers while apps call your hide-api-key-vue-spa edge URL.
Production-ready templates for calling third-party APIs from Vue / SPAwithout exposing secrets or maintaining a custom backend.
Vue safe & unsafe practicesVue / SPA cannot safely store REST API production keys. Vault-bound headers reach https://jsonplaceholder.typicode.com/users/{{query.userId}} on Workers while apps call your hide-api-key-vue-spa edge URL.
Upload and transform URLs signed at the edge with API secret in Vault. For "call cloudinary api from vue spa without secret key", store CLOUDINARY_BASIC_AUTH in Secret Vault, call https://api.cloudinary.com/v1_1/{{secrets.CLOUDINARY_CLOUD_NAME}}/resources/image from a Worker, and let Vue / SPA hit only https://realcomposer.com/v1/workspace/call-cloudinary-from-vue-securely with an rc_live_ client token.
Return public_id format width height only from resources list. For "cloudinary resource json trim for image picker", store CLOUDINARY_BASIC_AUTH in Secret Vault, call https://api.cloudinary.com/v1_1/{{secrets.CLOUDINARY_CLOUD_NAME}}/resources/image from a Worker, and let Vue / SPA hit only https://realcomposer.com/v1/workspace/trim-cloudinary-resource-json-picker with an rc_live_ client token.
Cache transformation metadata responses per public_id. For "cache cloudinary transformation api at edge", store CLOUDINARY_BASIC_AUTH in Secret Vault, call https://api.cloudinary.com/v1_1/{{secrets.CLOUDINARY_CLOUD_NAME}}/resources/image from a Worker, and let Vue / SPA hit only https://realcomposer.com/v1/workspace/cache-cloudinary-transformations-edge with an rc_live_ client token. Enable 300s GET cache only when query params identify the resource.