# JavaScript/Node.js Client

You can find the official ilert JS client on our Github organization: <https://github.com/iLert/ilert-js>

Install as usual with NPM `npm install ilert`

```javascript
const { ILert } = require("ilert");
const ilert = new ILert();

// creating a new event
const { data } = await ilert.event().create(
    "il1api0460d849fcdc753d4f",
    ILert.EVENT_TYPES.ALERT,
    "My test incident summary",
    { incidentKey: "123456" } // optional
);

// resolving a pending incident
await ilert.incident(45678).resolve();

// ping a heartbeat
await ilert.heartbeat("il1hbt0460d849fcdc753").ping();
```

The ilert JS client also ships with Typescript definitions.

Please feel free to [reach out to us ](https://github.com/iLert/docs/blob/master/developer-docs/contact.md)with a Github issue in case you need help or have feature requests.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ilert.com/developer-docs/client-libraries/javascript-node.js-client.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
