Skip to content

Commit 16d95d3

Browse files
authored
Merge pull request #210 from nuxt-modules/feat/customer-account-api
feat: customer account api support
2 parents 2da5ce3 + 5c9c2b8 commit 16d95d3

68 files changed

Lines changed: 1913 additions & 330 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy-template.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ env:
66
NUXT_SHOPIFY_CLIENTS_STOREFRONT_API_VERSION: ${{ secrets.NUXT_SHOPIFY_CLIENTS_STOREFRONT_API_VERSION }}
77
NUXT_SHOPIFY_CLIENTS_STOREFRONT_PUBLIC_ACCESS_TOKEN: ${{ secrets.NUXT_SHOPIFY_CLIENTS_STOREFRONT_PUBLIC_ACCESS_TOKEN }}
88

9+
NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_API_VERSION: ${{ secrets.NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_API_VERSION }}
10+
NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_CLIENT_ID: ${{ secrets.NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_CLIENT_ID }}
11+
NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_CLIENT_SECRET: ${{ secrets.NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_CLIENT_SECRET }}
12+
913
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
1014
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
1115

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ env:
1010
NUXT_SHOPIFY_CLIENTS_ADMIN_CLIENT_ID: ${{ secrets.NUXT_SHOPIFY_CLIENTS_ADMIN_CLIENT_ID }}
1111
NUXT_SHOPIFY_CLIENTS_ADMIN_CLIENT_SECRET: ${{ secrets.NUXT_SHOPIFY_CLIENTS_ADMIN_CLIENT_SECRET }}
1212

13+
NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_API_VERSION: ${{ secrets.NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_API_VERSION }}
14+
NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_CLIENT_ID: ${{ secrets.NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_CLIENT_ID }}
15+
NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_CLIENT_SECRET: ${{ secrets.NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_CLIENT_SECRET }}
16+
1317
on:
1418
release:
1519
types: [published]

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ env:
1010
NUXT_SHOPIFY_CLIENTS_ADMIN_CLIENT_ID: ${{ secrets.NUXT_SHOPIFY_CLIENTS_ADMIN_CLIENT_ID }}
1111
NUXT_SHOPIFY_CLIENTS_ADMIN_CLIENT_SECRET: ${{ secrets.NUXT_SHOPIFY_CLIENTS_ADMIN_CLIENT_SECRET }}
1212

13+
NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_API_VERSION: ${{ secrets.NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_API_VERSION }}
14+
NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_CLIENT_ID: ${{ secrets.NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_CLIENT_ID }}
15+
NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_CLIENT_SECRET: ${{ secrets.NUXT_SHOPIFY_CLIENTS_CUSTOMER_ACCOUNT_CLIENT_SECRET }}
16+
1317
on:
1418
pull_request:
1519
push:

README.md

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,20 @@
88
[![NPM last update][npm-last-update-src]][npm-last-update-href]
99
[![License][license-src]][license-href]
1010

