medusa-plugin-printify 0.2.0 → 0.3.0
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 +21 -0
- package/README.md +127 -21
- package/package.json +19 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dawson Blackhouse
|
|
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
CHANGED
|
@@ -1,14 +1,104 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">medusa-plugin-printify</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
Print-on-demand fulfillment for <a href="https://medusajs.com">Medusa v2</a>, powered by <a href="https://printify.com">Printify</a>.
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/medusa-plugin-printify"><img src="https://img.shields.io/npm/v/medusa-plugin-printify.svg" alt="npm version" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/medusa-plugin-printify"><img src="https://img.shields.io/npm/dm/medusa-plugin-printify.svg" alt="npm downloads" /></a>
|
|
10
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" /></a>
|
|
11
|
+
<a href="https://github.com/greedychipmunk/medusa-plugin-printify/actions/workflows/ci.yml"><img src="https://github.com/greedychipmunk/medusa-plugin-printify/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
12
|
+
<a href="https://codecov.io/gh/greedychipmunk/medusa-plugin-printify"><img src="https://codecov.io/gh/greedychipmunk/medusa-plugin-printify/branch/main/graph/badge.svg" alt="coverage" /></a>
|
|
13
|
+
<a href="https://medusajs.com"><img src="https://img.shields.io/badge/Medusa-v2-blueviolet" alt="Medusa v2" /></a>
|
|
14
|
+
<a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-strict-3178C6?logo=typescript&logoColor=white" alt="TypeScript" /></a>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p align="center">
|
|
18
|
+
<a href="#quick-start">Quick start</a> ·
|
|
19
|
+
<a href="#configuration">Configuration</a> ·
|
|
20
|
+
<a href="#api-reference">API</a> ·
|
|
21
|
+
<a href="CHANGELOG.md">Changelog</a> ·
|
|
22
|
+
<a href="CONTRIBUTING.md">Contributing</a>
|
|
23
|
+
</p>
|
|
2
24
|
|
|
3
|
-
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Why this plugin
|
|
28
|
+
|
|
29
|
+
- **Real fulfillment, not just sync.** Automatic order submission, real-time webhook status, and a Medusa Admin widget that surfaces production state on every order page.
|
|
30
|
+
- **Type-safe, tested, CI-driven.** TypeScript strict mode, Jest coverage, and OIDC-signed npm releases driven by conventional-commit PR titles.
|
|
31
|
+
- **Decoupled and unopinionated.** No storefront assumptions; works with any Medusa v2 host application.
|
|
4
32
|
|
|
5
33
|
## Features
|
|
6
34
|
|
|
7
|
-
- **Product sync** — pull your Printify catalog into Medusa on a schedule or on-demand
|
|
8
|
-
- **Order fulfillment** — automatically submit Medusa orders to Printify when they are placed
|
|
9
|
-
- **Webhook handling** —
|
|
10
|
-
- **Admin UI** — manage shops, browse synced products, and monitor order
|
|
11
|
-
- **Webhook auto-registration** — registers all required Printify webhook topics on startup
|
|
35
|
+
- **Product sync** — pull your Printify catalog into Medusa on a schedule or on-demand.
|
|
36
|
+
- **Order fulfillment** — automatically submit Medusa orders to Printify when they are placed.
|
|
37
|
+
- **Webhook handling** — real-time status updates (shipped, in-production, delivered, etc.).
|
|
38
|
+
- **Admin UI** — manage shops, browse synced products, and monitor order status from the Medusa Admin.
|
|
39
|
+
- **Webhook auto-registration** — registers all required Printify webhook topics on startup.
|
|
40
|
+
|
|
41
|
+
## Screenshots
|
|
42
|
+
|
|
43
|
+
| Printify dashboard | Synced products |
|
|
44
|
+
|---|---|
|
|
45
|
+
|  | 
|
|
46
|
+
|
|
47
|
+
| Order widget | Order details |
|
|
48
|
+
|---|---|
|
|
49
|
+
|  |  |
|
|
50
|
+
|
|
51
|
+
## Quick start
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pnpm add medusa-plugin-printify
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Add to `medusa-config.ts`:
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
import { defineConfig } from "@medusajs/framework/utils"
|
|
61
|
+
|
|
62
|
+
export default defineConfig({
|
|
63
|
+
plugins: [
|
|
64
|
+
{
|
|
65
|
+
resolve: "medusa-plugin-printify",
|
|
66
|
+
options: {
|
|
67
|
+
apiKey: process.env.PRINTIFY_API_KEY,
|
|
68
|
+
webhookSecret: process.env.PRINTIFY_WEBHOOK_SECRET,
|
|
69
|
+
shopId: process.env.PRINTIFY_SHOP_ID,
|
|
70
|
+
webhookBaseUrl: process.env.PRINTIFY_WEBHOOK_URL,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
})
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Run migrations:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pnpm medusa db:migrate
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Done. See [Configuration](#configuration) for all options.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Table of contents
|
|
88
|
+
|
|
89
|
+
- [Requirements](#requirements)
|
|
90
|
+
- [Installation](#installation)
|
|
91
|
+
- [Configuration](#configuration)
|
|
92
|
+
- [Local Development](#local-development)
|
|
93
|
+
- [Production Deployment](#production-deployment)
|
|
94
|
+
- [API Reference](#api-reference)
|
|
95
|
+
- [Order Fulfillment Flow](#order-fulfillment-flow)
|
|
96
|
+
- [Admin Dashboard](#admin-dashboard)
|
|
97
|
+
- [Contributing](#contributing)
|
|
98
|
+
- [Security](#security)
|
|
99
|
+
- [License](#license)
|
|
100
|
+
|
|
101
|
+
---
|
|
12
102
|
|
|
13
103
|
## Requirements
|
|
14
104
|
|
|
@@ -32,6 +122,10 @@ pnpm add medusa-plugin-printify
|
|
|
32
122
|
|
|
33
123
|
### 1. Add environment variables
|
|
34
124
|
|
|
125
|
+
```bash
|
|
126
|
+
cp .env.template .env
|
|
127
|
+
```
|
|
128
|
+
|
|
35
129
|
Add the following to your Medusa application's `.env`:
|
|
36
130
|
|
|
37
131
|
```bash
|
|
@@ -103,7 +197,7 @@ This creates the `printify_shop`, `printify_product`, and `printify_order` table
|
|
|
103
197
|
Clone this repository and install dependencies:
|
|
104
198
|
|
|
105
199
|
```bash
|
|
106
|
-
git clone https://github.com/
|
|
200
|
+
git clone https://github.com/greedychipmunk/medusa-plugin-printify
|
|
107
201
|
cd medusa-plugin-printify
|
|
108
202
|
pnpm install
|
|
109
203
|
```
|
|
@@ -171,11 +265,9 @@ pnpm test -- --watch # watch mode
|
|
|
171
265
|
pnpm build
|
|
172
266
|
```
|
|
173
267
|
|
|
174
|
-
### 2. Publish to npm
|
|
268
|
+
### 2. Publish to npm
|
|
175
269
|
|
|
176
|
-
|
|
177
|
-
npm publish
|
|
178
|
-
```
|
|
270
|
+
Releases are handled automatically by `.github/workflows/release.yml` when a PR with a conventional-commit title (`feat:`, `fix:`, or `feat!:`) is merged to `main`. There is no manual `npm publish` step.
|
|
179
271
|
|
|
180
272
|
### 3. Install in your Medusa application
|
|
181
273
|
|
|
@@ -235,12 +327,12 @@ All admin routes require authentication. Storefront routes are public.
|
|
|
235
327
|
|
|
236
328
|
## Order Fulfillment Flow
|
|
237
329
|
|
|
238
|
-
1. A customer places an order in your Medusa storefront
|
|
239
|
-
2. The `order.placed` subscriber detects any line items with `metadata.printify_product_id
|
|
240
|
-
3. A Printify order is created and submitted to production automatically
|
|
241
|
-
4. Printify sends webhook events as the order moves through production and shipping
|
|
242
|
-
5. The plugin updates the local Printify order record and emits Medusa events for each status change
|
|
243
|
-
6. The Printify order widget on the Medusa Admin order detail page reflects the current status
|
|
330
|
+
1. A customer places an order in your Medusa storefront.
|
|
331
|
+
2. The `order.placed` subscriber detects any line items with `metadata.printify_product_id`.
|
|
332
|
+
3. A Printify order is created and submitted to production automatically.
|
|
333
|
+
4. Printify sends webhook events as the order moves through production and shipping.
|
|
334
|
+
5. The plugin updates the local Printify order record and emits Medusa events for each status change.
|
|
335
|
+
6. The Printify order widget on the Medusa Admin order detail page reflects the current status.
|
|
244
336
|
|
|
245
337
|
---
|
|
246
338
|
|
|
@@ -248,6 +340,20 @@ All admin routes require authentication. Storefront routes are public.
|
|
|
248
340
|
|
|
249
341
|
The plugin adds two pages and one widget to the Medusa Admin:
|
|
250
342
|
|
|
251
|
-
- **Printify** (sidebar) — lists synced shops with a one-click sync button
|
|
252
|
-
- **Printify › Products** — browse all synced products with search and a sync button
|
|
253
|
-
- **Order detail widget** — appears below the order details on any order page, showing the linked Printify order status and a manual submit button for pending orders
|
|
343
|
+
- **Printify** (sidebar) — lists synced shops with a one-click sync button.
|
|
344
|
+
- **Printify › Products** — browse all synced products with search and a sync button.
|
|
345
|
+
- **Order detail widget** — appears below the order details on any order page, showing the linked Printify order status and a manual submit button for pending orders.
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## Contributing
|
|
350
|
+
|
|
351
|
+
PRs welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for setup. PR titles must follow [Conventional Commits](https://www.conventionalcommits.org/) — the release workflow uses them to bump versions automatically.
|
|
352
|
+
|
|
353
|
+
## Security
|
|
354
|
+
|
|
355
|
+
See [SECURITY.md](SECURITY.md) for how to report vulnerabilities.
|
|
356
|
+
|
|
357
|
+
## License
|
|
358
|
+
|
|
359
|
+
Licensed under the [MIT License](https://github.com/greedychipmunk/medusa-plugin-printify/blob/main/LICENSE).
|
package/package.json
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "medusa-plugin-printify",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Printify print-on-demand integration plugin for Medusa v2",
|
|
5
|
-
"author": "
|
|
5
|
+
"author": "Dawson Blackhouse",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/greedychipmunk/medusa-plugin-printify#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/greedychipmunk/medusa-plugin-printify.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/greedychipmunk/medusa-plugin-printify/issues"
|
|
14
|
+
},
|
|
7
15
|
"files": [
|
|
8
16
|
".medusa/server"
|
|
9
17
|
],
|
|
@@ -22,10 +30,16 @@
|
|
|
22
30
|
},
|
|
23
31
|
"keywords": [
|
|
24
32
|
"medusa",
|
|
25
|
-
"
|
|
26
|
-
"medusa-plugin-other",
|
|
33
|
+
"medusa-v2",
|
|
27
34
|
"medusa-plugin",
|
|
28
|
-
"medusa-
|
|
35
|
+
"medusa-plugin-other",
|
|
36
|
+
"printify",
|
|
37
|
+
"print-on-demand",
|
|
38
|
+
"pod",
|
|
39
|
+
"dropshipping",
|
|
40
|
+
"ecommerce",
|
|
41
|
+
"fulfillment",
|
|
42
|
+
"webhooks"
|
|
29
43
|
],
|
|
30
44
|
"devDependencies": {
|
|
31
45
|
"@medusajs/admin-sdk": "2.13.1",
|
|
@@ -70,9 +84,6 @@
|
|
|
70
84
|
"build": "medusa plugin:build",
|
|
71
85
|
"dev": "medusa plugin:develop",
|
|
72
86
|
"publish:npm": "pnpm publish --access public --no-git-checks",
|
|
73
|
-
"release:patch": "pnpm version patch && pnpm publish --access public && git push --follow-tags",
|
|
74
|
-
"release:minor": "pnpm version minor && pnpm publish --access public && git push --follow-tags",
|
|
75
|
-
"release:major": "pnpm version major && pnpm publish --access public && git push --follow-tags",
|
|
76
87
|
"test": "jest",
|
|
77
88
|
"test:watch": "jest --watch",
|
|
78
89
|
"test:coverage": "jest --coverage"
|