# Combine paddle and supabase billing dashboard

> Supabase user row and Paddle subscription merged for account screens. For "combine paddle and supabase billing dashboard", store PADDLE_API_KEY, SUPABASE_SERVICE_ROLE_KEY in Secret Vault, call https://api.paddle.com/subscriptions/{{query.subscriptionId}} from a Worker, and let FlutterFlow hit only https://realcomposer.com/v1/workspace/combine-paddle-with-supabase-billing with an rc_live_ client token.

- Canonical page: https://realcomposer.com/recipes/combine-paddle-with-supabase-billing
- Client platform: FlutterFlow
- Upstream services: Paddle, Supabase
- Category: Multi-API Aggregation
- JSON version: https://realcomposer.com/recipes/combine-paddle-with-supabase-billing.json
- Install in RealComposer (free plan, pre-fills this pipeline): https://realcomposer.com/dashboard/pipelines/new?recipe=combine-paddle-with-supabase-billing&via=agent

## Problem: Waterfall latency from multiple Paddle and Supabase requests

FlutterFlow widgets often await Paddle and Supabase sequentially, multiplying TLS handshakes on cellular networks and amplifying failure rates.

- Race conditions between parallel manual fetches
- Higher mobile data usage from redundant JSON
- Timeouts when any upstream exceeds cellular RTT

## Solution steps

1. **Add vault secrets for this pipeline**: Store PADDLE_API_KEY, SUPABASE_SERVICE_ROLE_KEY in the vault. FlutterFlow never embeds the raw secret, only a revocable rc_live_ client token.

2. **Target the real upstream URL**: Use GET against https://api.paddle.com/subscriptions/{{query.subscriptionId}}. 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).

3. **Wire the FlutterFlow API Call**: Call https://realcomposer.com/v1/workspace/combine-paddle-with-supabase-billing with a restricted rc_live_ client token. FlutterFlow never sends upstream secrets.

```
// FlutterFlow API Call
URL: https://realcomposer.com/v1/workspace/combine-paddle-with-supabase-billing
Header Authorization: Bearer rc_live_your_token
```

## Pipeline config

Import this config into a RealComposer pipeline. `{{secrets.NAME}}` values are read from the encrypted Secret Vault at request time, so the client never sees them.

```json
{
  "name": "Combine paddle and supabase billing dashboard",
  "method": "GET",
  "cacheTtlSeconds": 0,
  "authMode": "client_token",
  "steps": [
    {
      "stepKey": "paddle",
      "upstreamUrlTemplate": "https://api.paddle.com/subscriptions/{{query.subscriptionId}}",
      "httpMethod": "GET",
      "headersTemplate": {
        "Authorization": "Bearer {{secrets.PADDLE_API_KEY}}"
      },
      "timeoutMs": 3000
    },
    {
      "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": "paddle.subscriptionId",
        "sourcePath": "data.id",
        "type": "string",
        "sourceStep": "paddle"
      },
      {
        "targetPath": "paddle.status",
        "sourcePath": "data.status",
        "type": "string",
        "sourceStep": "paddle"
      },
      {
        "targetPath": "supabase.rowId",
        "sourcePath": "0.id",
        "type": "string",
        "sourceStep": "supabase"
      },
      {
        "targetPath": "supabase.email",
        "sourcePath": "0.email",
        "type": "string",
        "sourceStep": "supabase"
      }
    ]
  }
}
```

## Call the pipeline

```bash
curl -X GET "https://realcomposer.com/v1/workspace/combine-paddle-with-supabase-billing" \
  -H "Authorization: Bearer rc_live_client_token"
```

## Payload before and after

Raw upstream response:

```json
{
  "requestId": "req_combine-",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "combine-paddle-with-supabase-billing"
  },
  "payload": {
    "id": "sample_id",
    "status": "active",
    "nested": {
      "tags": [
        "demo"
      ],
      "internal": true
    },
    "unused_blob": {
      "foo": "bar",
      "bar": "baz"
    }
  }
}
```

Slimmed RealComposer response:

```json
{
  "paddle_subscriptionId": "sample",
  "paddle_status": "sample",
  "supabase_rowId": "sample",
  "supabase_email": "sample"
}
```

## FAQ

### Which Paddle credential belongs in the vault for this pipeline?

Store PADDLE_API_KEY, SUPABASE_SERVICE_ROLE_KEY for combine-paddle-with-supabase-billing. FlutterFlow never sees decrypted values.

### Does POST traffic get cached?

combine-paddle-with-supabase-billing vault headers attach server-side, but Anthropic or OpenAI model and messages must come from the client body.

### What happens if an upstream step times out?

Upstream steps in combine-paddle-with-supabase-billing honor timeoutMs and optional fallback JSON without leaking secrets.
