twitch.ext.onauthorized and passes received authorization object to a child component as a render prop.
- React v16.8 or newer (any version supporting React Hooks)
npm install --save react-twitch-ext-onauthorized
;const MyComponent = <div>My component<div>;const Unauthorized = <div>This will be used if authorization fails</div>;<TwitchExtAuthProvider enable=true unauthorized=<Unauthorized />><MyComponent /></TwitchExtAuthProvider>
true) enables or disables authorization. When set to
falsefor development or testing purposes.
<div>Unauthorized</div>) - element to render if Twitch authorization fails (e.g. the extension is open outside of Twitch context)
Code is available under MIT license. See LICENSE for more information.