Getting Started

API keys

Every store has three keys: a Public browser key for your storefront, a Secret API key for your server, and a Test key for your playground link.


The three keys

You find them on your store's API Keys tab in the SearchX admin. Each card shows what the key can do.

KeyAccessWhere it goes
Public browser keyRead AccessYour storefront's pages: the SDK, a theme snippet, or your plugin's Public browser key field.
Secret API keyRead & Write AccessYour server only: your plugin's Secret API key field, or your own backend calling the SearchX APIs.
Test keyRead AccessNothing to install. Your playground link runs on it, so anyone you share the link with can try your search.
  • The Public browser key can only search, and only from your store's website address (set on your store in SearchX). It is printed into your pages, and that is safe.
  • The Secret API key can read and change your store: import products, read analytics, update settings and send orders. It stays on your server.
  • The Test key can only search. Its searches are not counted in your analytics.

Never put the Secret API key in the browser

Anything in your pages, theme, templates or scripts is visible to every visitor. If the Secret API key ends up there, anyone can use it to change your store. Use the Public browser key for everything that runs in the browser, and regenerate the Secret API key if it was ever exposed.


Where each key goes

Pick your store's platform. Each tab says which key goes in which field.

In WooCommerce > Settings > SearchX:

FieldKeyNotes
Secret API keySecret API keyStays on your server. Used for searches in Through WordPress mode and to send orders.
Public browser keyPublic browser keyNeeded for Direct to SearchX (recommended, and required for Agentic AI Search). The plugin refuses a Secret API key here.

Or with constants in wp-config.php:

define('SEARCHX_APP_ID', 'YOUR_APP_ID');
define('SEARCHX_API_KEY', 'YOUR_SECRET_API_KEY');
define('SEARCHX_PUBLIC_KEY', 'YOUR_PUBLIC_BROWSER_KEY');

Full guide: WooCommerce integration.


Regenerating a key

Keys cannot be created by hand. If a key leaks, open the API Keys tab and click Regenerate on it. You confirm with a code sent to your email. The old token stops working at once, so paste the new one wherever the old one was used.

Older keys

Stores created before every store had its own three keys may also list Other keys. They keep working. Once nothing uses one, revoke it from the same tab.

Previous
Quick Start