Closed BoyPersoon closed 7 years ago
Hi @BoyPersoon,
I encountered the same problem as you, I fixed it by using the following:
import {gateway as MoltinGateway} from 'moltin'
and then:
const Moltin = MoltinGateway({
client_id: 'XXXX',
})
The syntax client_id
is the key ;)
As stated above, client_id
is the correct key to use when instantiating:
import { gateway as MoltinGateway } from '@moltin/sdk';
const Moltin = MoltinGateway({
client_id: 'XXX',
});
I've fixed the documentation, thanks for highlighting the inconsistencies!
I am currently working on a new project I already started using Moltin and manage to get the Authentication working plus a few commands, however I am running into tons of issues! I have added the node: { fs: 'empty' }to the module webpack config file. Let me talk you through the Code I tried using:
normal import as in the git docs doesn't seem to work
so I used:
// MoltinGateway doesn't set the clientId in the config object ???
Great the connection worked! But now the Cart commands just don't exist, except Cart.Get call ?
// not working commands!
From the offical moltin js docs using MoltinClient already seems to fail as it doesn't exist:
I need this library to function correctly! Could anybody tell me one of the following things? -Why wasn't the clientId set in MoltenGateway? -how to access the Cart functions? -Why are both the official docs plus the github docs not leading to a correct import of the Moltin.Gateway module or MoltenClient (official docs)? -Does this have to do with webpack within Create-react-app?
Thank you in advance!