11-
Fully typed fetch client for the [Shopify Storefront API](https://shopify.dev/docs/api/storefront) and
12-
the [Shopify Admin API](https://shopify.dev/docs/api/admin-graphql).
11+
Fully typed fetch client for the [Shopify Storefront API](https://shopify.dev/docs/api/storefront), [Shopify Admin API](https://shopify.dev/docs/api/admin-graphql) and [Shopify Customer Account API](https://shopify.dev/docs/api/customer).
1312
You can use it on the server and client side, with built-in support for [mock.shop](https://mock.shop) and automatic,
1413
hot-reloaded type generation from your GraphQL queries.
1514

16-
- 🛍️ [Store Template](https://github.com/nuxt-modules/shopify/tree/main/template)
1715
- 📚 [Documentation](https://shopify.nuxtjs.org)
16+
- 🛍️ [Store Template](https://github.com/nuxt-modules/shopify/tree/main/template)
1817
-[Release Notes](https://github.com/nuxt-modules/shopify/tree/main/CHANGELOG.md)
1918

20-
## ⚡️ Features
19+
## Features
2120

2221
- 🔗 Fully typed fetch client from GraphQL schemas
2322
- 🔥 Hot-reloads types automatically when your GraphQL changes
2423
- 🔐 Secure access token handling
25-
- 🛒 Storefront and Admin API support
24+
- 🛒 Storefront, Customer Account and Admin API support
2625
- 🌐 Server & client side support
2726
- 🛠️ Automatic mock.shop integration
2827
- 🚩 Error handling optimized for Nuxt
@@ -40,11 +39,12 @@ hot-reloaded type generation from your GraphQL queries.
4039

4140
Upcoming features and developments for the 1.0.0 release:
4241

43-
- 👤 Customer Account API support
4442
- 🔍 Shopify Analytics support
4543

4644
## 📦 Setup
4745

46+
> To get started immediately, you can use the [store template](https://github.com/nuxt-modules/shopify/tree/main/template) with a pre-configured Shopify store and module setup.
47+
4848
Run the following command to install the module in your project:
4949

5050
```bash
@@ -76,7 +76,8 @@ Add your Shopify configuration to the `nuxt.config.ts`:
7676
```ts
7777
export default defineNuxtConfig({
7878
shopify: {
79-
name: "quickstart-abcd1234",
79+
name: "my-shopify-store",
80+
8081
clients: {
8182
storefront: {
8283
apiVersion: "2026-01",
@@ -88,20 +89,26 @@ export default defineNuxtConfig({
8889
clientId: "YOUR_APP_CLIENT_ID",
8990
clientSecret: "YOUR_APP_CLIENT_SECRET",
9091
},
92+
93+
customerAccount: {
94+
apiVersion: "2026-01",
95+
clientId: "YOUR_CLIENT_ID",
96+
},
9197
},
9298
},
9399
})
94100
```
95101

96-
## 🛠️ Usage
102+
> To find the configuration values for your store, check out the [setup guide](https://shopify.nuxtjs.org/essentials/setup-shopify).
103+
104+
## Usage
97105

98106
### Access Storefront API on the client side
99107

100108
There are multiple ways of communicating with the Shopify APIs.
101109
The easiest way is with the `useStorefront` composable, directly inside of your vue component or page.
102110

103-
> To access the `useStorefront` composable on the client side, make sure you have added a public access token.
104-
> You can add it in the module config: `clients > storefront > publicAccessToken`
111+
> To access the `useStorefront` composable on the client side, make sure you have added a public access token. You can add it in the module config: `clients > storefront > publicAccessToken`
105112
106113
```html
107114
<!-- ~/pages/your-page.vue -->
@@ -439,14 +446,14 @@ npx @nuxtjs/shopify@latest webhooks subscribe
439446
To receive webhooks with Shopify's HMAC validation the module introduces `defineWebhookEventHandler`, which automatically
440447
validates any incoming request against the app client secret.
441448

442-
Read more about webhooks in our [webhooks documentation](https://shopify.nuxtjs.org/essentials/webhooks).
449+
Read more about webhooks in our [webhooks documentation](https://shopify.nuxtjs.org/going-further/webhooks).
443450

444-
## 👥 Maintainers
451+
## Maintainers
445452

446453
- Frederik Bußmann ([@freb97](https://github.com/freb97))
447454
- Zoltan Lukacs ([@konkonam](https://github.com/konkonam))
448455

449-
## 🤝 Contributing
456+
## Contributing
450457

451458
1. Clone this repository
452459
2. Create a `.env` file (see [`.env.example`](https://github.com/nuxt-modules/shopify/tree/main/.env.example))
@@ -460,7 +467,7 @@ Read more about webhooks in our [webhooks documentation](https://shopify.nuxtjs.
460467
bun run dev
461468
```
462469

463-
## 📜 License
470+
## License
464471

465472
Published under the [MIT License](https://github.com/nuxt-modules/shopify/tree/main/LICENSE).
466473

build.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,9 @@ export default defineBuildConfig({
1717
replace: {
1818
'await setupDevMode(nuxt, logger)': '',
1919
},
20+
21+
externals: [
22+
'@shopify/hydrogen',
23+
'nuxt-auth-utils',
24+
],
2025
})

0 commit comments

Comments
 (0)