This package contains helpers, tools and middlewares, which should be useful for integration with moneymade.io oauth feature.
npm install @moneymade/connect
yarn add @moneymade/connect
See examples folder for a complete example
import { MoneymadeConnect } from '@moneymade/connect';
const moneymade = new MoneymadeConnect({
privateKey: 'MONEYMADE_PRIVATE_KEY',
publicKey: 'MONEYMADE_PRIVATE_KEY',
});
app.post(
'/oauth',
moneymade.expressMiddleware(),
(req, res) => {
...hadle user's auth here and collect the request payload be
sent to moneymade server endpoint
},
);
To finish oauth, you must send request to moneymade.io API.
await moneymade.finishOauth({
accessToken, // access token for user
userId, // moneymade userId, received in oauth payload
oauthSignature, // oauth signature, received from moneymade in query string
oauthPayload, // payload, received from moneymade in query string
});