This repo demonstrates how to implement Kick’s OAuth2 flow using Flask and PKCE.
- Authorization Code + PKCE login
- Token exchange & refresh
- Call Kick API (
/users/me) - Revoke tokens
-
Clone the project:
git clone https://github.com/Riotcoke123/kick-oauth-demo-python cd kick-oauth-demo -
Install dependencies:
pip install -r requirements.txt -
Create a Kick OAuth application in your Kick Developer Dashboard.
- Set Redirect URI →
http://localhost:5000/callback - Copy your
client_idandclient_secret
- Set Redirect URI →
-
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" -
Run the app:
python app.py - Open http://localhost:5000 → Click Login with Kick, sign in, authorize, and you’ll see your tokens.
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())- Never expose
client_secretin client-side (browser or mobile) code. - Store refresh tokens securely.
- Replace
SCOPEinapp.pywith only what your app needs. - In production, use HTTPS for the redirect URI.
GNU General Public License v3.0