Generating a new authentication code programmatically

If you don’t store the token, how do you reuse the token.

If you don’t store the refresh token how do you use that token to get a new access token.

As a minimum the refresh token must be stored.

There is no way to get the initial access token/refresh token in a headless way since a user token requires the browser to run the oAuth flow.

So if you want no state and you want to read private data on a users account.
You can’t do that. Something has to be stored after it is generated from a user manual interaction step.

If you only intend to read public data you can use a client credentials token instead Getting OAuth Access Tokens | Twitch Developers

But if you need to do actions on a user account then you need state