createMeridianApp() reads the app ID, the API key and the API URL itself; you can pass appId, apiKey and baseUrl explicitly instead. The developer database ID is read on every identify call. The webhook secret you pass in yourself, to the verification helpers.
Where they come from
The app ID and API key live on the app’s settings page, under Meridian SDK credentials. See App settings. The API key is shown once, when it is created or rotated, and never again.Creating the first API key
A new app has no API key, and opening the settings page does not create one.- Click Create API key on the Meridian API keys card. This needs the Credentials: Manage permission.
- Copy the key into
MERIDIAN_API_KEYon your server. It is shown once. - The card then lists the key, with when it was last used.
Rotating the API key
- Click Rotate on the Meridian SDK card. Meridian mints a new key and keeps the previous one authenticating for 7 days.
- Copy the new value into
MERIDIAN_API_KEYand redeploy. - Watch last used on the old key. When traffic has moved, revoke it early, or wait for the window to close.
- Use Revoke only when a key leaked. That stops authentication immediately and will break any instance still holding the old value.
On Meridian hosting
Meridian injects these variables when you deploy, including into existing apps on their next deploy:
The two secrets live in the Meridian secret store. The Managed by Meridian section of your hosting variables lists them without exposing their values. The dedicated hosting key is separate from the key shown once in Meridian SDK credentials. Creating it leaves your existing keys valid.
If you declare
MERIDIAN_API_KEY or MERIDIAN_WEBHOOK_SECRET yourself, your value wins. Environment-level declarations take precedence over app-level declarations. Delete your override and redeploy to use the managed value again. Meridian does not replace an invalid or outdated manual override.
Rotating the API key in app settings starts the same 7-day overlap window for dashboard and hosting keys. Redeploy each hosted environment before that window closes: its next deploy creates or reuses a new hosting key automatically. After rotating the webhook signing secret, redeploy within its 24-hour grace window. Both rotations, and revoking the hosting key, raise Changes apply on the next deploy. on the app’s hosted environments until a deploy starts. If you use manual overrides, update those values before redeploying.
For an app hosted elsewhere, declare MERIDIAN_APP_ID and the dashboard’s MERIDIAN_API_KEY yourself. In local development, meridian dev provides them (see Local development). Also declare MERIDIAN_WEBHOOK_SECRET if you receive forwarded webhooks. See Environment variables for the full managed set, including Shopify credentials and add-ons.
What each credential can do
A shop token is safe to hand to the browser, because its scope stops at one shop. Authentication covers that scope in full.
Pointing at another environment
MERIDIAN_API_URL sets the API root, including any platform path prefix. The SDK appends /api/public itself. Leave it unset for the production default, https://api.the-meridian.ai, when running outside Meridian hosting.
To call the Meridian staging platform, use MERIDIAN_API_URL=https://staging.the-meridian.ai/staging, with an app ID and API key from that platform. Keep the /staging prefix and do not append /api/public. These public SDK routes are accessible without the platform’s Google login.
On Meridian hosting, the platform injects the correct URL automatically. An app’s staging environment on the production platform still uses the production API. See Environments.
The Meridian MCP server at mcp.the-meridian.ai accesses the production platform only. It does not list apps created on the staging platform.
The SDK logs one warning per base URL that is neither https nor localhost, because your bearer token would otherwise travel in plain text. It still sends the request; the warning is the signal that your configuration is wrong.
Local development
meridian dev gives your dev server MERIDIAN_APP_ID, a dev SDK key limited to dev stores and MERIDIAN_API_URL, so the SDK works with no key to paste into .env. It puts them in the server’s environment only, never in a file. A MERIDIAN_APP_ID or MERIDIAN_API_KEY you already set in your shell or .env wins: nothing is injected then. See SDK credentials for the rules.
The dev key is separate from your dashboard API keys, but there is no separate development API: the key calls the platform your CLI is logged in to.
Without meridian dev, your app uses the same app ID and dashboard API key as anywhere else outside Meridian hosting. Declare them in your .env (see On Meridian hosting). With MERIDIAN_API_URL unset, a local app calls the production platform, like a deployed one.
meridian dev also exports MERIDIAN_DEV_DATABASE_ID into your process (next to DATABASE_URL). The SDK reads it on every identify call and tags the install with that managed developer database. Deployed apps have no such variable, and the tag is cleared.
Billing from local development
When a shop subscribes from your local app, which Shopify session Meridian uses depends on how the app runs:
So to test billing locally, start the app with
meridian dev and install it on a development store. Without meridian dev, the install is not tagged, Meridian looks for the shop in production, and the subscribe fails when production has no session for it.
A developer database is for development stores only. identify refuses the tag for a store Meridian knows is a real one, and clears it when a tagged store turns out not to be a development store. The billing requirement itself is on What needs Meridian hosting.
Running without Meridian
Credentials are not the only prerequisite: the billing calls also need the app hosted on Meridian. An app with noMERIDIAN_APP_ID or MERIDIAN_API_KEY keeps running. In SDK 3.4.0 and later, createMeridianApp() logs one [Meridian] console.warn per process at construction, including in production and tests. The warning names only the missing variables and links to this section. There is no option to silence it, and unconfigured calls add no per-call log.
configured is false, shop tokens are null, and every feature reads as off. Events are not recorded, the pricing and account pages render empty, and installs and subscriptions are not reported. The page components also keep their own console warning. track and trackMany return null. To distinguish missing configuration from a failed request, use trackDetailed or trackManyDetailed in SDK 3.4.0 and later: they return { status: "unconfigured" } without a network call. Only status: "recorded" confirms a recorded event. See Tracking usage events for all outcomes.