# client-help-node

> Node.js / ES2017 client sdk for service-help microservice

Latest version **1.1.0** (published 2022-12-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install client-help-node
pnpm add client-help-node
yarn add client-help-node
bun add client-help-node
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2022-12-21 |
| First published | 2022-05-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14.0.0 |
| Dependencies | 5 |
| Unpacked size | 129.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Conceptual Vision Consulting LLC |
| Maintainers | pipdeveloper |
| Keywords | pip.services, help, microservice, client, sdk |

## Links

- npm: https://www.npmjs.com/package/client-help-node
- Repository: https://github.com/pip-services-content2/client-help-node
- Homepage: https://github.com/pip-services-content2/client-help-node#readme
- Issues: https://github.com/pip-services-content2/client-help-node/issues
- npm.io page: https://npm.io/package/client-help-node

## Dependencies (5)

- [service-help-node](https://npm.io/package/service-help-node.md) ^1.0.*
- [pip-services3-aws-nodex](https://npm.io/package/pip-services3-aws-nodex.md) ^1.1.*
- [pip-services3-rpc-nodex](https://npm.io/package/pip-services3-rpc-nodex.md) ^1.2.*
- [pip-services3-commons-nodex](https://npm.io/package/pip-services3-commons-nodex.md) ^1.0.*
- [pip-services3-components-nodex](https://npm.io/package/pip-services3-components-nodex.md) ^1.4.*

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2022-12-21
- 1.0.0 — 2022-05-13

## README

# Help Microservice Client SDK for Node.js / ES2017

This is a Node.js client SDK for [service-help](https://github.com/pip-services-content2/service-help-node) microservice.
It provides an easy to use abstraction over communication protocols:

* HTTP client
* AWS Lambda client
* Direct client

<a name="links"></a> Quick Links:

* [Development Help](doc/Development.md)
* [API Version 1](doc/NodeClientApiV1.md)

## Install

TODO: Rewrite documentation!

Add dependency to the client SDK into **package.json** file of your project
```javascript
{
    ...
    "dependencies": {
        ....
        "client-help-node": "^1.0.*",
        ...
    }
}
```

Then install the dependency using **npm** tool
```bash
# Install new dependencies
npm install

# Update already installed dependencies
npm update
```

## Use

Inside your code get the reference to the client SDK
```javascript
let sdk = new require('client-help-node');
```

Define client configuration parameters that match configuration of the microservice external API
```javascript
// Client configuration
let config = {
    connection: {
        protocol: 'http',
        host: 'localhost', 
        port: 8080
    }
};
```

Instantiate the client and open connection to the microservice
```javascript
// Create the client instance
let client = sdk.HelpHttpClientV1(config);

// Connect to the microservice
try {
    await client.open(null);
    // Work with the microservice
    ...
} catch(err) {
    console.error('Connection to the microservice failed');
    console.error(err);
}
```

Now the client is ready to perform operations
```javascript
// Create a new help
let help = await client.createHelp(
    null,
    { 
        type: 'introduction',
        app: 'Test App 1',
        pages: [
            { 
                title: { en: 'Welcome to Test App 1' } 
            }
        ]
    }
);
```

```javascript
// Get a random intro help for app1
let help = await client.getRandomHelp(
    null,
    {
        type: 'introduction',
        app: 'app1'
    }
);
```    

## Acknowledgements

This client SDK was created and currently maintained by *Sergey Seroukhov*.

---
_Source: https://npm.io/package/client-help-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
