@monerium/sdk
Everything you need to interact with the Monerium API - An electronic money issuer.
This package is in development. Please make sure to check if any future updates contain commits that may change the behaviour of your application before you upgrade.
Authentication
import { MoneriumClient } from 'monerium-js';
const client = await MoneriumClient.create();
await client.auth({ email: '<required>', password: '<required>' });
await client
.auth({
client_id: '<required>',
state: '<recommended>',
address: '<optional>',
redirect_uri: '<optional>',
scope: '<optional>'
})
.then(() => {
sessionStorage.setItem('code_verifier', client.codeVerifier);
});
const bearerProfile = await client.auth({
client_id: '<required>',
code: '<required>',
code_verifier: sessionStorage.getItem('code_verifier'),
redirect_uri: '<can be omitted if not set in request>',
scope: '<optional>'
});
client.auth(bearerProfile);
await client.auth({ client_id: '<required>', client_secret: '<required>', scope: '<optional>' });
client.authContext;
client.bearerProfile;
Demo
To check out the demo site for this pacakge, run the following commands:
yarn install
yarn dev
Developing
If you want to make any code contributions, make sure to run the following commands before you pr them:
yarn format
yarn lint
yarn test
Publishing
If you want to modify and publish the package yourself, run the following commands:
yarn package
yarn publish