This package has been deprecated

Author message:

This package was renamed to @twurple/auth-electron. Please check out the migration guide at https://twurple.js.org/docs/migration/

twitch-electron-auth-provider
TypeScript icon, indicating that this package has built-in type declarations

4.6.7 • Public • Published

Twitch.js - Electron auth provider

This is an {@AuthProvider} implementation for the twitch package family that will automatically pop up a Twitch OAuth dialog in an Electron BrowserWindow as soon as new scopes are requested.

Installation

To add this library to your project, just execute:

yarn add twitch-electron-auth-provider

or using npm:

npm install twitch-electron-auth-provider

Basic usage

To instantiate an {@ApiClient} with this auth provider, just pass it to its constructor:

import { ApiClient } from 'twitch';
import { ElectronAuthProvider } from 'twitch-electron-auth-provider';

const clientId = 'abc123';
const redirectUri = 'http://foo.bar/login';

const authProvider = new ElectronAuthProvider({
    clientId,
    redirectUri
});

const client = new ApiClient({
	authProvider
});

Please note that this currently only works from the main thread.

To allow the user to "log out" and change to another account, use:

authProvider.allowUserChange();

If you're getting stuck...

You can join the Discord server for support.

Package Sidebar

Install

npm i twitch-electron-auth-provider

Weekly Downloads

118

Version

4.6.7

License

MIT

Unpacked Size

26 kB

Total Files

15

Last publish

Collaborators

  • d-fischer