Skip to content

Commit f02d079

Browse files
authored
fix: Use new Printful auth header format (#82)
BREAKING CHANGE: Migrate Printful API token to new format. See: https://help.printful.com/hc/en-us/articles/4632388335260-What-should-I-know-about-API-key-to-API-token-migration
1 parent 99b86f9 commit f02d079

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

gatsby-source-printful/lib/printful.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
const fetch = require('isomorphic-unfetch')
22

3-
const { base64Encode } = require('./utils')
4-
53
class PrintfulClient {
64
constructor({ apiKey }) {
75
this.printfulApiKey = apiKey
@@ -13,7 +11,7 @@ class PrintfulClient {
1311
const response = await fetch(uri, {
1412
method,
1513
headers: {
16-
Authorization: `Basic ${base64Encode(this.printfulApiKey)}`
14+
Authorization: `Bearer ${this.printfulApiKey}`
1715
}
1816
})
1917

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
exports.base64Encode = (string) => Buffer.from(string).toString('base64')
2-
31
exports.parseNameForSlug = (name) => name.replace(/[\s-]+/g, '-').toLowerCase()
42

53
exports.parsePriceString = (price) => parseFloat(price)

0 commit comments

Comments
 (0)