1.0.9 • Published 7 months ago

@vymalo/medusa-printful v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

MedusaJS Printful

Connect your MedusaJS store to Printful

Installation

npm install @vymalo/medusa-printful

or if using yarn

yarn add @vymalo/medusa-printful

Usage

To use this plugin, you should add it into the modules section of your MedusaJS configuration.

modules: [
  ...
  {
    resolve: '@medusajs/medusa/fulfillment',
    options: {
      providers: [
        ...
        {
          resolve: '@vymalo/medusa-printful/printful-fulfillment',
          id: 'printful',
          options: {},
        },
      ],
    },
    dependencies: [PrintfulModules.printful],
  },
  {
    resolve: '@vymalo/medusa-printful/printful',
    options: {
      enableWebhooks: true,
      printfulAccessToken: process.env.PRINTFUL_ACCESS_TOKEN,
      storeId: process.env.PRINTFUL_STORE_ID,
      logo_url: process.env.PRINTFUL_LOGO_URL,
      backendUrl: process.env.PRINTFUL_BACKEND_URL,
      confirmOrder: false,
    },
    dependencies: [
      Modules.PRODUCT,
      Modules.FULFILLMENT,
      Modules.PRICING,
    ],
  },
...

Hack

Because it's not yet clear how to handle plugins in MedusaJS, we have to hack a bit to get this working. First:

mkdir -p plugins/printful-hack
ln -s node_modules/@vymalo/medusa-printful/dist plugins/printful-hack/src
# Write a fake package.json file in the plugins/printful-hack directory
echo "{\"name\":\"printful-hack\",\"version\":\"1.0.0\"}" > plugins/printful-hack/package.json

In your medusa-config.js file, add the following code:

plugins: [
  ...
  {
    resolve: `./plugins/printful-hack`, // TODO: Change this to the correct path
    options: {},
  },
1.0.9

7 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago