Skip to main content
A feature is a capability a plan grants. You define features in the plan builder and attach them to plans; the SDK answers “does this shop’s plan grant it?” at runtime. In React the answer comes from the snapshot the provider loaded, with no network call in the render path. On the server, gatesForShop reads the snapshot from Meridian and keeps it in memory for 30 seconds.

Boolean and numeric features

A feature is either on/off or carries a number. A numeric feature is still enabled or not. The limit is the amount the plan sets on top of that. Check both: an enabled feature with no limit configured returns undefined from getLimit, not 0. A feature the plan makes Unlimited reads the same way: enabled, with getLimit returning undefined.

Keys are the contract

The string you pass is the feature’s key: the app-local stable identifier from the plan builder. A key survives a rename in the dashboard.
A key that does not exist reads as false, and a missing limit reads as undefined. A typo therefore gates nothing and reports no error. Read the real keys from the plan builder, or from Meridian MCP’s features_list, rather than retyping them.

Gating on the server

The same gates exist without React, for resource routes, Shopify extensions and background jobs:
gatesForShop resolves the shop’s entitlements in one call and never throws. In SDK 3.5.0 and later, gates.status says whether Meridian answered ("ok") or why it did not ("unconfigured", "rate_limited", "failed"), and every feature reads as off when it did not. See Fail open or fail closed. A snapshot Meridian answered is kept in memory for 30 seconds. See Caching entitlements. If you already hold a shop token, createMeridianServerClient(...).getGates() returns the same gates, read from Meridian on every call, and checkFeature(key) reads a single feature. See Server client. Entitlements resolve through one path everywhere, so a gate behaves identically in your React code, on your server, and in Meridian MCP’s entitlements_explain.

Fail open or fail closed

The SDK fails closed by default: when it has nothing to read, every feature reads as off. A paying merchant then sees paid features as off until Meridian answers again. This is what each gate returns, case by case: status, failOpen and the server cache are in SDK 3.5.0 and later. Earlier versions fail closed in every case above, with no documented field to tell them apart.

Telling no plan from a Meridian failure

A false from a gate means either “this plan does not grant it” or “Meridian could not answer”. Read status before acting on it, for example before showing an upgrade prompt or refusing a paid action:
  • On the server, gates.status is "ok" when Meridian answered, and a false is then the plan’s answer. With "failed", gates.error is the original error: a MeridianApiError with its status and code when the API answered. With "rate_limited", gates.retryAt is when the SDK calls Meridian again.
  • In React, read status from useMeridian. It is "loading" until the first snapshot loads, then "ok" for good: a failed refresh() keeps the last snapshot, sets error, and the gates keep answering from it. "failed" and "rate_limited" mean the first load failed, so there is no snapshot at all. While status is "loading", render a placeholder rather than the upgrade prompt.
  • Before the provider, when Meridian is down while your loader runs, mintShopToken returns null and the provider is not mounted. meridian.configured === true && shopToken === null then means Meridian failed, rather than missing credentials, and your app decides what to render.

Failing open

Pass failOpen: true and a gate answers true when Meridian could not answer ("failed" or "rate_limited"), so a Meridian outage cannot lock a paying merchant out:
A call can override the default either way, and its option wins:
failOpen changes the yes/no answer only when Meridian failed. It never applies to "unconfigured", so a missing environment variable in production does not hand out every paid feature, and never while the provider is still loading. Once Meridian has answered, the plan decides. limitOf, getLimit, usage, getUsage, view and getView stay undefined, because there is no number to make up. We recommend failOpen: true for the capabilities merchants pay for. The cost is that during an outage every shop gets those features, free ones included. Keep a feature closed with { failOpen: false } when each use costs you money (an AI call, an email send) or when giving it away for a few minutes is worse than turning it off. Gate paid actions on the server too: a client-side gate only hides the button, and anyone can call your route directly.

Gating on usage

A limit a shop consumes over time is an event rather than a feature. getUsage(eventKey) returns what the plan includes and what has been used this period.
Last modified on November 22, 2026