# lyrid-js-sdk

> A NPM package that consume Lyrid functions.

Latest version **1.0.2** (published 2020-06-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install lyrid-js-sdk
pnpm add lyrid-js-sdk
yarn add lyrid-js-sdk
bun add lyrid-js-sdk
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-06-24 |
| First published | 2020-06-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 53.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Darian UNG |
| Maintainers | hsutanto |
| Keywords | npm, node, lyrid, javascript |

## Links

- npm: https://www.npmjs.com/package/lyrid-js-sdk
- Repository: https://github.com/LyridInc/js-sdk
- Homepage: https://github.com/LyridInc/js-sdk#readme
- Issues: https://github.com/LyridInc/js-sdk/issues
- npm.io page: https://npm.io/package/lyrid-js-sdk

## Dependencies (1)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2020-06-24

## README

# Lyrid JavaScript SDK
A NPM package that consume [Lyrid](https://lyrid.io/) functions.

## Requirements

To use this SDK, you will need:

- [Node.js **v6.3.0 or above**](https://nodejs.org/)

Node installation will include [NPM](https://www.npmjs.com/), which is
responsible for dependency management.

## Build from code
`npm install`

`npm run-script build`

The resulting outputs are:

.\lib\lyrid.js - For react compatible js build

.\dist\lyrid.js - For running on any javascript engine

## Installation

### Node.js

By default the latest build will be automatically pushed into npm, and user will be able to install and use it as following:

`npm i lyrid-js-sdk-dev`

`import Lyrid from 'lyrid-js-sdk-dev'`

### Use the SDK as single js file

We also deliver our Javascript compatible build into our CDN:

```html
<script src="https://cdn.jsdelivr.net/gh/darian68/lyrid-js-sdk@latest/lyrid.js" type="text/javascript"></script>
```

## Usage

This SDK relies heavily on [Promises](https://developers.google.com/web/fundamentals/getting-started/primers/promises),
making it easier to handle the asynchronous requests made to the API. The SDK
provides a `Lyrid` object containing several methods which map to the
calls and parameters described in
[Lyrid REST API](https://api.lyrid.io/swagger/index.html).

The following snippet is a generic example of how to use the SDK. If you need
details for a specific module, refer to the
[samples](https://github.com/darian68/sdk-react-sample).

Before executing any request, you need to provide key and secret to the API:


#### Create Lyrid object

```js
const lyrid = new Lyrid(<key>, <secret>);
```
You can provide the token also if you alrady have it

```js
const lyrid = new Lyrid(<key>, <secret>, <token>);
```

#### Making requests

```js
    lyrid.execute(<function ID>, <framework>, <input>).then(data =>{
      console.log(data);
    }, () =>{
      console.log("Error on execute function");
    });
```

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