{
  "slug": "retool-public-app-hide-api-credentials",
  "title": "Retool Public App Hide REST API Credentials",
  "metaDescription": "Retool public app hide rest api credentials. Keep REST API keys in RealComposer Vault; Retool uses rc_live_ tokens only.",
  "headline": "Vault-backed REST API proxy tuned for Retool",
  "category": "security",
  "categoryLabel": "Security & Secret Vault",
  "urgency": 9,
  "clientPlatform": "Retool",
  "upstreamServices": [
    "REST API"
  ],
  "searchIntentQuery": "retool public app hide rest api credentials",
  "directAnswerSummary": "Never place API_BEARER_TOKEN inside Retool source. RealComposer injects them when calling https://jsonplaceholder.typicode.com/users/{{query.userId}}, so browsers see only a client token.",
  "problem": {
    "title": "REST API keys in Retool network tabs",
    "explanation": "Retool ships code or scripts to end-user devices. Any REST API bearer token in those bundles can be copied from DevTools, proxies, or repackaged apps.",
    "risks": [
      "Shared Retool projects revealing REST API tokens",
      "Sudden REST API quota burn from scripted abuse",
      "Inability to rotate keys without redeploying clients"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Add vault secrets for this pipeline",
      "description": "Create API_BEARER_TOKEN vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders."
    },
    {
      "stepNumber": 2,
      "title": "Target the real upstream URL",
      "description": "Point step upstream at https://jsonplaceholder.typicode.com/users/{{query.userId}} with GET. Add output mapping fields that mirror the JSON contract your screen already expects. 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": "Query from Retool",
      "description": "Call https://realcomposer.com/v1/workspace/retool-public-app-hide-api-credentials with a restricted rc_live_ client token. Retool never sends upstream secrets.",
      "codeSnippet": "// REST resource or JS query\nconst rows = await fetch('https://realcomposer.com/v1/workspace/retool-public-app-hide-api-credentials', {\n  headers: { Authorization: 'Bearer rc_live_token' }\n}).then(r => r.json());"
    }
  ],
  "pipelineConfig": {
    "name": "Retool Public App Hide REST API Credentials",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "upstream",
        "upstreamUrlTemplate": "https://jsonplaceholder.typicode.com/users/{{query.userId}}",
        "httpMethod": "GET",
        "headersTemplate": {
          "Authorization": "Bearer {{secrets.API_BEARER_TOKEN}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "userId",
          "sourcePath": "id",
          "type": "number",
          "sourceStep": "upstream"
        },
        {
          "targetPath": "name",
          "sourcePath": "name",
          "type": "string",
          "sourceStep": "upstream"
        },
        {
          "targetPath": "email",
          "sourcePath": "email",
          "type": "string",
          "sourceStep": "upstream"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_retool-p",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "retool-public-app-hide-api-credentials"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "userId": "sample",
    "name": "sample",
    "email": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/retool-public-app-hide-api-credentials\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "Can Retool call REST API without holding the production key?",
      "answer": "Log request IDs for retool-public-app-hide-api-credentials, not raw REST API payloads, because upstream bodies may include PII."
    },
    {
      "question": "How do I forward JSON bodies to POST upstreams?",
      "answer": "retool-public-app-hide-api-credentials forwards client JSON to POST upstreams unchanged; secrets interpolate only in URLs and header templates."
    },
    {
      "question": "What happens if an upstream step times out?",
      "answer": "Upstream steps in retool-public-app-hide-api-credentials honor timeoutMs and optional fallback JSON without leaking secrets."
    }
  ],
  "relatedRecipeSlugs": [
    "combine-twilio-and-user-registration",
    "supabase-edge-functions-alternative",
    "api-composition-tool-low-code"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/retool-public-app-hide-api-credentials",
    "markdown": "https://realcomposer.com/recipes/retool-public-app-hide-api-credentials.md",
    "json": "https://realcomposer.com/recipes/retool-public-app-hide-api-credentials.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=retool-public-app-hide-api-credentials&via=agent"
  }
}