🎮WASD.tv API client

Overview

WASD.tv API client

REST & Chat client for wasd.tv

downloads size

⚠️ ⚠️ ⚠️ This is raw alpha version. Totally untested, without proper error handling ⚠️ ⚠️ ⚠️

Installation

npm i wasdtv
yarn add wasdtv

Usage

Obtaining token

To use REST api you should get token in account setting area

REST requests

Http requests to api endpoints

import { WasdTv } from 'wasdtv'

const wasd = new WasdTv('YOUR_API_TOKEN')

const run = async () => {
  const channel_info = await wasd.getChannelInfo('emeraldgp')
  const chat_messages = await wasd.getStreamChatMessages(1016377, 501)
  const chat_stickers = await wasd.getStreamChatStickers(1015200)
  // ... other rest methods
}

run()

Chat

Connecting to chat socket.io server

import { WasdTv } from 'wasdtv'

const wasd = new WasdTv('YOUR_API_TOKEN')

wasd.joinToChat(1016842, 68523)

wasd.on('event', (ctx) => {
  console.log('event', ctx)
})

wasd.on('subscribe', (ctx) => {
  console.log('subscribe', ctx)
})

wasd.on('connect', () => {
  console.log('connect')
})

wasd.on('viewers', (ctx) => {
  console.log('viewers', ctx)
})

wasd.on('system_message', (ctx) => {
  console.log('system_message', ctx)
})

wasd.on('giftsV1', (ctx) => {
  console.log('giftsV1', ctx)
})

wasd.on('message', (ctx) => {
  console.log('message', ctx)
})

Capturing Stream

Yes! You can capture stream (for example, into file)

import { WasdTv } from 'wasdtv'
import fs from 'fs'

const wasd = new WasdTv('YOUR_API_TOKEN')

// Get stream metadata
wasd.getMediaStreamMetadata(1328329).then((data) => {
  console.log(data)
})

const media = wasd.getMediaStream(1328329)
media.pipe(fs.createWriteStream('video.mp4'))

// Capture 20s of stream and close connection
setTimeout(() => {
  media.end()
}, 20 * 1000)

Warning

Due to the fact that Wasd has almost no adequate api documentation, typing was done by reversing responses. For this reason types can be incorrect and incomplete.

If you notice an error, please make a pull request or at least an issue.

Contributing

Pull requests are welcome. Please use prettier format for your code.

License

Distributed under the MIT License.

You might also like...

It shows how to escape cross-origin issues for web client and API server using CloudFront routing.

It shows how to escape cross-origin issues for web client and API server using CloudFront routing.

AWS CloudFront의 URL Routing을 이용한 Web Client 및 API Server 구현 여기서는 CliendFront의 URL Routing을 이용하여 Web Client와 API Server를 구현하고자 합니다. Web Client는 Amazon

Nov 20, 2022

Lightweight universal Cloudflare API client library for Node.js, Browser, and CF Workers

Cloudflare API Client Lightweight universal HTTP client for Cloudflare API based on Fetch API that works in Node.js, browser, and CF Workers environme

Nov 13, 2022

Simple and intuitive API Client made into a VSCode extension 😊

Simple and intuitive API Client made into a VSCode extension 😊

REST API Client Simple and intuitive API Client made into a VSCode extension. Visual Studio Marketplace • Repository • Releases Visual Studio Code ext

Dec 23, 2022

Improved Deno port of GramJS — a MTProto API Telegram client library.

Warning Considered as unstable. But, most of the commonly used features are working as expected. Grm Grm is an improved Deno port of GramJS, written i

Dec 31, 2022

MTProto API Client for Deno 🦕

Grm MTProto client for Deno ported from GramJS. Documentation Currently, there is no documentation dedicated to Grm. You can use the GramJS documentat

Dec 17, 2022

RPC-like client, contract, and server implementation for a pure REST API

RPC-like client, contract, and server implementation for a pure REST API

ts-rest RPC-like client and server helpers for a magical end to end typed experience Introduction ts-rest provides an RPC-like client side interface o

Dec 30, 2022

A Weather API project inspired by The Ultimate API Challenge / Weather API.

Weather API Project A Weather API project inspired by The Ultimate API Challenge / Weather API. Tech Stack: React.js Tailwind Axios Inspiration The Pr

Dec 29, 2021

This project is built with JavaScript, Webpack, HTML & CSS, Leaderboard api. When user clicks on Refresh button it hits the api and responds with the data, The user can also post data to the api

This project is built with JavaScript, Webpack, HTML & CSS, Leaderboard api. When user clicks on Refresh button it hits the api and responds with the data, The user can also post data to the api

leaderboad Description the project. this project is about the leaderboad i did during Microverse to build a website for adding Data to the API and fet

May 30, 2022

Client-Side Prototype Pollution Tools

Client-Side Prototype Pollution Tools

Client-Side Prototype Pollution Tools Match rules for Burp Software Version Reporter extension Match rules that passively detect vulnerable libraries

