Shopify / Shopify/hydrogen

Add first-class <shopify-account> support

Open
#4,005 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.1k
Forks
443
Avg merge
4d 19h
Merged PRs (30d)
24

Description

Context

<shopify-account> is Shopify's Storefront Web Component for a customer-account avatar. When selected, it opens Shopify's account sheet with sign-in options or signed-in customer links. Shopify owns the interactive button, account sheet, authentication UI and client-side shadow DOM.

Hydrogen users currently need to load and integrate the component manually. This work adds first-class support with server-rendered signed-out content and stable layout before the custom element upgrades.

Scope

This parent issue tracks three independently reviewable deliverables:

  1. Add opt-in account widget loading to ShopifyScripts.
  2. Add a framework-neutral SSR-safe renderer and use it in the React Router template.
  3. Add idiomatic React and Vue ShopifyAccountWidget bindings.

Agreed direction

  • Name the ShopifyScripts opt-in accountWidget.
  • Require a signed-out avatar so every integration has an SSR fallback and reserved layout space.
  • Let the framework-neutral renderer accept required trusted avatar HTML. React accepts a required ReactElement; Vue exposes a required named slot.
  • Hydrogen owns the slot="signed-out-avatar" wrapper so consumers cannot misconfigure Shopify's slot protocol.
  • Emit a scoped nonce-bearing <style> that reserves the host and avatar dimensions with var(--shopify-account-avatar-size, 44px).
  • Do not reproduce Shopify's private shadow DOM or use Declarative Shadow DOM.
  • Listen directly on <shopify-account> for its non-bubbling open and close events.

Out of scope

  • Customer Account OAuth, sessions or account pages.
  • Reproducing or styling Shopify's internal account button or sheet.

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by mapping the three deliverables named in the issue: accountWidget loading in ShopifyScripts, the framework-neutral SSR-safe renderer used by the React Router template, and the React and Vue bindings. Review the Shopify account and Shopify store API references first. Done means signed-out SSR content, reserved layout space, opt-in loading, and idiomatic bindings with the stated event behavior, without reproducing Shopify's private UI.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.