Skip to content

Add appEvents.emit to the Checkout and Customer Account APIs - #4749

Merged
haozhi-liao merged 1 commit into
2027-01-rcfrom
app-events-checkout-customer-account
Oct 22, 2026
Merged

haozhi-liao merged 1 commit into
2027-01-rcfrom
app-events-checkout-customer-account

Conversation

@haozhi-liao

@haozhi-liao haozhi-liao commented Oct 15, 2026 •

Copy link
Copy Markdown

Adds shopify.appEvents.emit(eventHandle, attributes?) to the Checkout standard and address-autocomplete APIs and the Customer Account standard API. emit resolves with {success: true} once the host accepts the event, or {success: false, error} when it was not sent.

Background

App Events let an app record what happens in its UI extensions without a request to the app's backend. Shopify adds the app, shop and extension to each event, and the events show in the app's Dev Dashboard logs next to the events the app sends from its backend with the App Events API.

Host implementations (shop/world, stacked):

Guides on shopify.dev: #2263577 (Checkout) and #2263578 (Customer Account).

Solution

  • New types in checkout/api/standard/standard.ts: AppEvents, AppEventEmitResult, AppEventAttributes and AppEventAttributeValue (string | number | boolean). Customer Account re-exports them from there, as it does SubscribableSignalLike.
  • appEvents is required on Checkout StandardApi, Checkout AddressAutocompleteStandardApi and Customer Account StandardApi, so Customer Account order-status targets get it too. Both hosts always expose it on 2027-01. When the feature is off for a shop, emit resolves with {success: false} instead of the property being missing.
  • {success: true} means the host accepted the event. It may still wait for analytics consent, and it does not confirm delivery. {success: false, error} covers everything the host rejects: invalid handle or attributes, rate limit, buyer data in attributes, and a disabled host such as the checkout editor. emit never rejects.
  • These types match the hosts' own copies: the checkout-web in-repo package in #2267720 and customer-account-web's app-events.ts.
  • @shopify/ui-extensions-tester: the Checkout and Customer Account mocks return {success: true}.

🎩

  • Merged onto 2027-01-rc (ee50e202a) locally: yarn type-check, yarn lint and yarn test pass.
  • Host behavior (validation, consent, limits, drops) is tested in the shop/world PRs above.

Checklist

  • I have 🎩'd these changes
  • I have updated relevant documentation (the guides are separate shop/world PRs, linked above)

@haozhi-liao
haozhi-liao force-pushed the app-events-checkout-customer-account branch from 35c929a to ca123ca Compare October 15, 2026 15:59

@kumar303 kumar303 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions for making the API docs more clear to partners

Comment thread packages/ui-extensions/src/surfaces/checkout/api/standard/standard.ts Outdated
Comment thread packages/ui-extensions/src/surfaces/checkout/api/standard/standard.ts Outdated
Comment thread packages/ui-extensions/src/surfaces/checkout/api/address-autocomplete/standard.ts Outdated

@kumar303 kumar303 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but I think you're waiting until 2027-01-rc exists so you can merge it there, right? In any case, this same patch can be applied there.

@kristianpd
kristianpd changed the base branch from 2026-10-rc to 2027-01-rc October 20, 2026 18:13
@kristianpd
kristianpd marked this pull request as ready for review October 20, 2026 18:55
@kristianpd
kristianpd force-pushed the app-events-checkout-customer-account branch from 44f90e0 to 1b81ba4 Compare October 22, 2026 13:57
Adds shopify.appEvents.emit(eventHandle, attributes?) to the Checkout
standard and address-autocomplete APIs and the Customer Account standard
API. emit resolves with {success: true} once the host accepts the event,
or {success: false, error} when it was not sent.

Also:
- Simplify appEvents API doc wording
- Make appEvents required on the Checkout and Customer Account APIs
- Rename AppEventsApi to AppEvents
- Remove the unused AppEvent type
@haozhi-liao
haozhi-liao force-pushed the app-events-checkout-customer-account branch from 1b81ba4 to 61f1b65 Compare October 22, 2026 14:02
@haozhi-liao
haozhi-liao merged commit 9e37e42 into 2027-01-rc Oct 22, 2026
6 checks passed
@kristianpd

Copy link
Copy Markdown
Contributor

/snapit

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants