This example covers a way to create and maintain an app access token in PHP. And store that app access token in a Flat file to maintain/recover it between restarts and for use in other programs running on the same server.
There are three examples
- Generating app access token via form post
- Generating app access token via query string post (like the docs)
- A script to load an existing token and regenerate if it's close to expiration
- Open
config_sample.phpin a text editor - Visit Twitch Dev Console
- Visit Applications
- Manage your Application, or create one if you don't have one
- Copy the Client ID into the
""ofCLIENT_ID - Hit
New Secretand then Ok - Then copy the now Displayed Client Secret into the
""ofCLIENT_SECRET - Save your modified file as
config.php
In a console/terminal, run php and the script you want to test.