Optional verified customer identity via Shopify customer-account sign-in - #17
Merged
Conversation
codeyogi911
enabled auto-merge (squash)
August 8, 2026 03:39
…t sign-in Anonymous visitors keep the progressive contact flow and knowledge-grounded answers; a customer who signs in with the deployment's Shopify store account gets a verified rail: no contact card, tickets filed under the verified identity, and order questions answered without an order number. - New identity module: discovery-resolved Customer Account API endpoints, authorization-code flow with PKCE for a public client, signed single-use login transactions, HMAC-signed short-lived session cookies, and a bounded customer context read (profile plus five recent orders with status and tracking) validated against the 2026-07 schema. Provider failures are typed 'unavailable'; every sign-in failure path lands back on the portal as anonymous. - /auth/shopify/start, /callback, and /logout routes on the public surface, config-gated by SHOPIFY_CUSTOMER_CLIENT_ID plus the shop domain. - The assistant treats a store-account session as verified contact on file — the card never appears — and gains list_my_orders for signed-in callers. The session cookie re-arrives on every WebSocket reconnect, so verified identity survives connection drops by transport. The signed-in prompt replaces the ask-for-the-number instruction instead of contradicting it. - Sign-in affordance on the assistant homepage; deployment guide section for creating the Customer Account API client. - Coverage: identity module unit tests, auth route tests, agent tests for the verified session and tampered tokens, and a real-model eval case for the signed-in order flow (passes; the pre-existing unfamiliar-product how-to case remains the known flaky one). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
codeyogi911
force-pushed
the
feat/shopify-customer-sign-in
branch
from
August 8, 2026 03:41
e2f37e6 to
b8469ef
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #15.
What
Anonymous visitors keep today's experience — knowledge-grounded simple answers, progressive contact card when needed. A customer who signs in with the deployment's Shopify store account gets the verified rail:
list_my_orderstool serves the signed-in caller's five most recent orders (names, status, totals, tracking) so the assistant confirms which order they mean instead of sending them hunting for a number. Explicit numbers still use the existing possession-checkedget_order_status.How
src/identity/shopify-customer.ts: Customer Account API endpoints resolved through the shop's discovery documents; authorization-code flow with PKCE (public client); signed single-use login transactions for the redirect round-trip; HMAC-signed short-lived session cookies (customer-capability secret); bounded customer-context GraphQL validated against the 2026-07 schema. Typedunavailableon any provider failure — raw errors never reach the model./auth/shopify/{start,callback,logout}on the public surface. Every failure path returns the visitor to the portal as anonymous — sign-in never blocks support.SHOPIFY_CUSTOMER_CLIENT_ID(Customer Account API public client) alongside the existing shop domain; setup steps added to the deployment guide. Multipass intentionally not used — it requires Shopify Plus.Validation
npm run checkgreen: 233 tests including the new identity-module suite (PKCE/state/expiry/tamper/projection), auth-route tests, and agent tests for verified sessions and tampered tokens.npm run eval:voice: 13/14 with a new real-model case proving the signed-in flow (list_my_orderscalled, order referenced, no number requested). The one failure is the pre-existing flaky unfamiliar-product case tracked separately.🤖 Generated with Claude Code