Sander Korf
  • Portfolio
  • Resume

Sander Korf

Dutch Full Stack AI Engineer helping businesses cut costs through intelligent automation. 13+ years turning expensive manual processes into systems that work 24/7. Based in Amsterdam, available for freelance projects.

Navigation

  • Portfolio
  • Resume

Legal

  • Cookies
  • Privacy Policy
  • Terms and Conditions

Blog

Algolia

  • Algolia InstantSearch INP and object identity
  • Algolia merch by Sanity _type, not title
  • Algolia InstantSearch search key, not admin

Vercel

  • Next.js empty Suspense fallbacks wreck CLS P95
  • Vercel Workflows: skip closed eToro legs

eToro

  • eToro deploy vs rotate: idle cash not rotate
  • eToro search 404: query fields, not ticker
  • eToro v2 opens at-most-once, settlement
  • eToro LLM overlay ±10pp: critic cannot veto

Next.js

  • next-intl useTranslate skip links above fold
  • next-intl owns Klaviyo nl-NL email copy

Firebase & Expo

  • Staging deep links must not hijack production
  • Turn off Worklets Bundle Mode for EAS SHA-1
  • Reclaim Firebase orphan without password wipe

Centra & Klaviyo

  • Centra to Klaviyo tags need a plugin contract

About

  • Full Stack AI Engineer in Amsterdam

© 2026 Sander Korf. All rights reserved

94719489

  • Applied AI
  1. Home
  2. Blog
  3. Algolia InstantSearch search key, not admin

Algolia InstantSearch search key, not admin

I almost shipped the admin search key to the browser. Use a read-only key on the storefront and keep index writes on the server only.

Sander KorfPublished August 25, 20262 min read
algoliainstantsearchnextjsshopify

This was a clothing storefront on Shopify and Algolia

Next.js. Shopify catalog. Algolia InstantSearch on the PLP. Merchandising jobs on the server. If the browser received the admin key, every visitor with DevTools received the catalog write button.

What they would notice if it failed

Nothing, at first. Search still works. An admin key can search. Then someone copies the key from the network tab and clears an index, or dumps every record, or changes a ranking that merchandising spent a week on. Shoppers notice empty hits. You notice a support channel that says "search is gone."

The puzzle: the client looked convenient

InstantSearch wants searchClient. algoliasearch(appId, adminKey) returns a client. It answers queries. It also answers deleteIndex. I had both keys in the same env file. The Next.js client bundle does not care that you named the variable ALGOLIA_ADMIN_API_KEY in a comment. If it is NEXT_PUBLIC_, it ships.

The public key is a search-only key from the Algolia dashboard. ACL: search. Not addObject, not deleteIndex, not settings. InstantSearch on the storefront uses that. Server routes that push Shopify / Sanity records use the admin key and never import that module into a client component.

// client: InstantSearch
const searchClient = algoliasearch(process.env.NEXT_PUBLIC_ALGOLIA_APP_ID, process.env.NEXT_PUBLIC_ALGOLIA_SEARCH_KEY);
 
// server: merchandising / index writes
const adminClient = algoliasearch(process.env.ALGOLIA_APP_ID, process.env.ALGOLIA_ADMIN_API_KEY);

If a server helper needs to run during SSR of the PLP, pass hits as props. Do not pass the admin client. Do not "just for now" reuse it in a hook.

Algolia will let a search UI use an admin key. That is not a feature. That is you publishing the index password next to the product grid.


Happy coding!
Sander