Skip to content

Fix privacy banner option types for headless storefronts - #4138

Open
minwookshin wants to merge 1 commit into
Shopify:previewfrom
minwookshin:fix/privacy-banner-options
Open

minwookshin wants to merge 1 commit into
Shopify:previewfrom
minwookshin:fix/privacy-banner-options

Conversation

@minwookshin

Copy link
Copy Markdown

WHY are these changes introduced?

Fixes #4069. Headless storefronts need to pass their public Storefront API token and root domains when reopening the privacy banner, but the current types reject those options.

WHAT is this pull request doing?

Allow the banner options on showBanner() and showPreferences(), preserving no-argument calls. Document the explicit headless configuration in the packaged analytics guide and add compile-time coverage for both methods.

HOW to test your changes?

  • pnpm --filter @shopify/hydrogen typecheck
  • pnpm --filter @shopify/hydrogen test:types --maxWorkers=2 --minWorkers=1 — 142 files, 2,342 tests pass; no type errors.
  • pnpm --filter @shopify/hydrogen libcheck
  • Root format and lint hooks pass.

The new type tests reject the valid option calls before the change. The built declarations also expose the options. This changes types and guidance only; no live storefront or consent settings were changed.

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or functional changes. Test changes or internal-only config changes do not require a changeset.
  • I've added tests to cover my changes
  • I've added or updated the documentation

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant