createMeridianServerClient is the SDK without React: the same reads and the same billing writes, for resource routes, Shopify extensions, background jobs and anything else that runs outside a component.
It takes a shop token, either bare or as { shopToken, baseUrl } to override the API root. If you have a shop domain rather than a token, createMeridianApp gets you there in one call with serverClientForShop(shop).
Methods
Gates
getGates() is the server-side equivalent of the provider’s gates, resolved once and then read synchronously:
getGates is the one method that does not throw when Meridian is unreachable: entitlements comes back null and every gate reads as ungated, so it suits a request path. See fail open or fail closed.
checkFeature costs one call per feature, so prefer getGates when you are checking more than one.
Errors
Every other method throws MeridianApiError on failure, unlike createMeridianApp, which degrades.
There is no automatic token refresh on the server client; only the provider does that. If a job holds a token for longer than an hour, refresh it when a call reports it expired, or mint a fresh one with mintShopToken. See Errors.
isShopTokenRevokedError(err) (401 SHOP_TOKEN_REVOKED) means the shop uninstalled the app. refreshShopToken() only helps once it has reinstalled, and only within the revoked token’s original hour, so mint a fresh token instead.
Subscribing from the server
subscribe takes the returnUrl as a required argument here, with the same shop-admin constraint as the pricing page. The SDK validates it before the call either way.
Server-side subscribing is what the provider’s onSubscribe override routes to. Reach for it when you want a billing action enforced on your own server.
Pure helpers
featureEnabled, featureLimit and eventUsage are exported from the server entry too, so a snapshot you already hold can be gated without a client:
Last modified on October 7, 2026