Skip to content

Latest commit

 

History

History
 
 

ui-widgets-react

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Monite UI Widgets

npm version

A library of ready-to-use React components connected to the Monite API. These components display the data served from the Monite API and also provide data editing functionality.

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

Requirements

Installation

npm install @team-monite/ui-widgets-react --save --force

or

yarn add @team-monite/ui-widgets-react

Usage

Before using Monite UI Widgets, complete the Getting started guide to set up your partner account and get API the credentials.

We also assume you have already mapped out your customers and their users as entities and entity users in Monite, and that you have the ability to:

  • look up the Monite entity user ID for the user who is logged in to your application;
  • look up the Monite entity ID to which the user belongs.

When an entity user logs in to your application, look up the entity ID and user ID for that user, and call Monite's POST /auth/token endpoint to generate a Monite access token for that user.

Once you have a user access token and an entity ID, you can initialize the Monite client and widgets, as shown below.

This example displays a list of an entity's counterparts:

import { MoniteProvider, MoniteApp, CounterpartsTable } from '@team-monite/ui-widgets-react';

const monite = new MoniteApp({
  apiUrl: 'https://api.sandbox.monite.com/v1',  // Or 'https://api.monite.com/v1' to use Production
  entityId: 'ENTITY_ID',  // Monite entity to which the user belongs
  token: 'ACCESS_TOKEN'   // User access token
});

<MoniteProvider monite={monite}>
  <CounterpartsTable />
</MoniteProvider>

The MoniteProvider element serves as a wrapper for other Monite-connected components. Any other components imported from @team-monite/ui-widgets-react must be placed inside this element.

Documentation

License

MIT