cimplify

Environments

Two isolated environments: Live (real data, real payments) and Test (sandbox, no charges).

Environment is determined by key prefix
import { createCimplifyClient } from "@cimplify/sdk";

// Test mode - sandbox data, no real charges
const testClient = createCimplifyClient({ publicKey: "pk_test_abc123" });
console.log(testClient.isTestMode()); // true

// Live mode - real data, real payments
const liveClient = createCimplifyClient({ publicKey: "pk_live_def456" });
console.log(liveClient.isTestMode()); // false

Comparison

FeatureLiveTest
Key prefixpk_live_ / sk_live_pk_test_ / sk_test_
PaymentsReal charges processedNo charges, simulated
DataReal business dataSandbox copy of catalogue
NotificationsSent to real customersSuppressed
InventoryAffects real stockIsolated sandbox stock

Sandbox business

Enabling developer access creates a sandbox business with a copy of your catalogue. It appears in the dashboard business switcher and is fully isolated from live data.

When to use each environment

ContextEnvironmentKey
Local developmentTestpk_test_
Staging / QATestpk_test_
CI / Integration testsTestsk_test_
ProductionLivepk_live_

Switching environments

.env
# Development
NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=pk_test_abc123

# Production
NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=pk_live_def456

The SDK reads NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY automatically. No code changes needed to switch environments.

Environment detection

TYPESCRIPT
function getEnvironment(apiKey: string): "live" | "test" {
  if (apiKey.startsWith("sk_live_") || apiKey.startsWith("pk_live_")) {
    return "live";
  }
  return "test";
}

// In webhook handlers, the event payload also includes environment
app.post("/webhooks", (req, res) => {
  if (req.body.environment === "test") {
    console.log("Test event - skipping production logic");
    return res.sendStatus(200);
  }
  processLiveEvent(req.body);
});

Next steps