Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@livecord/notify

Package Overview
Dependencies
Maintainers
3
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@livecord/notify - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

2

package.json
{
"name": "@livecord/notify",
"version": "1.2.2",
"version": "1.2.3",
"description": "Notifier for YouTube and Twitch.",

@@ -5,0 +5,0 @@ "main": "./index.js",

@@ -18,3 +18,11 @@ /// <reference types="node" />

getLive(userLogin: string): Promise<any>;
getFollowers(userId: string): Promise<{
total: any;
data: any;
}>;
getFollows(userId: string): Promise<{
total: any;
data: any;
}>;
static getToken(clientId: string, clientSecret: string): Promise<any>;
}

@@ -248,2 +248,42 @@ "use strict";

;
async getFollowers(userId) {
if (!userId)
throw new Error('LivecordTwitch: userLogin is required');
if (typeof userId === 'string') {
const request = await axios_1.default.request({
method: "GET",
url: `https://api.twitch.tv/helix/users/follows?to_id=${userId}`,
headers: {
"client-id": this.client.id,
"Authorization": `Bearer ${this.client.token}`
}
}).then(res => res.data).catch(err => err.response);
return { total: request?.total, data: request?.data };
}
else {
throw new Error('LivecordTwitch: userId must be a string');
}
;
}
;
async getFollows(userId) {
if (!userId)
throw new Error('LivecordTwitch: userId is required');
if (typeof userId === 'string') {
const request = await axios_1.default.request({
method: "GET",
url: `https://api.twitch.tv/helix/users/follows?from_id=${userId}`,
headers: {
"client-id": this.client.id,
"Authorization": `Bearer ${this.client.token}`
}
}).then(res => res.data).catch(err => err.response);
return { total: request?.total, data: request?.data };
}
else {
throw new Error('LivecordTwitch: userId must be a string');
}
;
}
;
static async getToken(clientId, clientSecret) {

@@ -250,0 +290,0 @@ const request = await axios_1.default.post('https://id.twitch.tv/oauth2/token', {

@@ -52,2 +52,4 @@ # [@livecord/notify](https://npmjs.com/package/@livecord/notify)

// twitch.getLive('user_login_name');
// twitch.getFollowers('user_id');
// twitch.getFollows('user_id');
```

@@ -54,0 +56,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc