Switching environments
Switching between environments in Neuroon boils down to two changes:
- The base URL your integration uses to call the API (
api.neuroon.ai↔dev-api.neuroon.ai). - The key for the corresponding environment (
sk_*andWidget Token).
All per-environment configuration must live in environment variables or secrets, never hardcoded.
Recommended environment variables
NEUROON_API_URL=https://api.neuroon.ai # or https://dev-api.neuroon.ai
NEUROON_SHOP_ID=shop_xxxxxxxxxxxx
NEUROON_API_KEY=sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
NEUROON_WIDGET_TOKEN=c2hvcF9hYmM6MTcxNTI3MDQwMDpzaWduYXR1cmU=
Widget Token format: Base64 of
shopId:timestamp:HMAC-SHA256(see Widget Token). Nowt_prefix. Issued by your server using the Shop API Key, expires after 24h.
Per stack
HTML / widget <script> tag
Change the data-api-url attribute on the tag:
<script
src="https://cdn.neuroon.ai/widget@0.9.10/widget.js"
data-token="WIDGET_TOKEN_HERE"
data-container="#neuroon-search"
data-locale="es"
data-api-url="https://api.neuroon.ai"
async
></script>
For Development, replace with data-api-url="https://dev-api.neuroon.ai" and use the Widget Token issued in the Development Dashboard.
.NET
Read configuration from IConfiguration (appsettings.{Environment}.json, environment variables, or your secret manager):
// appsettings.Development.json
{
"Neuroon": {
"ApiBaseUrl": "https://dev-api.neuroon.ai",
"ShopId": "shop_dev_xxxxx"
}
}
var apiBase = builder.Configuration["Neuroon:ApiBaseUrl"]
?? "https://api.neuroon.ai";
var apiKey = builder.Configuration["Neuroon:ApiKey"]!; // from secret manager
builder.Services.AddHttpClient("neuroon", c =>
{
c.BaseAddress = new Uri(apiBase);
c.DefaultRequestHeaders.Add("X-Shop-API-Key", apiKey);
});
To switch environments just change the Neuroon section in appsettings.{Environment}.json or the environment variables (Neuroon__ApiBaseUrl, Neuroon__ApiKey). For DotNetNuke (DNN) integrations using HostController see DNN end-to-end.
WordPress (PHP)
Define in wp-config.php:
define('NEUROON_API_URL', 'https://api.neuroon.ai');
define('NEUROON_SHOP_ID', 'shop_xxxxxxxxxxxx');
define('NEUROON_API_KEY', 'sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
And allow filter override:
add_filter('neuroon_api_base_url', function($url) {
return defined('WP_ENV') && WP_ENV === 'staging'
? 'https://dev-api.neuroon.ai'
: 'https://api.neuroon.ai';
});
Custom Node.js / TypeScript
const NEUROON_API_URL = process.env.NEUROON_API_URL ?? 'https://api.neuroon.ai';
const NEUROON_API_KEY = process.env.NEUROON_API_KEY!;
await fetch(`${NEUROON_API_URL}/api/plugin/shops/${SHOP_ID}/products/sync`, {
method: 'POST',
headers: {
'X-Shop-API-Key': NEUROON_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify(payload),
});
Custom Python
import os, requests
NEUROON_API_URL = os.environ.get("NEUROON_API_URL", "https://api.neuroon.ai")
NEUROON_API_KEY = os.environ["NEUROON_API_KEY"]
requests.post(
f"{NEUROON_API_URL}/api/plugin/shops/{SHOP_ID}/products/sync",
headers={"X-Shop-API-Key": NEUROON_API_KEY, "Content-Type": "application/json"},
json=payload,
timeout=30,
)
Golden rules
- Use distinct names for environment variables (
NEUROON_API_KEY_PROD,NEUROON_API_KEY_DEV) if your pipeline deploys both. - Audit your logs to detect requests with the wrong base URL before switching to Production.
- In containers, mount keys as orchestrator secrets (Docker secret, Kubernetes secret), not as a literal ENV in the
Dockerfile.