Skip to main content
A working Meridian integration is four steps. The code below is React Router / Remix shaped, matching the Shopify app template; only the loaders are framework-specific. Before you start, create the app in Meridian and copy its credentials. See Credentials.
1

Create one server entrypoint

createMeridianApp reads MERIDIAN_APP_ID, MERIDIAN_API_KEY and MERIDIAN_API_URL from the environment. Create it once and import it everywhere.
app/meridian.server.ts
It never throws into your app. With no credentials set, configured is false and every method returns its unconfigured result, so your app still builds and renders. See createMeridianApp.
2

Wire the install in afterAuth

One call registers your Shopify webhooks, reports the authentication so your install automations fire, reports the shop’s Shopify subscriptions and their trial length (which is how apps billing through the Shopify Billing API get trials into Meridian), and attributes an affiliate referral if there is one.
app/shopify.server.ts
Meridian resolves the webhook topic set from your dashboard configuration, so you never declare topics. Passing request matters only if you run an affiliate program.
3

Mint a shop token in your loader

The shop token is the per-shop credential the browser uses. Mint it server-side and pass it down.
app/routes/app.tsx
mintShopToken returns null when Meridian is unconfigured or unreachable. Treat that as “render without Meridian”, not as an error.Calling it in a loader is cheap: the app instance caches the handshake, so it costs one identify per shop per token lifetime, not one per request. On serverless hosting, where that cache is cold on every start, persist the token instead. See Persisting the token yourself.
4

Mount the provider

app/routes/app.tsx
The provider fetches the shop’s plan, entitlements and your plan catalogue on mount, and refreshes an expired token transparently. See MeridianProvider.

Gate your first feature

Anywhere below the provider:
advanced_reports is the feature’s key, exactly as you typed it in the plan builder. See Feature gating.

Add the pricing page

MeridianPricingPage needs a returnUrl, and it must be an https URL on the shop’s own admin. Build it in the loader, where you have the session shop and your Shopify client ID:
app/routes/app.pricing.tsx
app/routes/app.pricing.tsx
Do not build the returnUrl from request.url, window.location, or your app’s own hosting origin. Shopify’s billing API only accepts a shop-admin URL, and the SDK throws before the call rather than letting the API reject it. See Pricing page.

Track a metered action

Meridian sums the quantity over the store’s current billing period and raises Shopify usage charges from your plan’s terms. See Usage tracking.

Where to go next

Last modified on September 28, 2026