{
  "slug": "combine-supabase-user-with-billing-api",
  "title": "Combine Supabase Auth User with Custom Billing API",
  "metaTitle": "Combine Supabase Auth User with - RealComposer",
  "metaDescription": "Combine supabase auth user with custom billing api. Merge Supabase in one Frontend / Web call with parallel Worker steps.",
  "headline": "Parallel Supabase fetch merged before Frontend / Web hydrates",
  "category": "aggregation",
  "categoryLabel": "Multi-API Aggregation",
  "urgency": 9,
  "clientPlatform": "Frontend / Web",
  "upstreamServices": [
    "Supabase"
  ],
  "searchIntentQuery": "combine supabase auth user with custom billing api",
  "directAnswerSummary": "Instead of Frontend / Web firing serial fetches to Supabase, one pipeline hits https://{{secrets.SUPABASE_PROJECT_REF}}.supabase.co/rest/v1/{{query.table}}?{{query.filter}} (and sibling steps) in parallel and returns mapped JSON.",
  "problem": {
    "title": "Waterfall latency from multiple Supabase requests",
    "explanation": "Frontend / Web widgets often await Supabase sequentially, multiplying TLS handshakes on cellular networks and amplifying failure rates.",
    "risks": [
      "Race conditions between parallel manual fetches",
      "Higher mobile data usage from redundant JSON",
      "Timeouts when any upstream exceeds cellular RTT"
    ]
  },
  "solutionSteps": [
    {
      "stepNumber": 1,
      "title": "Bind vault keys to the Worker",
      "description": "Add SUPABASE_SERVICE_ROLE_KEY to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream."
    },
    {
      "stepNumber": 2,
      "title": "Set headers, mapping, and cache TTL",
      "description": "Configure headersTemplate to inject vault secrets, target https://{{secrets.SUPABASE_PROJECT_REF}}.supabase.co/rest/v1/{{query.table}}?{{query.filter}}, and Add output mapping fields that mirror the JSON contract your screen already expects."
    },
    {
      "stepNumber": 3,
      "title": "Call from Frontend / Web",
      "description": "Authorize with Bearer rc_live_ and fetch the mapped JSON contract your UI already expects.",
      "codeSnippet": "const res = await fetch('https://realcomposer.com/v1/workspace/combine-supabase-user-with-billing-api', {\n  headers: { Authorization: 'Bearer rc_live_your_token' }\n});"
    }
  ],
  "pipelineConfig": {
    "name": "Combine Supabase Auth User with Custom Billing API",
    "method": "GET",
    "cacheTtlSeconds": 0,
    "authMode": "client_token",
    "steps": [
      {
        "stepKey": "supabase",
        "upstreamUrlTemplate": "https://{{secrets.SUPABASE_PROJECT_REF}}.supabase.co/rest/v1/{{query.table}}?{{query.filter}}",
        "httpMethod": "GET",
        "headersTemplate": {
          "apikey": "{{secrets.SUPABASE_SERVICE_ROLE_KEY}}",
          "Authorization": "Bearer {{secrets.SUPABASE_SERVICE_ROLE_KEY}}"
        },
        "timeoutMs": 3000
      }
    ],
    "outputMapping": {
      "version": 1,
      "fields": [
        {
          "targetPath": "rowId",
          "sourcePath": "0.id",
          "type": "string",
          "sourceStep": "supabase"
        },
        {
          "targetPath": "email",
          "sourcePath": "0.email",
          "type": "string",
          "sourceStep": "supabase"
        }
      ]
    }
  },
  "sampleBloatedInput": {
    "requestId": "req_combine-",
    "upstreamLatencyMs": 142,
    "audit": {
      "region": "edge",
      "trace": "combine-supabase-user-with-billing-api"
    },
    "payload": {
      "id": "sample_id",
      "status": "active",
      "nested": {
        "tags": [
          "demo"
        ],
        "internal": true
      },
      "unused_blob": {
        "foo": "bar",
        "bar": "baz"
      }
    }
  },
  "sampleSlimmedOutput": {
    "rowId": "sample",
    "email": "sample"
  },
  "curlSnippet": "curl -X GET \"https://realcomposer.com/v1/workspace/combine-supabase-user-with-billing-api\" \\\n  -H \"Authorization: Bearer rc_live_client_token\"",
  "faqs": [
    {
      "question": "What should Frontend / Web store instead of Supabase secrets?",
      "answer": "Point Frontend / Web at /recipes/combine-supabase-user-with-billing-api edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins."
    },
    {
      "question": "Will Anthropic or Linear prompt bodies be rewritten?",
      "answer": "combine-supabase-user-with-billing-api vault headers attach server-side, but Anthropic or OpenAI model and messages must come from the client body."
    },
    {
      "question": "What happens if an upstream step times out?",
      "answer": "Rotate vault secrets for combine-supabase-user-with-billing-api anytime; clients keep the same rc_live_ token."
    }
  ],
  "relatedRecipeSlugs": [
    "resend-email-api-static-site",
    "transform-and-rename-nested-json-keys",
    "call-stripe-from-flutterflow-securely"
  ],
  "updatedAt": "2026-11-20",
  "links": {
    "page": "https://realcomposer.com/recipes/combine-supabase-user-with-billing-api",
    "markdown": "https://realcomposer.com/recipes/combine-supabase-user-with-billing-api.md",
    "json": "https://realcomposer.com/recipes/combine-supabase-user-with-billing-api.json",
    "install": "https://realcomposer.com/dashboard/pipelines/new?recipe=combine-supabase-user-with-billing-api&via=agent"
  }
}