goshippo / shippo-node-client

Shipping API Node.js library (USPS, FedEx, UPS and more)
https://goshippo.com/docs
MIT License
136 stars 54 forks source link

ES6 Imports #49

Closed bzmillerboy closed 5 years ago

bzmillerboy commented 5 years ago

I'm using TS and ES6 imports with the following:

import * as Shippo from 'shippo';
const shippo = new Shippo('<YOUR_PRIVATE_KEY>');

However, I continue to get 400 response with "Invalid credentials". I've triple checked my credentials. Is this this the proper way to import and set the key with ES6.

*Obviously, I've replaced <YOUR_PRIVATE_KEY> with my actual key.

bzmillerboy commented 5 years ago

I've resolved by using this code in my config.ts instead of my helper.ts file.

acomito commented 3 years ago

hmm... I'm getting "Shippo is not a constructor"