zendesk-messaging-client
Version:
Zendesk messaging API client
48 lines (34 loc) • 1.56 kB
Markdown
# Zendesk messaging Client
[](https://github.com/semantic-release/semantic-release)
[](https://github.com/prettier/prettier)
[Zendesk Messaging](https://www.zendesk.com/service/messaging/) typescript API client.
Missing something? Create [feature request](https://github.com/LarisLab/zendesk-messaging-client/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=)!
Read [documentation 📘](https://larislab.github.io/zendesk-messaging-client/) or [API reference 📕](https://docs.smooch.io/rest/)
## Installation
[](https://www.npmjs.com/package/zendesk-messaging-client)
[](https://www.npmjs.com/package/zendesk-messaging-client)
### Install with NPM/yarn:
```bash
# NPM
npm install zendesk-messaging-client
# Yarn
yarn add zendesk-messaging-client
```
## Usage
```typescript
import { createClient, Sdk } from 'zendesk-messaging-client'
const appId = 'xxx'
const keyId = 'app_xxx'
const secretLey = 'xxxxx'
const client = createClient({
subdomain: 'subdomain', // https://<subdomain>.zendesk.com/sc
auth: `${keyId}:${secretLey}`,
})
const { conversation } = await Sdk.getConversation({
client,
path: {
appId,
conversationId: '685xxx',
},
}).then((v) => v.data)
```