@elizaos/plugin-shopify 2.0.0-beta.1 → 2.0.3-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shaw Walters and elizaOS Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # @elizaos/plugin-shopify
2
+
3
+ Shopify Admin API plugin for elizaOS. Gives an Eliza agent the ability to manage products, orders, inventory, and customers on a Shopify store through conversational commands.
4
+
5
+ ## What it does
6
+
7
+ When this plugin is active, an Eliza agent can:
8
+
9
+ - **Search** — read-only cross-entity search across products, orders, and customers.
10
+ - **Manage products** — list products (with optional query), create new products (DRAFT or ACTIVE), update title / description / status.
11
+ - **Manage inventory** — check stock levels per location, adjust inventory quantities, list store locations.
12
+ - **Manage orders** — list orders (with optional filter), get a single order by number, fulfill open orders.
13
+ - **Manage customers** — list or search customers, view customer detail.
14
+
15
+ Write operations (create product, update product, adjust inventory, fulfill order) ask the user for explicit confirmation before executing.
16
+
17
+ ## Installation
18
+
19
+ Add the plugin to your agent's character file:
20
+
21
+ ```json
22
+ {
23
+ "plugins": ["@elizaos/plugin-shopify"]
24
+ }
25
+ ```
26
+
27
+ The plugin self-enables when `SHOPIFY_ACCESS_TOKEN` or `SHOPIFY_ACCOUNTS` is set in the agent's environment. No explicit opt-in is required when either variable is present.
28
+
29
+ ## Configuration
30
+
31
+ ### Minimum required
32
+
33
+ | Variable | Description |
34
+ |---|---|
35
+ | `SHOPIFY_STORE_DOMAIN` | Your store domain, e.g. `mystore.myshopify.com` |
36
+ | `SHOPIFY_ACCESS_TOKEN` | Shopify Admin API access token from a private or custom app |
37
+
38
+ ### Shopify API scopes needed
39
+
40
+ Your access token must have at minimum:
41
+
42
+ ```
43
+ read_products, write_products, read_orders, write_orders,
44
+ read_customers, read_inventory, write_inventory, read_locations
45
+ ```
46
+
47
+ ### Multi-store support
48
+
49
+ To connect more than one store, set `SHOPIFY_ACCOUNTS` to a JSON array of account records:
50
+
51
+ ```json
52
+ [
53
+ { "accountId": "store-a", "storeDomain": "store-a.myshopify.com", "accessToken": "shpat_..." },
54
+ { "accountId": "store-b", "storeDomain": "store-b.myshopify.com", "accessToken": "shpat_..." }
55
+ ]
56
+ ```
57
+
58
+ Set `SHOPIFY_DEFAULT_ACCOUNT_ID` to the `accountId` that should be used when none is specified in a request. Accounts can also be declared under `character.settings.shopify.accounts` in the character file.
59
+
60
+ ### OAuth flow (optional)
61
+
62
+ If you want users to connect stores through an OAuth flow rather than a static access token, set:
63
+
64
+ | Variable | Description |
65
+ |---|---|
66
+ | `SHOPIFY_OAUTH_CLIENT_ID` | Client ID from your Shopify app |
67
+ | `SHOPIFY_OAUTH_CLIENT_SECRET` | Client secret from your Shopify app |
68
+ | `SHOPIFY_OAUTH_REDIRECT_URI` | Redirect URI registered in your Shopify app settings |
69
+
70
+ ## Usage examples
71
+
72
+ ```
73
+ Show me my Shopify orders from this week
74
+ Search my store for "blue hat"
75
+ List all active products
76
+ Create a new product: red t-shirt, $25, vendor Acme
77
+ Adjust inventory for blue hat by -3 units
78
+ Fulfill order #1042
79
+ Find customer jane@example.com
80
+ ```
81
+
82
+ The agent infers the operation from natural language. You can also be explicit:
83
+
84
+ ```
85
+ Shopify action=products action=list
86
+ Shopify action=inventory action=check productQuery="blue hat"
87
+ ```
88
+
89
+ ## Context requirements
90
+
91
+ The `SHOPIFY` action is available in agent contexts: `payments`, `connectors`, `automation`, `knowledge`. The store context provider activates in `connectors` and `finance` contexts. Ensure your agent character has at least one of these contexts enabled.
package/package.json CHANGED
@@ -1,31 +1,48 @@
1
1
  {
2
2
  "name": "@elizaos/plugin-shopify",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.3-beta.3",
4
4
  "description": "Shopify Admin API plugin for elizaOS agents -- manage products, orders, inventory, and customers.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
+ "eliza-source": {
11
+ "types": "./src/index.ts",
12
+ "import": "./src/index.ts",
13
+ "default": "./src/index.ts"
14
+ },
10
15
  "import": "./dist/index.js"
11
16
  },
