Skip to content

spencerlepine/printful-sdk-js-v2

Repository files navigation

Printful SDK for TypeScript (Node.js)

NPM Version MIT license Project Status: WIP

📢 Printful API 2.0.0 is still in beta (documentation). This SDK will be in development until the official 2.0.0 release (by 2025)

Printful SDK for Node.js. A basic TypeScript wrapper for the Printful REST API (v2). Guidelines and source endpoints can be found here: developers.printful.com.

Getting started

Prerequisites

Installation

# Npm
npm install printful-sdk-js-v2

# Yarn
yarn add printful-sdk-js-v2

# Pnpm
pnpm add printful-sdk-js-v2

Usage

For security purposes, this is intended only for server-side use only

// getCountries.ts

import { PrintfulClient, Country } from 'printful-sdk-js-v2';
// const { PrintfulClient } = require('printful-sdk-js-v2'); // CommonJS

const printful = new PrintfulClient({
  TOKEN: '<PRINTFUL_API_TOKEN>',
});

(async () => {
  const response = await printful.countriesV2.getCountries();
  const countries: Country[] = response.data;
  console.log(countries);
})();

Example Code Open in CodeSandbox

Documentation

View the site here: spencerlepine.github.io/printful-sdk-js-v2

Contributing

Pull requests welcome! If you're interested in contributing to this project, please read the CONTRIBUTING.md file to get started.

Disclaimer

This SDK is a third-party library and is not officially endorsed or maintained by Printful. It is provided "as is" without warranty of any kind. For official information and guidelines on using the Printful API, please refer to the Printful Developer Documentation.

License

MIT