Skip to content

Riotcoke123/kick-oauth-demo-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kick OAuth2 Demo (Python + Flask)

This repo demonstrates how to implement Kick’s OAuth2 flow using Flask and PKCE.

Features

  • Authorization Code + PKCE login
  • Token exchange & refresh
  • Call Kick API (/users/me)
  • Revoke tokens

⚙️ Setup

  1. Clone the project:
    git clone https://github.com/Riotcoke123/kick-oauth-demo-python
    cd kick-oauth-demo
  2. Install dependencies:
    pip install -r requirements.txt
  3. Create a Kick OAuth application in your Kick Developer Dashboard.
    • Set Redirect URI → http://localhost:5000/callback
    • Copy your client_id and client_secret
  4. Set environment variables:
    export KICK_CLIENT_ID="your_client_id"
    export KICK_CLIENT_SECRET="your_client_secret"
    export KICK_REDIRECT_URI="http://localhost:5000/callback"
    export FLASK_SECRET="somethingrandom"
  5. Run the app:
    python app.py
  6. Open http://localhost:5000 → Click Login with Kick, sign in, authorize, and you’ll see your tokens.

Example API call

The app demonstrates calling:

GET https://api.kick.com/v1/users/me
Authorization: Bearer <access_token>

To call other endpoints, use the same access token in your headers:

headers = {"Authorization": f"Bearer {access_token}"}
r = requests.get("https://api.kick.com/v1/channels", headers=headers)
print(r.json())

Notes

  • Never expose client_secret in client-side (browser or mobile) code.
  • Store refresh tokens securely.
  • Replace SCOPE in app.py with only what your app needs.
  • In production, use HTTPS for the redirect URI.

Resources

License

GNU General Public License v3.0

Releases

No releases published

Packages

No packages published

Languages