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

twitch-oauth

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twitch-oauth

Authenticate users with Twitch.

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-45.45%
Maintainers
1
Weekly downloads
 
Created
Source

Twitch OAuth

Authenticate users with Twitch.

💻 Getting started

# With npm:
npm install twitch-oauth

# With yarn:
yarn add twitch-oauth

📚 Usage

As a ES Module

import { TwitchOAuth } from 'twitch-oauth';

// Initialize client.
const client = new TwitchOAuth({
  clientId: '..............',
  clientSecret: '..........',
  redirectUri: '...........',
  scope: [
    "user:read:email",
    "......"
  ],
  // Optional, can be "token" or "code" (code is by default and recommended)
  method: "code"
});

// Get the auth redirect url.
client.authenticate(); // Returns https://id.twitch.tv/oauth2/authorize?....

// Get access and refresh token using the code that twitch sends the frontend.
client.verifyCodeResponse(code: string)
    .then(console.log);

// Check if access token still valid.
client.validate(access_token: string);

// Refresh expired token.
client.refresh(refresh_token: string);

As CJS Module

// If uses require function you will need to use .default
// For import in typescript, this is not required
const { TwitchOAuth } = require('twitch-oauth').default;

🤝 Contributing

Contributions, issues and feature requests are welcome! Feel free to check issues page.

❤️ Show your support

Give a ⭐️ if this project helped you!

Or buy me a coffeelatte 🙌🏾

Ko-fi | Patreon

📝 License

Copyright © 2022 Sammwy.
This project is MIT licensed.

Keywords

FAQs

Package last updated on 03 Sep 2023

Did you know?

Socket

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.

Install

Related posts

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