@accounter-toolkit/green-invoice-graphql
Version:
Graphql proxy for Green Invoice API
18 lines (17 loc) • 591 B
JavaScript
import { getMeshSDK } from './mesh-artifacts/index.js';
export const init = async (id, secret) => {
const authParams = {
id,
secret,
};
const greenInvoiceToken = await fetch('https://api.greeninvoice.co.il/api/v1/account/token', {
method: 'POST',
body: JSON.stringify(authParams),
headers: { 'Content-Type': 'application/json' },
})
.then(res => res.json())
.then((res) => res.token);
const sdk = await getMeshSDK({ authToken: greenInvoiceToken });
return { sdk };
};
export * from './mesh-artifacts/index.js';