# liquid-node-connector

> Node connector for interacting with Liquid serivices.

Latest version **1.0.13** (published 2024-01-14) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install liquid-node-connector
pnpm add liquid-node-connector
yarn add liquid-node-connector
bun add liquid-node-connector
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.13 |
| Published | 2024-01-14 |
| First published | 2023-05-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shrihari Prakash |
| Maintainers | shrihariprakash |

## Links

- npm: https://www.npmjs.com/package/liquid-node-connector
- Repository: https://github.com/shrihari-prakash/liquid-node-connector
- Homepage: https://github.com/shrihari-prakash/liquid-node-connector#readme
- Issues: https://github.com/shrihari-prakash/liquid-node-connector/issues
- npm.io page: https://npm.io/package/liquid-node-connector

## Recent versions

- 1.0.13 (latest) — 2024-01-14
- 1.0.12 — 2024-01-14
- 1.0.11 — 2024-01-14
- 1.0.10 — 2024-01-14
- 1.0.9 — 2024-01-14
- 1.0.8 — 2024-01-14
- 1.0.7 — 2023-12-08
- 1.0.6 — 2023-12-08
- 1.0.5 — 2023-08-02
- 1.0.4 — 2023-08-02
- 1.0.3 — 2023-08-02
- 1.0.2 — 2023-05-29

## README

## Liquid Node Connector

A Node.js connector library to integrate your microservices with [Liquid](https://github.com/shrihari-prakash/liquid) authentication services. This library requires Node version 18 or above.

### Installation

Run `npm i liquid-node-connector`.
### Usage

#### Initialization

```js
import LiquidConnector from "liquid-node-connector";

const liquidConnector = new LiquidConnector({
  host: "host_address_of_your_liquid_instance",
  clientId: "your_liquid_client_id",
  clientSecret: "your_liquid_client_secret",
  scope: "scope1,scope2,scope3",
  // Optional
  cacheOptions: {
    client: RedisClient,
    expire: 300, // 5 minutes
  },
  // Optional
  logger: console, // Or any other logger that has debug, info, warn and error functions.
});
```

#### Authenticate a user connecting to your microservice

```js
const user = await liquidConnector.authenticate(token);
// Now use this user info for the rest of your logic.
```

#### Get access token for accessing client level APIs

```js
const { accessToken } = await liquidConnector.getAccessToken();
// Make APIs calls that requires client authentication.
```

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