@twurple/auth-ext

Obtain auth tokens for Twitch inside an Extension.

Usage no npm install needed!

<script type="module">
  import twurpleAuthExt from 'https://cdn.skypack.dev/@twurple/auth-ext';
</script>

README

Twurple - Electron auth provider

GitHub license npm version PRs welcome

This is an {@AuthProvider} implementation for the twurple package family that will use the token provided to your Extension by Twitch.

Installation

To add this library to your project, just execute:

yarn add @twurple/auth-ext

or using npm:

npm install @twurple/auth-ext

Basic usage

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

import { ApiClient } from '@twurple/api';
import { ExtensionAuthProvider } from '@twurple/auth-ext';

const clientId = 'abc123';

const authProvider = new ExtensionAuthProvider(clientId);

const client = new ApiClient({
    authProvider
});

If you're getting stuck...

You can join the Twitch API Libraries Discord Server and ask in #twurple for support.