Skip to content

Commit ca39d90

Browse files
authored
Merge pull request #245 from nuxt-modules/feat/customer-account-refactor
feat: customer account API refactor
2 parents db45072 + b9ea44c commit ca39d90

40 files changed

Lines changed: 1155 additions & 345 deletions

File tree

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ NUXT_SHOPIFY_CLIENTS_STOREFRONT_PRIVATE_ACCESS_TOKEN="YOUR_PRIVATE_ACCESS_TOKEN"
99
# Customer Account API
1010
NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_API_VERSION="2026-01"
1111
NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_CLIENT_ID="YOUR_APP_CLIENT_ID"
12+
NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_CLIENT_SECRET="YOUR_APP_CLIENT_SECRET"
13+
NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_SESSION_PASSWORD="A_RANDOM_32_CHARACTER_OR_LONGER_SECRET"
1214

1315
# Admin API
1416
NUXT_SHOPIFY_CLIENTS_ADMIN_API_VERSION="2026-01"

.git-blame-ignore-revs

Lines changed: 0 additions & 2 deletions
This file was deleted.

build.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ export default defineBuildConfig({
2020

2121
externals: [
2222
'@shopify/hydrogen',
23-
'nuxt-auth-utils',
2423
],
2524
})

bun.lock

Lines changed: 0 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/content/1.getting-started/4.usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export default defineNuxtConfig({
167167
```
168168

169169
::note
170-
Confidential client usage with the `clientSecret` is currently not supported for the Customer Account API.
170+
Both public clients and confidential clients (by also providing a `clientSecret`) are supported for the Customer Account API.
171171
See the [Customer Account API guide](/essentials/customer-account) for more details on how to configure and use the Customer Account API client.
172172
::
173173

docs/content/2.essentials/2.configuration.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ Configure one or more API clients:
230230
Client ID for customer account API requests
231231
:::
232232

233+
:::field{name="clientSecret" type="string"}
234+
Client secret for confidential clients. When set, the OAuth token exchange is authenticated with the secret instead of PKCE - server-side only, optional
235+
:::
236+
233237
:::field{name="scope" type="array"}
234238
OAuth scopes to request during authentication - default: `['openid', 'email', 'customer-account-api:full']`
235239
:::
@@ -242,10 +246,34 @@ Configure one or more API clients:
242246
Logout URL for customer account API authentication - default: `/_auth/customer-account/logout`
243247
:::
244248

249+
:::field{name="sessionURL" type="string"}
250+
Endpoint that exposes the current session to the client - default: `/_auth/customer-account/session`
251+
:::
252+
245253
:::field{name="redirectURL" type="string"}
246254
Redirect URL to navigate to after successful customer account API authentication - default: `/`
247255
:::
248256

257+
:::field{name="logoutRedirectURL" type="string"}
258+
Redirect URL to navigate to after logout. Must be a registered logout URI in your Shopify app - optional
259+
:::
260+
261+
:::field{name="session.password" type="string"}
262+
Password used to encrypt the session cookie (at least 32 characters). Auto-generated in development, required in production - server-side only
263+
:::
264+
265+
:::field{name="session.name" type="string"}
266+
Name of the session cookie - default: `shopify-customer-account`
267+
:::
268+
269+
:::field{name="session.maxAge" type="number"}
270+
Lifetime of the session cookie in seconds - default: `604800` (7 days)
271+
:::
272+
273+
:::field{name="tokenStorage" type="string | object | boolean"}
274+
[unstorage](https://unstorage.unjs.io) mount or driver configuration for the server-side token store. Use a persistent driver (e.g. Redis) in production - default: in-memory
275+
:::
276+
249277
:::field{name="dev.tunnelURL" type="string"}
250278
Tunnel URL for local development with ngrok or similar - optional
251279
:::

0 commit comments

Comments
 (0)