RealComposer
Frontend / WebOpenAISupabaseMulti-API Aggregation

Combine Openai Embeddings and Supabase Vector Search in One Call

Parallel OpenAI fetch merged before Frontend / Web hydrates

Direct Answer & Architecture Summary

Instead of Frontend / Web firing serial fetches to OpenAI and Supabase, one pipeline hits https://api.openai.com/v1/embeddings (and sibling steps) in parallel and returns mapped JSON.

Security LevelAES-256-GCM Vault
Edge LatencySub-10ms Response
InfrastructureZero Server Maintenance
The Problem Solved

Waterfall latency from multiple OpenAI and Supabase requests

Frontend / Web widgets often await OpenAI and Supabase sequentially, multiplying TLS handshakes on cellular networks and amplifying failure rates.

Critical Security & Operational Risks:
  • Race conditions between parallel manual fetches
  • Higher mobile data usage from redundant JSON
  • Timeouts when any upstream exceeds cellular RTT
Architecture & Step-by-Step Implementation

How RealComposer Solves This at the Edge

1

Add vault secrets for this pipeline

Create OPENAI_API_KEY, SUPABASE_SERVICE_ROLE_KEY vault entries, then bind them to this pipeline step headers with {{secrets.NAME}} placeholders.

2

Target the real upstream URL

Point step openai at https://api.openai.com/v1/embeddings with POST. Add output mapping fields that mirror the JSON contract your screen already expects. POST pipelines set cache TTL to 0 because RealComposer only stores GET responses at the edge.

3

Call from Frontend / Web

Call https://realcomposer.com/v1/workspace/combine-openai-and-supabase-vector-search with a restricted rc_live_ client token. Frontend / Web never sends upstream secrets.

                    const res = await fetch('https://realcomposer.com/v1/workspace/combine-openai-and-supabase-vector-search', {
  headers: { Authorization: 'Bearer rc_live_your_token' }
});
                  
Payload Slimming Comparison
61% Bandwidth Reduction
Raw Upstream Response260 B
              {
  "requestId": "req_combine-",
  "upstreamLatencyMs": 142,
  "audit": {
    "region": "edge",
    "trace": "combine-openai-and-supabase-vector-search"
  },
  "payload": {
    "id": "sample_id",
    "status": "active",
    "nested": {
      "tags": [
        "demo"
      ],
      "internal": true
    },
    "unused_blob": {
      "foo": "bar",
      "bar": "baz"
    }
  }
}
            
RealComposer Slimmed Edge Payload102 B
              {
  "openai_reply": "sample",
  "openai_tokens": "sample",
  "supabase_rowId": "sample",
  "supabase_email": "sample"
}
            

Recipe Specs

HTTP method
POST
Upstream calls
2
Edge cache TTL
No caching
Client auth
Restricted client token
Mapped output fields
4
Payload
260 B to 102 B (-61%)
Call from Terminal or Client
curl -X POST "https://realcomposer.com/v1/workspace/combine-openai-and-supabase-vector-search" \
  -H "Authorization: Bearer rc_live_client_token" \
  -H "Content-Type: application/json" \
  -d '{"model":"example"}'
Frequently Asked Questions

Developer Questions & Troubleshooting

Does Frontend / Web need CORS changes after adding RealComposer?

Yes for combine-openai-and-supabase-vector-search. Ship only an rc_live_ client token in Frontend / Web; RealComposer injects OPENAI_API_KEY on https://api.openai.com/v1/embeddings.

What cache key does RealComposer use?

combine-openai-and-supabase-vector-search forwards client JSON to POST upstreams unchanged; secrets interpolate only in URLs and header templates.

How do I rotate upstream credentials?

Upstream steps in combine-openai-and-supabase-vector-search honor timeoutMs and optional fallback JSON without leaking secrets.

Sources & Definitions Used in This Answer

Instant Deployment

Deploy this Frontend / Web + OpenAI, Supabase Recipe

Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.

CLONE THIS RECIPE
Related Architecture Recipes