RealComposer

Algolia Safe & Unsafe Practices

Direct Answer

Algolia search-only API keys are safe in clients, and secured API keys add per-user filters on top. The Admin API key and any key with write ACLs must stay on the server, because they can modify or delete indices.

Credentials & Where They Belong

Client safe
Search-only API key

Can only run search queries against allowed indices.

Client safe
Secured API key

Generated server-side with embedded filters and expiry.

Server only
Admin API key

Full control of indices, settings, and keys.

Safe Practices

  • Generate secured keys for user-scoped data

    Embed filters like tenant_id on the server so users cannot search other tenants.

  • Restrict search keys by index and referrer

    Limit each key to specific indices and set rate limits per IP.

Unsafe Practices

  • Shipping the Admin key in a frontend

    Attackers can clear indices or read every record.

  • Filtering private data only on the client

    Client-side filters are easy to remove. Use secured keys or server-side search.

The RealComposer Pattern

Keep ALGOLIA_ADMIN_KEY in the vault for merged search pipelines, and return slim hit objects to clients that only hold a search-only key.

START BUILDING FREE

Frequently Asked Questions

Q:Is the Algolia search-only key safe to expose?

Yes. It only allows search. Make sure indexed records do not contain fields you would not show publicly.

Multi-API Aggregation

Stitch firebase firestore with algolia search index

Firestore document fetch and Algolia query in one search-as-you-type call. For "stitch firebase firestore with algolia search index", store FIREBASE_ACCESS_TOKEN, ALGOLIA_API_KEY in Secret Vault, call https://firestore.googleapis.com/v1/projects/{{query.projectId}}/databases/(default)/documents/{{query.collection}}/{{query.docId}} from a Worker, and let React hit only https://realcomposer.com/v1/workspace/stitch-firebase-with-algolia-search with an rc_live_ client token. POST upstream calls are not stored in caches.default; clients must send JSON bodies and headers forward unchanged.

Sub-10ms edgeView Recipe

Aggregate contentful content with algolia search

Algolia search results enriched with Contentful entry fields at edge. For "aggregate contentful content with algolia search", store CONTENTFUL_ACCESS_TOKEN, ALGOLIA_API_KEY in Secret Vault, call https://cdn.contentful.com/spaces/{{query.spaceId}}/entries from a Worker, and let Next.js / React hit only https://realcomposer.com/v1/workspace/aggregate-contentful-with-algolia-search with an rc_live_ client token. POST upstream calls are not stored in caches.default; clients must send JSON bodies and headers forward unchanged.

Sub-10ms edgeView Recipe
Edge Caching & Rate Limits

Contentful and algolia search cache edge

Cache composed search hits for popular queries. For "contentful and algolia search cache edge", store CONTENTFUL_ACCESS_TOKEN, ALGOLIA_API_KEY in Secret Vault, call https://cdn.contentful.com/spaces/{{query.spaceId}}/entries from a Worker, and let Next.js / React hit only https://realcomposer.com/v1/workspace/contentful-algolia-search-cache-edge with an rc_live_ client token. POST upstream calls are not stored in caches.default; clients must send JSON bodies and headers forward unchanged.

Sub-10ms edgeView Recipe

Related Concepts