Combine Algolia Search Results with Supabase User Favorites
One edge call merges Supabase for Frontend / Web
To combine algolia search results with supabase user favorites, configure parallel steps for Supabase and Algolia. Frontend / Web performs one authorized GET/POST to RealComposer and receives a merged payload.
Serial Supabase and Algolia calls slow Frontend / Web pages
Each extra Supabase and Algolia hop adds hundreds of milliseconds and another OAuth refresh path your UI must manage.
- One slow upstream blocking an entire page
- Partial failures leaving UI in inconsistent states
- Duplicate auth refresh logic per service
How RealComposer Solves This at the Edge
Store upstream credentials in Secret Vault
Add SUPABASE_SERVICE_ROLE_KEY, ALGOLIA_API_KEY to RealComposer Secret Vault. Values decrypt only inside the Cloudflare Worker that calls the upstream.
Target the real upstream URL
Use POST against https://{{secrets.SUPABASE_PROJECT_REF}}.supabase.co/rest/v1/{{query.table}}?{{query.filter}}. Allowed origins on the client token should match post pipelines set cache ttl to 0 because realcomposer only stores get responses at the edge.
Call from Frontend / Web
Allowed origins on the token should list every Frontend / Web host that calls this URL.
const res = await fetch('https://realcomposer.com/v1/workspace/combine-algolia-search-with-user-favorites', {
headers: { Authorization: 'Bearer rc_live_your_token' }
});
{
"requestId": "req_combine-",
"upstreamLatencyMs": 142,
"audit": {
"region": "edge",
"trace": "combine-algolia-search-with-user-favorites"
},
"payload": {
"id": "sample_id",
"status": "active",
"nested": {
"tags": [
"demo"
],
"internal": true
},
"unused_blob": {
"foo": "bar",
"bar": "baz"
}
}
}
{
"supabase_rowId": "sample",
"supabase_email": "sample",
"algolia_hitCount": "sample",
"algolia_firstHit": "sample"
}
Recipe Specs
- HTTP method
- POST
- Upstream calls
- 2
- Edge cache TTL
- No caching
- Client auth
- Restricted client token
- Mapped output fields
- 4
- Payload
- 261 B to 109 B (-58%)
curl -X POST "https://realcomposer.com/v1/workspace/combine-algolia-search-with-user-favorites" \
-H "Authorization: Bearer rc_live_client_token" \
-H "Content-Type: application/json" \
-d '{"model":"example"}'Developer Questions & Troubleshooting
Can Frontend / Web call Supabase without holding the production key?
Point Frontend / Web at /recipes/combine-algolia-search-with-user-favorites edge URL. RealComposer answers OPTIONS with Access-Control headers for allowed origins.
Does POST traffic get cached?
combine-algolia-search-with-user-favorites POST steps bypass caches.default even if cacheTtlSeconds is set in the dashboard.
What happens if an upstream step times out?
Upstream steps in combine-algolia-search-with-user-favorites honor timeoutMs and optional fallback JSON without leaking secrets.
Sources & Definitions Used in This Answer
Deploy this Frontend / Web + Supabase, Algolia Recipe
Clone this pre-configured pipeline into your RealComposer workspace in one click. We pre-populate upstream URLs, headers, and mapping rules.