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
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.Meridian resolves the webhook topic set from your dashboard configuration, so you never declare topics. Passing
app/shopify.server.ts
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
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
Track a metered action
Where to go next
- Authentication: which credential each call uses, and why
useMeridian: everything the hook exposes- Errors and degradation: what the SDK retries, what it swallows, and what you should handle
- Local development: running your app against a managed developer database