Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
twitch-api-typescript
Advanced tools
Readme
Fully typed TwitchAPI wrapper that makes working with TwitchAPI as easy as possible
# With npm:
npm install twitch-api-typescript
#With yarn:
#Not added yet
TwitchTS always tries to use the user access token first for API calls that can be called using the app access token or user access token. So if you know that you only make calls where the app access token is enough, then it is enough to just specify that.
During initialization, several pieces of optional information can be specified for token management:
const apiClient = new TwitchAPI({
clientId: "{YOUR-CLIENT-ID}",
tokens:{
userToken: "{YOUR-USER-ACCESS-TOKEN}",
appToken: "{YOUR-APP-ACCESS-TOKEN}"
}
})
await apiClient.init();
const apiClient = new TwitchAPI({
clientId: "{YOUR-CLIENT-ID}",
tokens:{
refreshToken: "{YOUR-REFRESH-TOKEN}"
}
})
await apiClient.init();
const apiClient = new TwitchAPI({
clientId: "{YOUR-CLIENT-ID}",
clientSecret: "{YOUR-CLIENT-SECRET}"
})
await apiClient.init();
At runtime, all settings related to tokens can be changed. TwitchTS offers a public interface for this purpose:
const apiClient = new TwitchAPI({
clientId: "{YOUR-CLIENT-ID}",
...
})
//Setting tokens/secret to a new value directly.
apiClient._tokenHandler.userAccessToken = "{NEW-USER-ACCESS-TOKEN}"
apiClient._tokenHandler.appAccessToken = "{NEW-APP-ACCESS-TOKEN}"
apiClient._tokenHandler.refreshToken = "{NEW-REFRESH-TOKEN}"
apiClient._tokenHandler.clientSecret = "{NEW-CLIENT-SECRET}"
//Manually trigger a refresh of the respective token
await apiClient._tokenHandler.renewAppAccessToken();
await apiClient._tokenHandler.renewUserAccessToken();
//Stop the refresh interval of the respective token refresh routine
await apiClient._tokenHandler.stopAppTokenRefresh();
await apiClient._tokenHandler.stopUserTokenRefresh();
//Start/Restart the refresh interval of the respective token refresh routine
await apiClient._tokenHandler.startAppTokenRefresh();
await apiClient._tokenHandler.stopUserTokenRefresh();
Copyright © 2022 François Egner.
This project is GNU General Public License v3.0 licensed.
FAQs
Fully typed TwitchAPI wrapper that makes working with TwitchAPI as easy as possible
The npm package twitch-api-typescript receives a total of 0 weekly downloads. As such, twitch-api-typescript popularity was classified as not popular.
We found that twitch-api-typescript demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.