> ## Documentation Index
> Fetch the complete documentation index at: https://swish.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Account

> Enable customer sign-in and account access within the Swish drawer.

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.

## Account link

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](https://swish.app/docs/guides/customize/views/drawer.md#account-button-destination).

```js theme={null}
window.SwishOptions = {
  ui: {
    drawer: {
      sections: [
        {
          type: "drawer-header",
          options: { accountButton: false },
        },
        {
          type: "drawer-footer",
          options: {
            items: [
              { id: "home", enabled: true },
              { id: "saves", enabled: true },
              { id: "notifications", enabled: true },
              { id: "orders", enabled: true },
              { id: "profile", enabled: false },
            ],
          },
        },
      ],
    },
    home: {
      sections: [
        { type: "sign-in", hidden: true },
        { type: "saved-items" },
        { type: "lists" },
      ],
    },
    saves: {
      sections: [
        { type: "sign-in", hidden: true },
        { type: "lists-section", options: { display: "myLists" } },
        { type: "lists-section", options: { display: "forYouLists" } },
        { type: "all-items-grid" },
      ],
    },
    lists: {
      sections: [
        { type: "sign-in", hidden: true },
        { type: "lists-grid" },
      ],
    },
  },
};
```

See the [Drawer](https://swish.app/docs/guides/customize/views/drawer.md), [Home](https://swish.app/docs/guides/customize/views/home.md), [Saves](https://swish.app/docs/guides/customize/views/saves.md) and [Lists](https://swish.app/docs/guides/customize/views/lists.md) 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.

```js theme={null}
createSwish({
  features: {
    signInRequirement: "save",
  },
});
```

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](https://swish.app/docs/guides/customize/views/drawer.md#account-button-destination). 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](https://swish.app/docs/guides/customize/views/saves.md) and [lists](https://swish.app/docs/guides/customize/views/lists.md) 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](https://swish.app/docs/references/sdk/configuration.md#context).

## Further reading

* [Intents](https://swish.app/docs/guides/customize/intents.md) for intent behavior settings
* [Configuration reference](https://swish.app/docs/references/sdk/configuration.md) for the complete options list
* [Headless auth proxy](https://swish.app/docs/guides/headless/auth-proxy.md) for custom authentication setups


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.