@epilot/entity-client
Version:
JavaScript client library for the epilot Core Entity API
31 lines (20 loc) • 1.2 kB
Markdown
# @epilot/entity-client
[](https://github.com/epilot-dev/sdk-js/actions?query=workflow%3ACI)
[](https://www.npmjs.com/package/@epilot/entity-client)
[](https://bundlephobia.com/package/@epilot/entity-client)
[](https://github.com/epilot-dev/sdk-js/blob/main/LICENSE)
Client library for epilot [Entity API](https://docs.epilot.io/api/entity)
Uses [`openapi-client-axios`](https://github.com/openapistack/openapi-client-axios)
## Installation
```bash
npm install --save @epilot/entity-client
```
## Usage
```typescript
import { getClient } from '@epilot/entity-client';
const entityClient = getClient();
const createResponse = await entityClient.createEntity({ slug: 'contact' }, { first_name: 'Example', last_name: 'Entity' });
const getResponse = await entityClient.getEntity({ slug: 'contact', id: createResponse.data._id });
```
## Documentation
https://docs.epilot.io/docs/entities/entity-api