Skip to content

Add typed JSON output to store authentication - #8443

Merged
gonzaloriestra merged 3 commits into
gonzalo/json-store-inspectionfrom
gonzalo/json-store-authentication
Sep 21, 2026
Merged

gonzaloriestra merged 3 commits into
gonzalo/json-store-inspectionfrom
gonzalo/json-store-authentication

Conversation

@gonzaloriestra

@gonzaloriestra gonzaloriestra commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Fixes shop/issues-develop#23685.

Scripts need discoverable JSON contracts for store authentication and saved sessions.

WHAT is this pull request doing?

Shares session and associated-user schemas between auth, auth-list, and stored session summaries. The existing auth presenter validates JSON output; the hidden Stripe auth command shares the auth schema and retains its signup handoff protections.

The stack’s single minor changeset is included in #8585.

Example output

Illustrative sample data. Text excerpts omit terminal decoration and progress. JSON blocks show the final stdout result; progress and diagnostics go to stderr.

shopify store auth --store shop.myshopify.com --scopes read_products

Text

Logged in.
Authenticated as merchant@example.com against shop.myshopify.com.

To verify that authentication worked, run:
shopify store execute --store shop.myshopify.com --query 'query { shop { name id } }'

JSON (--json)

{
  "store": "shop.myshopify.com",
  "userId": "42",
  "scopes": [
    "read_products"
  ],
  "acquiredAt": "2026-09-18T10:00:00.000Z",
  "expiresAt": "2026-09-19T10:00:00.000Z",
  "hasRefreshToken": true,
  "associatedUser": {
    "id": 42,
    "email": "merchant@example.com"
  }
}

shopify store auth list

Text

Subdomain  Connected
shop       Sep 18, 2026

JSON (--json)

{
  "sessions": [
    {
      "subdomain": "shop",
      "connected": "Sep 18, 2026",
      "store": "shop.myshopify.com",
      "userId": "42",
      "scopes": [
        "read_products"
      ],
      "acquiredAt": "2026-09-18T10:00:00.000Z",
      "expiresAt": "2026-09-19T10:00:00.000Z",
      "associatedUser": {
        "id": 42,
        "email": "merchant@example.com"
      }
    }
  ]
}

The hidden store stripe-auth command uses the same auth result schema.

How to manually test your changes?

shopify store auth --json-schema
shopify store auth list --json-schema
shopify store auth --store shop.myshopify.com --scopes read_products
shopify store auth --store shop.myshopify.com --scopes read_products --json
shopify store auth list
shopify store auth list --json

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type and added a changeset.

@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-store-authentication branch from f66ac84 to 4c1a341 Compare August 31, 2026 12:55
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-store-authentication branch from 4c1a341 to ba07f32 Compare August 31, 2026 13:00
@github-actions github-actions Bot added no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. and removed Area: @shopify/cli @shopify/cli package issues labels Aug 31, 2026
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-store-authentication branch 2 times, most recently from 267fb08 to 7c7046b Compare August 31, 2026 14:08
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-store-authentication branch 2 times, most recently from 9cb28ad to 93044b6 Compare August 31, 2026 14:45
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-store-authentication branch from 93044b6 to 5622a43 Compare August 31, 2026 14:57
Comment thread packages/store/src/cli/commands/store/auth.ts
Comment thread packages/store/src/cli/services/store/auth/result.test.ts Outdated
Comment thread packages/store/src/cli/commands/store/stripe-auth.ts Outdated
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-store-authentication branch from 5622a43 to f93c4f2 Compare September 10, 2026 11:00
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-store-authentication branch from f93c4f2 to 93e60e3 Compare September 10, 2026 11:13
@gonzaloriestra
gonzaloriestra removed this pull request from stack #8440 September 16, 2026 11:16
@gonzaloriestra
gonzaloriestra added this pull request to stack #8564 September 16, 2026 11:17
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-store-authentication branch from a4517a2 to 1927c48 Compare September 16, 2026 15:02
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-store-authentication branch 2 times, most recently from 062acb1 to 934dd9a Compare September 17, 2026 13:35
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-store-authentication branch from 934dd9a to 418f64b Compare September 17, 2026 14:19
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-store-authentication branch from 418f64b to c89ab4d Compare September 17, 2026 14:35
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-store-authentication branch from c89ab4d to 16cb862 Compare September 17, 2026 14:38
@gonzaloriestra
gonzaloriestra marked this pull request as ready for review September 17, 2026 15:07
@gonzaloriestra
gonzaloriestra requested review from a team as code owners September 17, 2026 15:07
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-store-authentication branch from 16cb862 to 70c6329 Compare September 18, 2026 11:15
@gonzaloriestra
gonzaloriestra force-pushed the gonzalo/json-store-authentication branch from 70c6329 to 614b134 Compare September 18, 2026 11:44
@gonzaloriestra
gonzaloriestra added this pull request to the merge queue Sep 21, 2026
Merged via the queue into main with commit f5860d2 Sep 21, 2026
28 of 30 checks passed
@gonzaloriestra
gonzaloriestra deleted the gonzalo/json-store-authentication branch September 21, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants