Skip to main content
The account feature adds sign-in prompts and an account button to the Swish drawer, letting customers authenticate and access their Shopify account without leaving the storefront. Swish can open from your theme’s account link instead of the Shopify account page. The link keeps its own icon and styling, and can show the customer’s saved item count as a badge. Add it under Placements → Header: select Add placement, then set Type to Account link. Opens picks the view it goes to - point it at Profile and signed-out customers go to sign-in instead.

Disabling accounts

Accounts are enabled by default. To hide account-related UI, disable the account button in the drawer header, the profile navigation item in the footer, and the sign-in section on the home, saves and lists views. If you want to keep the account button but send customers to your own account pages instead of Swish’s profile view, set accountButtonUrl rather than turning it off — see Drawer.
See the Drawer, Home, Saves and Lists view guides for the full section configuration.

Sign-in requirements

You can optionally require customers to be signed in to perform specific actions by setting features.signInRequirement. When a requirement is set, Swish automatically triggers the initiate:sign-in intent instead of the requested action if the customer is signed out.
The available requirements are:
  • "none" (default) — no actions require sign-in.
  • "save" — requires sign-in to save an item. Only the customer’s own save is gated: an item saved automatically when a cart line is removed still saves, and the drawer stays open to guests. The header button and <swish-drawer> count read as empty for a signed-out customer, since they can’t save yet. swish.state.itemCount() still reports any items they have saved, so a badge you build from it shows them.
  • "view" — requires sign-in for every view: intent, so nothing a customer taps opens Swish for them — a header button, a #swish link, a view: intent from your own code. Saving from a product page still works, and the header button and <swish-drawer> count those saves.
  • "all" — requires sign-in for every action Swish can gate, including any gated in a later release. Today that is the customer’s own save and every view: intent, so a signed-out customer can neither save nor open Swish, and the header button and <swish-drawer> count read as empty for them. As under "save", an item saved automatically when a cart line is removed still saves, and swish.state.itemCount() still reports it.
The "view" and "all" gates run on intents, which includes the redirect to the classic wishlist page under ui.wishlist.experience: "classic-page". They do not cover a direct visit to that page’s own URL: the page mounts when Swish initializes, with no intent in the path, so a signed-out customer who navigates straight to /apps/wishlist still sees the items they saved. Saving is allowed under "view", so a guest can have items to show there; under "all" only an automatic cart-line save can put one there. The customer returns to the page they started on, with the original intent replayed from the URL, so a gated save of a product completes once they are signed in. The replay travels as query parameters, so it carries the intent’s own values — product, variant, quantity, tags — and nothing else: anything your own code held in memory when the redirect happened is gone by the time they are back.

How it works

Account button

The account button appears in the drawer header. By default, tapping it opens the customer profile view (view:profile intent) where the customer can manage their personal details, notification preferences, and marketing consent. When signed in, the button displays the first letter of the customer’s name. accountButtonUrl on the drawer-header section points the button somewhere else: "shopify" sends customers to your store’s own Shopify account page, and any other value is used as a URL. See Drawer. Note that this covers the header button alone — the footer’s Profile item and the Account link placement are separate controls, and both still open the Swish profile view.

Sign-in callouts

When a customer is signed out, certain views show a sign-in callout prompting them to authenticate. These callouts appear on:
  • The drawer home view
  • The saves view
  • The lists view
  • The orders view
  • The notifications view
  • The profile view
The home, saves and lists views carry it as a sign-in section: it renders above the rest of the view, so a guest’s own saves and lists stay visible below it, hidden: true removes it from that view alone, and options.message sets that view’s own copy. The orders, notifications, and profile views instead render the callout in place of the whole view whenever the customer is signed out, and have no option to suppress it - signing in is the only way past those views.

Empty callout

If the drawer’s empty callout is enabled and the customer has no saved items, a sign-in button is included alongside the shopping prompt when accounts are active.

Storefront context

The app embed provides customer data automatically from Liquid globals. If you need to verify or override context values, see the configuration reference.

Further reading