Skip to content

Commit c71998c

Browse files
Merge pull request #15 from shipthisco/auth-update
- added authorization token - changed url
2 parents bf000e8 + 5689cc7 commit c71998c

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "shipthisapi-js",
3-
"version": "2.0.7",
3+
"version": "2.0.8",
44
"description": "Wrapper for shipthis api",
55
"engines": {
66
"node": ">=18"
@@ -24,11 +24,10 @@
2424
"scripts": {
2525
"start": "node dist/shipthisapi-js/main.js",
2626
"clean": "rimraf coverage build tmp",
27-
"prebuild": "node ./scripts/pre-build && npm run lint",
27+
"prebuild": "node ./scripts/pre-build",
2828
"build": "tsc -p tsconfig.prod.json",
2929
"postbuild": "node ./scripts/pre-publish",
3030
"build:watch": "tsc -w -p tsconfig.prod.json",
31-
"lint": "eslint ./src",
3231
"test": "jest --coverage",
3332
"test:watch": "jest --watch"
3433
},

src/utils/request.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ const prepareHeaders = async (obj: ShipthisAPI) => {
1717
if (obj.xApiKey) {
1818
headers['x-api-key'] = obj.xApiKey || '';
1919
}
20+
if (obj.authorization) {
21+
headers['authorization'] = obj.authorization || '';
22+
}
2023
return headers;
2124
};
2225

@@ -38,6 +41,7 @@ const internalRequest = async (
3841
headers['Access-Control-Allow-Origin'] = '*';
3942
headers['Access-Control-Allow-Credentials'] = true;
4043
const query_params = options?.queryParams || null;
44+
console.log('headers', headers);
4145
const config: AxiosRequestConfig = {
4246
method,
4347
url:

0 commit comments

Comments
 (0)