12
- "./package.json": "./package.json"
17
+ "./package.json": "./package.json",
18
+ "./*.css": "./dist/*.css",
19
+ "./*": {
20
+ "types": "./dist/*.d.ts",
21
+ "eliza-source": {
22
+ "types": "./src/*.ts",
23
+ "import": "./src/*.ts",
24
+ "default": "./src/*.ts"
25
+ },
26
+ "import": "./dist/*.js",
27
+ "default": "./dist/*.js"
28
+ }
13
29
  },
14
30
  "files": [
15
31
  "dist"
16
32
  ],
17
33
  "scripts": {
18
- "build": "tsdown",
19
- "dev": "tsdown --watch",
34
+ "build": "tsup --config tsup.config.ts",
35
+ "dev": "tsup --config tsup.config.ts --watch",
20
36
  "test": "vitest run",
21
37
  "test:e2e": "node ../../packages/app-core/scripts/run-local-plugin-live-smoke.mjs",
22
38
  "test:live": "bun run test:e2e"
23
39
  },
24
40
  "dependencies": {
25
- "@elizaos/core": "2.0.0-beta.1"
41
+ "@elizaos/core": "2.0.3-beta.3"
26
42
  },
27
43
  "devDependencies": {
28
- "tsdown": "^0.21.10",
44
+ "tsup": "^8.5.1",
45
+ "typescript": "^6.0.3",
29
46
  "vitest": "^4.0.0"
30
47
  },
31
48
  "agentConfig": {
@@ -47,5 +64,6 @@
47
64
  },
48
65
  "publishConfig": {
49
66
  "access": "public"
50
- }
67
+ },
68
+ "gitHead": "f54b0f4eaed317d59fa7dbcdce20f4cdb0734420"
51
69
  }
