Integrating with Twitch #
Set up Twitch Drops #
You can map an Pragma offer to a Twitch Drop.
Twitch Docs:
Plugin configuration #
Client id and secret can be found under the Application settings. Make sure you use the application that maps to the organization that owns the game which drops/rewards are managed under.
social:
shared:
configs:
Twitch:
class: "pragma.shared.TwitchCredentialsConfig"
config:
clientId: "[client-id]"
clientSecret: "[encrypted-client-secret]" # encrypted value
pluginConfigs:
AccountService.identityProviderPlugins:
plugins:
Twitch:
class: "pragma.account.TwitchIdentityProviderPlugin"
config:
sharedConfigKey: "Twitch"
playerLoginEnabled: true
accountLinkingEnabled: true
accountLinkingCooldownInDays: 30
ThirdPartyNodeService.orderProviderPlugins:
plugins:
Twitch:
class: "pragma.order.TwitchOrderProviderPlugin"
config:
sharedConfigKey: "Twitch"
gameId: "[game-id-assigned-in-Twitch]"
Any configuration set through the portal will override any values assigned in a config yml file.
- Do not manually encrypt any secrets. The API automatically encrypts all sensitive values during submission.
- You only need to enter credential values in one form. Portal will store credentials under shared config.
Order provider configuration #
- Navigate to the Order Providers page: select the
CommerceTab →Order Providersin side menu. - Select platform to configure and fill out the form.
- Click
Confirmto see changes. - Click
Deployto apply changes.
Id provider configuration #
- Navigate to the ID Provider page: select the
AccountsTab →ID Providerin the side menu. - Select a provider and fill out the form.
- Click
Confirmto see changes. - Click
Deployto apply changes.
Order mapping example #
Map each Twitch reward id to an order sku.
[project]/content/src/OrderMappingsSpecs.json
{
"skuId": "SmallGoldBundle",
"sources": [
{
"provider" : "TWITCH"
"twitchSource" : {
"rewardId" : "[twitch-reward-id]"
}
}
]
}
Run the content apply command to validate and generate content catalogs.
./pragma content apply
Testing #
To test order processing on a local or dev environment there are a couple of things you can do to make things easier.
Link a Twitch account to a Unsafe account using the player portal #
- This lets you authenticate and call the fulfill orders API through a unsafe account.
- You can use the Postman collection for this flow.
Test Campaigns #
- You cannot manually grant Twitch rewards.
- Twitch does support a test mode for a campaign.
Refunds and charge backs #
Twitch does not support refunds on drops that have been consumed. If Pragma has recorded an order for a Twitch drop, it has been consumed and can not be returned.

