Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@vymalo/medusa-printful

vymalo95MIT1.0.10TypeScript support: included

Connect your MedusaJS store to Printful

medusa, medusajs, medusa-printful, printful

readme

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: {},
  },