package/dist/index.d.ts DELETED
@@ -1,213 +0,0 @@
1
- import { ConnectorAccountProvider, IAgentRuntime, Plugin, Service } from "@elizaos/core";
2
-
3
- //#region src/types.d.ts
4
- /**
5
- * Configuration for connecting to a Shopify store via the Admin GraphQL API.
6
- */
7
- interface ShopifyPluginConfig {
8
- /** Shopify store domain, e.g. "mystore.myshopify.com" */
9
- storeDomain?: string;
10
- /** Shopify Admin API access token */
11
- accessToken?: string;
12
- /** Optional default account id for multi-account config */
13
- accountId?: string;
14
- /** Optional per-store account records keyed by account id */
15
- accounts?: Record<string, {
16
- storeDomain?: string;
17
- accessToken?: string;
18
- label?: string;
19
- }>;
20
- }
21
- interface ShopInfo {
22
- name: string;
23
- email: string;
24
- myshopifyDomain: string;
25
- plan: {
26
- displayName: string;
27
- };
28
- currencyCode: string;
29
- primaryDomain: {
30
- url: string;
31
- };
32
- }
33
- interface MoneyV2 {
34
- amount: string;
35
- currencyCode: string;
36
- }
37
- interface ShopifyImage {
38
- url: string;
39
- altText: string | null;
40
- }
41
- interface ProductVariant {
42
- id: string;
43
- title: string;
44
- price: string;
45
- sku: string | null;
46
- inventoryQuantity: number | null;
47
- }
48
- interface ProductVariantEdge {
49
- node: ProductVariant;
50
- }
51
- interface Product {
52
- id: string;
53
- title: string;
54
- handle: string;
55
- status: string;
56
- descriptionHtml: string;
57
- productType: string;
58
- vendor: string;
59
- totalInventory: number | null;
60
- featuredImage: ShopifyImage | null;
61
- variants: {
62
- edges: ProductVariantEdge[];
63
- };
64
- }
65
- interface OrderLineItem {
66
- title: string;
67
- quantity: number;
68
- originalUnitPriceSet: {
69
- shopMoney: MoneyV2;
70
- };
71
- }
72
- interface OrderLineItemEdge {
73
- node: OrderLineItem;
74
- }
75
- interface Order {
76
- id: string;
77
- name: string;
78
- createdAt: string;
79
- displayFinancialStatus: string | null;
80
- displayFulfillmentStatus: string;
81
- totalPriceSet: {
82
- shopMoney: MoneyV2;
83
- };
84
- customer: {
85
- id: string;
86
- displayName: string;
87
- } | null;
88
- lineItems: {
89
- edges: OrderLineItemEdge[];
90
- };
91
- }
92
- interface Customer {
93
- id: string;
94
- displayName: string;
95
- email: string | null;
96
- phone: string | null;
97
- ordersCount: string;
98
- totalSpentV2: MoneyV2;
99
- createdAt: string;
100
- }
101
- interface InventoryLevel {
102
- id: string;
103
- available: number | null;
104
- location: {
105
- id: string;
106
- name: string;
107
- };
108
- }
109
- interface Location {
110
- id: string;
111
- name: string;
112
- isActive: boolean;
113
- }
114
- //#endregion
115
- //#region src/services/ShopifyService.d.ts
116
- declare class ShopifyService extends Service {
117
- static serviceType: "shopify";
118
- capabilityDescription: string;
119
- private clients;
120
- private defaultAccountId;
121
- constructor(runtime?: IAgentRuntime);
122
- stop(): Promise<void>;
123
- static start(runtime: IAgentRuntime): Promise<ShopifyService>;
124
- isConnected(accountId?: string): boolean;
125
- private getClientState;
126
- private requireClient;
127
- getShop(accountId?: string): Promise<ShopInfo>;
128
- listProducts(opts?: {
129
- first?: number;
130
- after?: string | null;
131
- query?: string | null;
132
- }, accountId?: string): Promise<{
133
- products: Product[];
134
- hasNextPage: boolean;
135
- endCursor: string | null;
136
- }>;
137
- createProduct(input: {
138
- title: string;
139
- descriptionHtml?: string;
140
- productType?: string;
141
- vendor?: string;
142
- status?: string;
143
- }, accountId?: string): Promise<Product>;
144
- updateProduct(id: string, input: {
145
- title?: string;
146
- descriptionHtml?: string;
147
- productType?: string;
148
- vendor?: string;
149
- status?: string;
150
- }, accountId?: string): Promise<Product>;
151
- listOrders(opts?: {
152
- first?: number;
153
- after?: string | null;
154
- query?: string | null;
155
- }, accountId?: string): Promise<{
156
- orders: Order[];
157
- hasNextPage: boolean;
158
- endCursor: string | null;
159
- }>;
160
- getOrder(id: string, accountId?: string): Promise<Order | null>;
161
- fulfillOrder(orderId: string, accountId?: string): Promise<{
162
- id: string;
163
- status: string;
164
- }>;
165
- listCustomers(opts?: {
166
- first?: number;
167
- after?: string | null;
168
- query?: string | null;
169
- }, accountId?: string): Promise<{
170
- customers: Customer[];
171
- hasNextPage: boolean;
172
- endCursor: string | null;
173
- }>;
174
- checkInventory(inventoryItemId: string, accountId?: string): Promise<InventoryLevel[]>;
175
- adjustInventory(opts: {
176
- inventoryItemId: string;
177
- locationId: string;
178
- delta: number;
179
- reason?: string;
180
- }, accountId?: string): Promise<void>;
181
- listLocations(accountId?: string): Promise<Location[]>;
182
- getProductCount(accountId?: string): Promise<number>;
183
- getOrderCount(accountId?: string): Promise<number>;
184
- }
185
- //#endregion
186
- //#region src/accounts.d.ts
187
- declare const DEFAULT_SHOPIFY_ACCOUNT_ID = "default";
188
- declare const DEFAULT_SHOPIFY_ACCOUNT_ROLE = "OWNER";
189
- interface ShopifyAccountConfig {
190
- accountId: string;
191
- role: typeof DEFAULT_SHOPIFY_ACCOUNT_ROLE;
192
- storeDomain: string;
193
- accessToken: string;
194
- label?: string;
195
- }
196
- declare function normalizeShopifyAccountId(value: unknown): string;
197
- declare function resolveShopifyAccountId(runtime: IAgentRuntime, options?: Record<string, unknown>): string;
198
- declare function readShopifyAccounts(runtime: IAgentRuntime): ShopifyAccountConfig[];
199
- declare function resolveShopifyAccount(accounts: readonly ShopifyAccountConfig[], accountId: string): ShopifyAccountConfig | null;
200
- declare function resolveShopifyDefaultAccount(accounts: readonly ShopifyAccountConfig[], accountId?: string): ShopifyAccountConfig | null;
201
- declare function hasShopifyAccountConfig(runtime: IAgentRuntime, options?: Record<string, unknown>): boolean;
202
- //#endregion
203
- //#region src/connector-account-provider.d.ts
204
- /**
205
- * Build the Shopify ConnectorAccountManager provider.
206
- */
207
- declare function createShopifyConnectorAccountProvider(runtime: IAgentRuntime): ConnectorAccountProvider;
208
- //#endregion
209
- //#region src/index.d.ts
210
- declare const shopifyPlugin: Plugin;
211
- //#endregion
212
- export { DEFAULT_SHOPIFY_ACCOUNT_ID, DEFAULT_SHOPIFY_ACCOUNT_ROLE, ShopifyAccountConfig, type ShopifyPluginConfig, ShopifyService, createShopifyConnectorAccountProvider, shopifyPlugin as default, hasShopifyAccountConfig, normalizeShopifyAccountId, readShopifyAccounts, resolveShopifyAccount, resolveShopifyAccountId, resolveShopifyDefaultAccount };
213
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/services/ShopifyService.ts","../src/accounts.ts","../src/connector-account-provider.ts","../src/index.ts"],"mappings":";;;;;;UAGiB,mBAAA;EAAmB;EAElC,WAAA;EAMiB;EAJjB,WAAA;EAAA;EAEA,SAAA;EAEA;EAAA,QAAA,GAAW,MAAA;IAGP,WAAA;IACA,WAAA;IACA,KAAA;EAAA;AAAA;AAAA,UASW,QAAA;EACf,IAAA;EACA,KAAA;EACA,eAAA;EACA,IAAA;IAAQ,WAAA;EAAA;EACR,YAAA;EACA,aAAA;IAAiB,GAAA;EAAA;AAAA;AAAA,UAWF,OAAA;EACf,MAAA;EACA,YAAA;AAAA;AAAA,UAOe,YAAA;EACf,GAAA;EACA,OAAA;AAAA;AAAA,UAOe,cAAA;EACf,EAAA;EACA,KAAA;EACA,KAAA;EACA,GAAA;EACA,iBAAA;AAAA;AAAA,UAGe,kBAAA;EACf,IAAA,EAAM,cAAA;AAAA;AAAA,UAGS,OAAA;EACf,EAAA;EACA,KAAA;EACA,MAAA;EACA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