https://github.com/normalhuman01/twitch-login-sdk
a integrate the twitch login system into your amazing angular project
https://github.com/normalhuman01/twitch-login-sdk
Last synced: about 1 year ago
JSON representation
a integrate the twitch login system into your amazing angular project
- Host: GitHub
- URL: https://github.com/normalhuman01/twitch-login-sdk
- Owner: normalhuman01
- License: apache-2.0
- Created: 2023-12-16T04:58:09.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-16T04:58:45.000Z (over 2 years ago)
- Last Synced: 2025-02-01T12:45:31.597Z (over 1 year ago)
- Language: TypeScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Integrate the Twitch login system into your amazing Angular project

---
[Live demo](https://twitch-login-sdk.stackblitz.io)
[Stackblitz](https://stackblitz.com/edit/twitch-login-sdk)


### Install
`npm i twitch-login-sdk@latest --save`
### Import
__app.module.ts__
```typescript
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {AppComponent} from './app.component';
/** IMPORT **/
import {TwitchLoginSdkModule} from "twitch-login-sdk"; 👈
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
TwitchLoginSdkModule.forRoot({
twitchId: "xi7fl9ld6dlikhbv8xbfu77bzyjlkw", //<******* YOUR TWITCH_ID 👈
redirect: "https://twitch-sdk-login.stackblitz.io" //<***** YOUR CALLBACK REDIRECT 👈
})
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {
}
```
__app.component.html__
__scopes:__ Default
`user:read:email+openid+analytics:read:games+user:read:broadcast`
```html
```
### Use
Use in your component
```typescript
import {Component, OnInit} from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
public outCb: any;
constructor(){}
ngOnInit() {
}
/** Callback Data **/
out($event): any {
this.outCb = $event;
}
}
```
### Customize
__buttom-twitch-login__: Classname for button

