Skip to main content

Quickstart

This guide takes you from zero to the widget rendered on your shop in 10 minutes. No theory, no internals. Copy-paste and done.

Before you start

You need one thing: your Shop API Key (sk_…). If you don't have it yet, go to How to get your Shop API Key (3 minutes) and come back.

export NEUROON_API_URL=https://api.neuroon.ai
export NEUROON_API_KEY=sk_your_key_here
export NEUROON_SHOP_ID=shop_your_id_here

1. Sync your first product

From your server:

curl -X POST https://api.neuroon.ai/api/plugin/shops/$NEUROON_SHOP_ID/products/sync \
-H "X-Shop-API-Key: $NEUROON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"syncType": "INCREMENTAL",
"products": [{
"externalId": "demo-001",
"name": "Basic black t-shirt",
"price": 19.99,
"currency": "EUR",
"url": "https://yourshop.com/p/demo-001"
}]
}'

Response (200):

{ "totalReceived": 1, "newProducts": 1, "updatedProducts": 0, "failed": 0 }

The product is searchable in 2 to 5 seconds. Repeat the POST with your catalog in batches of up to 500 products.

2. Sign a Widget Token

The Widget Token is signed by your own server locally using the Shop API Key as HMAC secret. You don't call Neuroon to issue it. Node example:

import { createHmac } from 'node:crypto';

const ts = Math.floor(Date.now() / 1000);
const payload = `${process.env.NEUROON_SHOP_ID}:${ts}`;
const sig = createHmac('sha256', process.env.NEUROON_API_KEY).update(payload).digest('hex');
const token = Buffer.from(`${payload}:${sig}`, 'utf8').toString('base64url');

console.log(token); // c2hvcF9hYmM6MTcxNTAwMDAwMDoxYTJiM2M...

Cache this token on your server for 24 hours. After that, sign again. Copy-paste implementations in .NET, Python and PHP in Recipe · Server-to-server token.

3. Embed the widget on your shop

In your shop's HTML template (any framework: Next.js, ASP.NET, PHP, Express, Rails…):

<div id="neuroon-search"></div>
<script
src="https://cdn.neuroon.ai/widget@0.9.10/widget.js"
data-token="THE_TOKEN_FROM_STEP_2"
data-container="#neuroon-search"
data-api-url="https://api.neuroon.ai"
data-theme="auto"
data-locale="en">
</script>

Replace THE_TOKEN_FROM_STEP_2 with your template engine's syntax.

4. Test

Open your shop. Click on <div id="neuroon-search">. The widget opens. Search for "shirt". Your product shows up.

If something doesn't work, go to Troubleshooting.

Next steps