Skip to content

Commit 2890979

Browse files
committed
docs: add Twitch adapter installation and configuration instructions
1 parent 5a330c6 commit 2890979

File tree

1 file changed

+38
-0
lines changed
  • adminforth/documentation/docs/tutorial/05-Plugins

1 file changed

+38
-0
lines changed

adminforth/documentation/docs/tutorial/05-Plugins/11-oauth.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,44 @@ plugins: [
299299
]
300300
```
301301

302+
### Twitch Adapter
303+
304+
Install Adapter:
305+
306+
```
307+
npm install @adminforth/twitch-oauth-adapter --save
308+
```
309+
310+
1. Go to the [Twitch dashboard](https://dev.twitch.tv/console/)
311+
2. Create a new app or select an existing one
312+
3. In `OAuth Redirect URLs` add `https://your-domain/oauth/callback` (`http://localhost:3500/oauth/callback`)
313+
4. Go to the app and copy `Client ID`, click to `Generate a new client secret`(in Twitch this button can be used only once for some time, becouse of this dont lose it) button and copy secret .
314+
5. Add the credentials to your `.env` file:
315+
316+
```bash
317+
TWITCH_OAUTH_CLIENT_ID=your_twitch_client_id
318+
TWITCH_OAUTH_CLIENT_SECRET=your_twitch_client_secret
319+
```
320+
321+
Add the adapter to your plugin configuration:
322+
323+
```typescript title="./resources/adminuser.ts"
324+
import AdminForthAdapterTwitchOauth2 from '@adminforth/twitch-oauth-adapter';
325+
326+
// ... existing resource configuration ...
327+
plugins: [
328+
new OAuthPlugin({
329+
adapters: [
330+
...
331+
new AdminForthAdapterTwitchOauth2({
332+
clientID: process.env.TWITCH_OAUTH_CLIENT_ID,
333+
clientSecret: process.env.TWITCH_OAUTH_CLIENT_SECRET,
334+
}),
335+
],
336+
}),
337+
]
338+
```
339+
302340
### Need custom provider?
303341

304342
Just fork any existing adapter e.g. [Google](https://github.com/devforth/adminforth-google-oauth-adapter) and adjust it to your needs.

0 commit comments

Comments
 (0)