Oct 4, 2022
Comments
  • Не работает чат, в чем может быть проблема?

    Не работает чат, в чем может быть проблема?

    Добрый день! Не работает чат, в чем может быть проблема?

    Дебажил библиотеку, в итоге вечно ловлю ошибку:

    Connecting... connect_error: Error: websocket error attempt: 1

    и так постоянно

    Есть мысли?

    opened by dixakman 8
Releases(v0.0.11)
  • v0.0.11(Sep 11, 2022)

  • v0.0.10(Sep 10, 2022)

    • feat: add downloadVod rename getMediaStream to donwloadLiveMediaStream a6d91a7

    https://github.com/shevernitskiy/wasdtv/compare/v0.0.9...v0.0.10

    Source code(tar.gz)
    Source code(zip)
  • v0.0.9(Jul 18, 2022)

    • docs: add messageDeleted, paidMessage events aab13ed
    • feat: add ChatMessageDeleted, ChatPaidMessage 7aeb4da
    • docs: update readme 1041a41
    • feat: add getClips method 76a90b1
    • feat: add getPosts method afab80e
    • feat: add possible chat events without types ea3893d

    https://github.com/shevernitskiy/wasdtv/compare/v0.0.8...v0.0.9

    Source code(tar.gz)
    Source code(zip)
  • v0.0.8(Jun 24, 2022)

    • style: return promises instead of values 4cbe596
    • feat: add methods from personal area 66d35c0
    • feat: add search methods 4559366

    https://github.com/shevernitskiy/wasdtv/compare/v0.0.7...v0.0.8

    Source code(tar.gz)
    Source code(zip)
  • v0.0.7(Jun 23, 2022)

  • v0.0.6(Jun 21, 2022)

    • types: add few roles c59013b
    • style: change name getCurrent to getProfile 8f3aa6a
    • feat: add getNotification method fbad00f
    • feat: add getCurrent method 53311fa
    • feat: add getChannelLinks method 16bb695
    • style: remove unneeded namespace from EventMap 4e877bd
    • feat: add user_ban chat event 5314fe4
    • feat: add highlighted_message chat event ac231fa

    https://github.com/shevernitskiy/wasdtv/compare/v0.0.5...v0.0.6

    Source code(tar.gz)
    Source code(zip)
  • v0.0.5(Jun 10, 2022)

  • v0.0.4(Jun 10, 2022)

Automatically generated documentation for the Valorant API endpoints the client uses internally.

Valorant API Docs To read documentation and get started, see Docs This is a project designed to automatically document Valorant endpoints based on a J

Techdoodle 223 Dec 25, 2022
API client to test endpoints over HTTP. Uses superagent under the hood

@japa/client API client to test endpoints over HTTP. Uses superagent under the hood The API client plugin of Japa makes it super simple to test your A

Japa.dev 8 Apr 13, 2022
OAuth 2 / OpenID Connect Client for Web API runtimes

OAuth 2 / OpenID Connect Client for Web APIs runtime This is a collection of bits and pieces upon which a more streamlined Client module may be writte

Filip Skokan 187 Jan 6, 2023
Official Node.js client library for Devzat plugin API

Devzat plugin API client for Node.js This NPM package allows you to build Devzat plugins/bots with JavaScript/TypeScript. See example/index.ts for a f

Benjamin Smith 2 Apr 26, 2022
A wrapper client for Strike's public API.

node-strike A wrapper client for Strike's public API. Usage Import the wrapper and instantiate a client. import { NodeStrike } from 'node-strike'; //

hodlone 5 Apr 28, 2022
Tpy - A strongly typed Pylon API client

tpy A strongly typed Pylon API client. https://pylon.bot/ The Pylon API does not have a standardized response, meaning there are alot of edge cases an

insyri 6 Dec 15, 2022
Deno client library for Bitwarden CLI's local REST API.

Bweno Think outside the bun ?? Bweno is a client library for Bitwarden CLI's local REST API. Pronounced as Spanish 'bueno', meaning 'good'. Requiremen

Wyatt Goettsch 3 May 26, 2022
Generate type definitions compatible with @kintone/rest-api-client

kintone-form-model-generator Generate type definitions compatible with @kintone/rest-api-client Prerequirements Node.js (>=12) Install # Install npm i

Yuuki Takahashi 5 Dec 15, 2022
A minimal yet powerful HTTP client/API testing tool made for speed.

req req is a lightweight, minimal yet powerful HTTP client slash API testing tool designed for speed. Contents Features Installation Documentation Con

Siddharth 37 Aug 29, 2022
API dot Open Sauced is NestJS and SupaBase powered OAS3 backend designed to remove client complexity and provide a structured graph of all @open-sauced integrations

?? Open Sauced Nest Supabase API ?? The path to your next Open Source contribution ?? Prerequisites In order to run the project we need the following

TED Vortex (Teodor-Eugen Duțulescu) 13 Dec 18, 2022