Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

ES6 Imports Don't Work #81

Open
osseonews opened this issue May 18, 2022 · 1 comment
Open

ES6 Imports Don't Work #81

osseonews opened this issue May 18, 2022 · 1 comment

Comments

@osseonews
Copy link

We are able to successfully use Require to use this library, but using imports doesn't work, and unfortunately our current set up requires imports.

Whenever we import, we get 400 response with "Invalid credentials". We know our credential are fine, as we use them daily in another app which uses require. how do you use this library with Imports?

Our code:

import * as Shippo from 'shippo'
const shippo = new Shippo.default('YOURSHIPPOID');
@macder
Copy link

macder commented Jun 8, 2022

This works for me

import shippo from "shippo"

shippo(SHIPPO_API_KEY).carrieraccount.list().then(r => console.log(r))

OR

import shippo from "shippo"

const client = shippo(SHIPPO_API_KEY)
client.carrieraccount.list().then(r => console.log(r))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants