Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guicaulada/jshelix
Typescript Helix API
https://github.com/guicaulada/jshelix
Last synced: 14 days ago
JSON representation
Typescript Helix API
- Host: GitHub
- URL: https://github.com/guicaulada/jshelix
- Owner: guicaulada
- License: gpl-3.0
- Created: 2019-01-13T23:20:17.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T19:49:18.000Z (almost 2 years ago)
- Last Synced: 2024-12-17T05:53:09.707Z (19 days ago)
- Language: TypeScript
- Homepage:
- Size: 2.16 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jsHelix
[npm-url]: https://npmjs.org/package/jshelix
[npm-image]: https://img.shields.io/npm/v/jshelix.svg
[pipeline-image]: https://github.com/Sighmir/jsHelix/workflows/CI/CD/badge.svg
[pipeline-url]: https://github.com/Sighmir/jsHelix/actions?query=workflow%3ACI%2FCD
[coverage-image]: https://codecov.io/gh/Sighmir/jsHelix/graph/badge.svg
[coverage-url]: https://codecov.io/gh/Sighmir/jsHelix
[quality-image]: https://sonarcloud.io/api/project_badges/measure?project=jsHelix&metric=alert_status
[quality-url]: https://sonarcloud.io/dashboard?id=jsHelix
[depstat-url]: https://david-dm.org/Sighmir/jsHelix
[depstat-image]: https://david-dm.org/Sighmir/jsHelix/status.svg
[devdepstat-url]: https://david-dm.org/Sighmir/jsHelix?type=dev
[devdepstat-image]: https://david-dm.org/Sighmir/jsHelix/dev-status.svg[![NPM version][npm-image]][npm-url]
[![Pipeline Status][pipeline-image]][pipeline-url]
[![Coverage Status][coverage-image]][coverage-url]
[![Sonarcloud Status][quality-image]][quality-url]
[![Dependency Status][depstat-image]][depstat-url]
[![Dev Dependency Status][devdepstat-image]][devdepstat-url]**jsHelix** is a Typescript wrapper to the [Twitch Helix API](https://dev.twitch.tv/docs/api/reference/).
## Requirements
- Tested against New Twitch API (Helix)
- For Node.js you will need the [xmlhttprequest](https://www.npmjs.com/package/xmlhttprequest) library.
- A Twitch token, get yours here: https://twitchtokengenerator.com## Documentation
### Getting Started
If you are using Node.js, install jsHelix using npm:
```bash
$ npm install jshelix
```You can now require and use jshelix like so:
```ts
import jsHelix from "jshelix";const TWITCH_CLIENT = process.env.TWITCH_CLIENT;
const TWITCH_TOKEN = process.env.TWITCH_TOKEN;const hapi = jsHelix(TWITCH_CLIENT!, TWITCH_TOKEN);
hapi
.getUsers({ login: "Sighmir" })
.then((users) => {
hapi
.getUserFollows({ from_id: users.data![0].id })
.then((data) => {
console.log(data);
})
.catch((err) => console.log(err));
})
.catch((err) => console.log(err));
```Refer to the [Helix API Documentation](https://dev.twitch.tv/docs/api/reference/) and the [jsHelix Example](https://github.com/Sighmir/jsHelix/tree/master/example) for more information.
### Browser
You can also load this script on your browser like so:
```html
```
You can now use jsHelix normally on the page, like you would on Node.js.
## License
```
jsHelix - Helix API Javascript Library.
Copyright (C) 2019 Guilherme Caulada (Sighmir)This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program. If not, see .
```