{
  "slug": "trim-cloudinary-resource-json-picker",
  "title": "Cloudinary resource json trim for image picker",
  "metaTitle": "Cloudinary resource json trim for - RealComposer",
  "metaDescription": "Cloudinary resource json trim for image picker. Return public_id format width height only from resource. Map only UI fields from Cloudinary before Vue.",
  "headline": "Media picker with minimal asset metadata",
  "category": "slimmer",
  "categoryLabel": "Payload Slimmer",
  "urgency": 7,
  "clientPlatform": "Vue / SPA",
  "upstreamServices": [
    "Cloudinary"
  ],
  "searchIntentQuery": "cloudinary resource json trim for image picker",
  "directAnswerSummary": "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.",
  "problem": {
    "title": "Unmapped Cloudinary fields waste bandwidth",
    "explanation": "Cloudinary returns nested CRM, audit, and configuration objects. Vue / SPA parses them on the main thread even when the UI binds three fields.",
    "risks": [
      "Large arrays kept in memory after navigation",
      "Analytics showing poor LCP on API-heavy screens",
      "Developers shipping defensive null checks for unused paths"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Bind vault keys to the Worker",
      "description": "Create CLOUDINARY_BASIC_AUTH vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders."
    },
    {
      "stepNumber": 2,
      "title": "Target the real upstream URL",
      "description": "Use GET against https://api.cloudinary.com/v1_1/{{secrets.CLOUDINARY_CLOUD_NAME}}/resources/image. Allowed origins on the client token should match leave cache ttl at 0 when each response is user-specific (include userid or record id in query params before enabling cache)."
    },
    {
      "stepNumber": 3,
      "title": "Call from Vue / SPA",
      "description": "Call https://realcomposer.com/v1/workspace/trim-cloudinary-resource-json-picker with a restricted rc_live_ client token. Vue / SPA never sends upstream secrets.",
      "codeSnippet": "const { data } = await useFetch('https://realcomposer.com/v1/workspace/trim-cloudinary-resource-json-picker', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});"
    }
  ],
  "pipelineConfig": {
    "name": "Cloudinary resource json trim for image picker",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "cloudinary",
        "upstreamUrlTemplate": "https://api.cloudinary.com/v1_1/{{secrets.CLOUDINARY_CLOUD_NAME}}/resources/image",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Basic {{secrets.CLOUDINARY_BASIC_AUTH}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "publicId",
          "sourcePath": "resources.0.public_id",
          "type": "string",
          "sourceStep": "cloudinary"
        },
        {
          "targetPath": "format",
          "sourcePath": "resources.0.format",
          "type": "string",
          "sourceStep": "cloudinary"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_trim-clo",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "trim-cloudinary-resource-json-picker"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "publicId": "sample",
    "format": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/trim-cloudinary-resource-json-picker\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Is it safe to log Cloudinary responses in Vue / SPA?",
      "answer": "Point Vue / SPA at /recipes/trim-cloudinary-resource-json-picker edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins."
    },
    {
      "question": "Will Anthropic or Linear prompt bodies be rewritten?",
      "answer": "trim-cloudinary-resource-json-picker POST steps bypass caches.default even if cacheTtlSeconds is set in the dashboard."
    },
    {
      "question": "How do I rotate upstream credentials?",
      "answer": "Rotate vault secrets for trim-cloudinary-resource-json-picker anytime; clients keep the same rc_live_ token."
    }
  ],
  "relatedRecipeSlugs": [
    "reduce-json-payload-size-frontend",
    "transform-and-rename-nested-json-keys"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/trim-cloudinary-resource-json-picker",
    "markdown": "https://realcomposer.com/recipes/trim-cloudinary-resource-json-picker.md",
    "json": "https://realcomposer.com/recipes/trim-cloudinary-resource-json-picker.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=trim-cloudinary-resource-json-picker&via=agent"
  }
}