open-index/open-npm huggingface dataset:
npm package: @inetsoft/api-client
Description: JavaScript client for the InetSoft web API.
Author: InetSoft Technology
Latest version: 1.0.0

# InetSoft API Client

This library provides a client for the InetSoft web API.

[![Build Status](https://travis-ci.com/inetsoft-technology/api-client-js.svg?branch=master)](https://travis-ci.com/inetsoft-technology/api-client-js)
[![Coverage Status](https://coveralls.io/repos/github/inetsoft-technology/api-client-js/badge.svg?branch=master)](https://coveralls.io/github/inetsoft-technology/api-client-js?branch=master)
[![Known Vulnerabilities](https://snyk.io/test/github/inetsoft-technology/api-client-js/badge.svg)](https://snyk.io/test/github/inetsoft-technology/api-client.js)

## Installation

```bash
$ npm install @inetsoft/api-client
```

By default, the library uses the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)
for communicating with the web service. If you require compatibility with older
browsers, you will need to include a Fetch polyfill, such as [this one](https://github.com/github/fetch).
If you are using the client from Node.js, you will need to add the
[node-fetch](https://www.npmjs.com/package/node-fetch) package to your project.

Alternatively, you can implement `HttpAdapter` and use any HTTP client implementation
you want. You can then pass an instance of your adapter to the `createApiClient()`
call.

## Usage

You create an instance of the API client by calling the `createApiClient()` function,
as shown below.

```js
var client = createApiClient('http://localhost:8080/sree', 'apiAccount', 'password');
client.report.getReports().then(addReports);

function addReports(reports) {
   // do something with the reports
}
```

Note that when using in a web page, the page must be served from the same domain as
the InetSoft application or you must add the appropriate
[CORS HTTP headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS).

Using in TypeScript is similar, as shown in the following example.

```typescript
import { createApiClient } from '@inetsoft/api-client';

const client = crateApiClient('http://localhost:8080/sree', 'apiAccount', 'password');
client.report.getReports().then(reports => {
   reports.forEach(report => {
      // do something with the report
   });
});
```

Further information on the client APIs can be found in the
[API documentation](https://inetsoft-technology.github.io/api-client-js/).

## Version Compatibility

The following table lists the compatibility between versions of this library
and the InetSoft product version.

| API Version | Product Version |
| ----------- | --------------- |
| 1.0.0       | 2019            |

## License

The InetSoft JavaScript API Client library is licensed under the Apache License 2.0.