These docs are for v2.5. Click to read the latest docs for v3.0.
improved

Node.js Library allows access tokens to be passed in

๐Ÿ“˜

Requires @mft/[email protected] and later

Previously, when making requests to query a user's financial data, we request to get an access token on your behalf for the given user. This meant that if you wished to query a user's data from our One Time Use use case, you wouldn't be able to without using your own request library.

Now, you can pass in your own access token to requests (from any use case) so that we don't make token requests that may not be needed. The access token can be provided in methods by way of an optional extra argument that will be an object type, and can have the following values:

{
  token: "full.access.token" // if specified will be added to authorisation header of request
  headers: {
    Authorization: "Bearer full.access.token" // can be used to specify authorisation header or additional headers
  }
}

For example, if you wished to get a one time use case user's accounts, you would call:

const queryParams = { limit: 10, offset: 5 , showTransacionData: false, showPerformanceScore: true};
const accounts = await moneyhub.getAccounts({
  params: queryParams,
}, {
  token: "your-access-token-here",
})