Docs

Check access from the storefront

Ask from theme code whether pages are locked for the current shopper.

When you finish, your theme code knows, for each URL, whether it is locked for the current shopper.

Ask for up to 50 URLs

Call the app proxy from storefront JavaScript. It needs no token.

const params = new URLSearchParams();
for (const url of ["/products/moon-ring", "/collections/vip"]) params.append("urls[]", url);
const access = await (await fetch(`/apps/shopbird/access?${params}`)).json();

Read the answer

Each URL maps to its state:

{
  "/products/moon-ring": {
    "locked": true,
    "access_granted": false,
    "hide_resource": false,
    "lock_ids": ["…"],
    "opened_lock_ids": []
  }
}

Limits

Rule Value
URLs per request 50
access_granted covers Tags and sign-in. Code unlocks live in the shopper's browser.
Unknown, unpublished and hidden resources Answer like unlocked ones, so the check can't reveal unannounced products.
Where it works The Online Store only. It runs through Shopify's app proxy.