# @aweber/zendesk-requests

> Front end client for zendesk

Latest version **2.0.0** (published 2023-08-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @aweber/zendesk-requests
pnpm add @aweber/zendesk-requests
yarn add @aweber/zendesk-requests
bun add @aweber/zendesk-requests
```

## 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 | 2.0.0 |
| Published | 2023-08-10 |
| First published | 2018-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | AWeber Communications |
| Maintainers | adamgruber, davegomez, awebercom |
| Keywords | zendesk, frontend, client |

## Links

- npm: https://www.npmjs.com/package/@aweber/zendesk-requests
- Repository: https://github.com/aweber/zendesk-requests
- Homepage: https://github.com/aweber/zendesk-requests#readme
- Issues: https://github.com/aweber/zendesk-requests/issues
- npm.io page: https://npm.io/package/@aweber/zendesk-requests

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2023-08-10
- 1.1.0 — 2021-04-01
- 1.0.1 — 2018-05-17
- 1.0.0 — 2018-05-17

## README

# zendesk-requests

Front end client for zendesk

## Documentation

Quickstart example:

```javascript
import ZendeskRequests, { RequestsError } from '@aweber/zendesk-requests';

const requests = new ZendeskRequests('mysubdomain');
const promise = requests.create({
    requester: {
        name: 'Anonymous'
    },
    subject: 'Request subject',
    comment: {
        body: 'This is the body'
    }
});
promise.catch((e) => {
    if(e instanceof RequestsError &&
            e.status === 422 &&
            e.json.error === 'RecordInvalid') {
        // Handle validation error
    } else {
        throw e;
    }
});
```

## API

### new RequestsClient(subdomain)
Creates a client for the front end.


| Param | Type | Description |
| --- | --- | --- |
| subdomain | <code>string</code> | the subdomain for your account |

<a name="RequestsClient.create"></a>

### RequestsClient.create(request) ⇒ <code>Promise.&lt;Object, Error&gt;</code>
Creates an anonymous Zendesk request.

**Returns**: <code>Promise.&lt;Object, Error&gt;</code> - the zendesk request that was created is
                                  resolved by the promise, else it throws a <a href="#RequestsError">RequestsError</a>

| Param | Type | Description |
| --- | --- | --- |
| request | <code>Object</code> | request object as documented in                  <a href="https://developer.zendesk.com/rest_api/docs/core/requests#create-request">                 zendesk</a> |


### RequestsError

<a name="RequestsError"></a>

Thrown when a non-successful HTTP status was returned.

| Key | Description |
| --- | ----------- |
| message | Response body text |
| status | HTTP status code |
| json | Response body as JSON, or null if not valid JSON |

---
_Source: https://npm.io/package/@aweber/zendesk-requests · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
