Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hawapi/js-sdk
HawAPI SDK for JavaScript/TypeScript
https://github.com/hawapi/js-sdk
api api-sdk docs haw-api hawapi hawapi-js-sdk hawapi-sdk sdk stranger-things-sdk
Last synced: about 2 months ago
JSON representation
HawAPI SDK for JavaScript/TypeScript
- Host: GitHub
- URL: https://github.com/hawapi/js-sdk
- Owner: HawAPI
- License: mit
- Created: 2022-12-27T11:22:54.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-08T20:26:57.000Z (about 1 year ago)
- Last Synced: 2023-12-09T02:41:44.131Z (about 1 year ago)
- Topics: api, api-sdk, docs, haw-api, hawapi, hawapi-js-sdk, hawapi-sdk, sdk, stranger-things-sdk
- Language: TypeScript
- Homepage: https://npmjs.com/package/@hawapi/js-sdk
- Size: 249 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HawAPI - js-sdk
HawAPI SDK for JavaScript/TypeScript
- [API Docs](https://hawapi.theproject.id/docs/)
- [TypeDoc](https://hawapi.github.io/js-sdk/v1/)## Topics
- [Installation](#installation)
- [Npm](#npm)
- [Yarn](#yarn)
- [Cdn](#cdn)
- [Usage](#usage)
- [Init](#init-client)
- [Javascript (UMD)](#javascript-umd)
- [Javascript (ESM)](#javascript-esm)
- [Error handling](#error-handling)
- [Then/Catch](#thencatch)
- [Try/Catch](#trycatch)## Installation
### Npm
```
npm install @hawapi/js-sdk
```### Yarn
```
yarn add @hawapi/js-sdk
```### Cdn
```html
```
## Usage
- [See examples](./examples/)
### Init client
#### Javascript (UMD)
```js
const client = HawAPI.createClient();
// Also valid:
// const { createClient } = HawAPI
// const client = createClient()
console.log('HawAPI client: ', client);
```#### Javascript (ESM)
```js
import { createClient } from '';
const client = createClient();
console.log('HawAPI client: ', client);
```### Error handling
#### Then/Catch
```js
const result = client
.getAll('actors')
.then((data) => data)
.catch((err) => console.error(err));
```#### Try/Catch
```js
let result;
try {
result = await client.getAll('actors');
} catch (err) {
console.error(err);
}
```## Repository template
This repository uses [typescript-library-boilerplate](https://github.com/VitorLuizC/typescript-library-boilerplate) as template.