# ipushpull Integration

Canonical page: https://www.adaptabletools.com/docs/integrations-ipushpull

- The ipushpull integration connects AdapTable with [ipushpull](https://www.ipushpull.com) - a powerful collaborative software tool
- Users are able to send Reports to ipushpull and from there to Symphony and other destinations
- These can be either System Reports shipped by AdapTable or bespoke Custom Reports created by users

This plugin enables AdapTable's ipushpull partnership - used for integrating Adaptable with [ipushpull](https://www.ipushpull.com).  

It includes a dedicated ipushpull toolbar which allows data to be sent from AdapTable (either snapshot or live updates) to an ipushpull page, and other collaborative scenarios.

This is a one-way transmission only; data is sent from AdapTable to ipushpull and not in the other direction

## Fostering Collaboration

The ipushpull integration empowers collaboration.

It enables data in Adaptable and AG Grid easily to be shared by multiple users across various systems including Symphony and Bloomberg.

ipushpull is available as an <b>Adaptable plugin</b> meaning that by default it is not included in AdapTable

### ipushpull Reports

Data is exported from AdapTable to ipushpull via ipushpull Reports.

An ipushpull Report contains 3 properties:
-  **ReportName**: the name of the [Report](https://www.adaptabletools.com/docs/handbook-exporting/index.md#reports) being exported to ipushpull
-  **Folder**: the ipushpull folder containing the page where the exported data is shown
-  **Page**: the ipushpull page which will show the exported data

## Installing ipushpull

npm install @adaptabletools/adaptable-plugin-ipushpull

If [using CommonJS](https://www.adaptabletools.com/docs/getting-started-installation/index.md#esm-and-cjs-formats), then install `@adaptabletools/adaptable-plugin-ipushpull-cjs` instead

## Configuring ipushpull

### How to set up ipushpull

These are the steps required:

Add the `ipp` section to the [plugins](https://www.adaptabletools.com/docs/technical-reference-plugins/index.md) property in [Adaptable Options](https://www.adaptabletools.com/docs/technical-reference-adaptable-options/index.md).

Add 2 important properties:

- `username` - your ipushpull username
- `password` - your ipushpull password

Optional properties are available regarding throttling and whether AdapTable's System Reports can be exported.

```ts {3,4,5}
const adaptableOptions: AdaptableOptions = {
   plugins: [
      ipp({
        username: process.env.IPUSHPULL_USERNAME,
        password: process.env.IPUSHPULL_PASSWORD,
        throttleTime: 5000,
        includeSystemReports: true,
        ippConfig: {
         // see below
       },
     }),
   ],
};
``` 

See [ipushpull Plugin Options](https://www.adaptabletools.com/docs/technical-reference-ipushpull/index.md) for full details of these properties

The `ippConfig` property is an object which contains configuration details for ipushpull.

Most of these properties should be given the same values as in the example. 

However 2 properties require bespoke values to be supplied by each user:

- `api_secret`
- `api_key`

ipushpull should have provided these to you

```ts {8,9,10,11,12,13,14,15,16,17}
const adaptableOptions: AdaptableOptions = {
   plugins: [
      ipp({
        username: process.env.IPUSHPULL_USERNAME,
        password: process.env.IPUSHPULL_PASSWORD,
        throttleTime: 5000,
        includeSystemReports: true,
        ippConfig: {
           api_secret: process.env.IPUSHPULL_API_KEY,
           api_key: process.env.IPUSHPULL_API_KEY,
           api_url: 'https://www.ipushpull.com/api/1.0',
           ws_url: 'https://www.ipushpull.com',
           web_url: 'https://www.ipushpull.com',
           docs_url: 'https://docs.ipushpull.com',
           storage_prefix: 'ipp_local',
           transport: 'polling',
           hsts: false, // strict cors policy
       },
     }),
   ],
};
``` 

The [ipushpull API](https://www.adaptabletools.com/docs/integrations-ipushpull/index.md) section of AdapTable contains many functions for run-time access to the ipushull integration.

It is retrieved via the `pluginsAPI` section of AdapTable Api.

```ts {2}
  // use plugins api to retrieve the iPushPull Api 
  const ipushpullApi = adaptableApi.pluginsApi.getipushpullPluginApi()
``` 

### ipushpull Config

There is **no** ipushpull Adaptable State that can be supplied by developers at design-time.

All ipushpull-related state is transient and per-session only and not persisted.

However [ipushpull Plugin Options](https://www.adaptabletools.com/docs/technical-reference-ipushpull/index.md) does provide optional configuration settings for running the ipushpull Plugin.

## Using ipushpull

Run-time integration with ipushpull is done via a dedicated ipushpull [Toolbar](https://www.adaptabletools.com/docs/ui-dashboard/index.md#tabs-and-toolbars).

At start-up this toolbar simply displays a login button that, when clicked, opens a login screen asking for username and password.

There is a `AutoLogin` property option which will automatically log the user in to ipushpull (provided that the correct credentials have been provided in [ipushpull Plugin Options](https://www.adaptabletools.com/docs/technical-reference-ipushpull/index.md)).

Once the user is successfully logged in, the Toolbar will contain a number of elements, including:

#### Dropdowns

- *Reports Dropdown*: shows all the Reports that have been created via the [Export Module](https://www.adaptabletools.com/docs/handbook-exporting/index.md)
      

This dropdown will also include any System Reports that AdapTable ships by default (e.g. Selected Cells); however these can be removed by setting `IncludeSystemReports` to false

  
- *Folders Dropdown*: lists all the folders (aka 'Domains') to which the user has access in ipushpull
- *Pages Dropdown*: lists all the ipushpull pages in the currently selected Folder (in the Folders Dropdown)
#### Buttons
- *Send Snapshot* - runs the current report and send the data to the currently selected ipushpull page.  This is a **one-off** action.
- *Run Live Report* - runs the current report sending the data to the currently selected ipushpull page; also sends live updates so ipushpull is updated in real time, inline with ticking grid data and report updates.
  

The button displays a 'Play' icon, but when a Live Report is running this changes to a 'Pause' icon.

- *New ipushpull Page* - alllows a new ipushpull page to be created in the folder of the user's choice.
- *Logout* - logs the User out of ipushpull (and displays the login button).
### UI Entitlements
ipushpull is only available to runtime users if:
1. the `AccessLevel` for its Entitlement is set to **Full**
2. the plugin was injected into  [Adaptable Options](https://www.adaptabletools.com/docs/technical-reference-adaptable-options/index.md)

The `ReadOnly` Accesslevel Entitlement behaviour is identical to `Hidden`.

### FAQ

**Do we need to be an existing ipushpull User to use this?**
Yes. We provide this functionality only for existing ipushpull users.
You will need to provide your username and password in the Login Control.

**How do I provide my ipushpull Credentials?**
As part of [ipushpull Plugin Options](https://www.adaptabletools.com/docs/technical-reference-ipushpull/index.md).

**Can I create a new ipushpull page in AdapTable?**
Yes, you can. This functionality was added in Version 6 (January, 2020).
