Skip to content

Instantly share code, notes, and snippets.

@StoneyEagle
Created March 28, 2024 16:02
Show Gist options
  • Save StoneyEagle/50be40b1799dc4c1d7dd6d1f54fef47f to your computer and use it in GitHub Desktop.
Save StoneyEagle/50be40b1799dc4c1d7dd6d1f54fef47f to your computer and use it in GitHub Desktop.
Twitch Credentials Auth for postman

Set the variables twitch-client-id and witch-client-secret as secret variables in your Postman environment,

curl --location 'https://id.twitch.tv/oauth2/token' \
--header 'Content-Type: application/json' \
--data '{
	"client_id": "{{twitch-client-id}}",
	"client_secret": "{{twitch-client-secret}}",
	"grant_type": "client_credentials",
	"scope": "the scopes you need"
}'
Test
const response = pm.response.json();

if(response?.access_token){
  pm.globals.set("TWITCH_TOKEN", response.access_token);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment