2.9.1 • Published 4 months ago

@team-monite/sdk-api v2.9.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

Monite API client for JavaScript

npm version

@team-monite/sdk-api is a library for interacting with the Monite API from JavaScript and TypeScript code.

This library is used internally by Monite UI Widgets to make requests to the Monite API. It can also be used as a standalone API client.

Note: This library is part of a monorepo. See the main README for more information.

Requirements

  • Runtime:
    • Node.js 16 or later.
    • Supported browsers: five latest versions of Chrome, Firefox, Safari, Edge, and Opera.
  • At least 8 GB RAM on each development workstation.
  • A partner account registered with Monite. Follow the Get started with Monite API guide to set up your partner account, get API credentials, and generate an access token.

Installation

npm install @team-monite/sdk-api --save --force

or

yarn add @team-monite/sdk-api

Usage

Example to get a list of an entity's counterparts:

import { MoniteSDK } from '@team-monite/sdk-api';

const monite = new MoniteSDK({
  /** Or 'https://api.monite.com/v1' to use Production */
  apiUrl: 'https://api.sandbox.monite.com/v1',

  /** Entity whose data you want to access */
  entityId: 'ENTITY_ID',

  /** Entity whose data you want to access */
  fetchToken: async () => {
    const response = await fetch('https://api.sandbox.monite.com/v1/token', {
      method: 'POST',
      body: JSON.stringify({
        grand_type: 'entity_user',
        clientId: 'SECRET_CLIENT_ID',
        clientSecret: 'SECRET_CLIENT_SECRET',
        entity_user_id: 'SECRET_ENTITY_USER_ID'
      })
    });

    return response.json();
  },
});

monite.api.counterparts.getList()  // Returns Promise<Response>
  .then(res => {
    console.log(`Number of counterparts: ${res.data.length}`);
  });

Further information

License

MIT

2.9.1

4 months ago

2.9.0

4 months ago

2.8.0-beta.0

8 months ago

3.0.0-alpha.6

8 months ago

2.3.0-beta.0

10 months ago

2.3.0-beta.1

10 months ago

3.0.0-alpha.1

8 months ago

3.0.0-alpha.0

8 months ago

3.0.0-alpha.3

8 months ago

2.6.1

8 months ago

3.0.0-alpha.2

8 months ago

2.6.0

8 months ago

2.8.1

7 months ago

3.0.0-alpha.5

8 months ago

2.8.0

8 months ago

3.0.0-alpha.4

8 months ago

2.3.0-beta.2

10 months ago

2.3.0-beta.3

10 months ago

2.5.0-beta.3

9 months ago

2.5.0-beta.4

9 months ago

2.5.0-beta.5

9 months ago

2.5.0-beta.6

9 months ago

2.5.0-beta.7

9 months ago

2.3.0

10 months ago

2.5.0

9 months ago

2.3.1

10 months ago

2.7.0

8 months ago

2.6.0-beta.0

9 months ago

2.8.3

7 months ago

2.4.0-beta.0

10 months ago

2.8.2

7 months ago

2.4.0-beta.2

9 months ago

2.4.0-beta.1

10 months ago

2.7.0-beta.0

8 months ago

2.2.1

11 months ago

2.2.0

11 months ago

2.1.0

12 months ago

2.0.0

12 months ago

1.2.4

1 year ago

1.2.3

1 year ago

1.4.0

1 year ago

1.2.2

1 year ago

1.3.0

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago

0.0.8

1 year ago

0.0.5

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago