Integrating with Steam #

Set up the store #

You can map a Pragma order to a Steam inventory item or an application id.

Plugin configuration #

Once you have setup your application and store in Steam, you are ready to configure Pragma. You can configure through the shard config file or using the social operator portal.

Check out the Steam’s auth documentation to learn how to generate a Steam’s web key.
social:
  # a SteamCredentialsConfig can be shared with: 
  # SteamIdentityProviderPlugin and SteamOrderProviderPlugin
  shared:
    configs:
      Steam:
        class: "pragma.shared.SteamCredentialsConfig"
        config:
          appId: "[steam-app-id]"
          steamWebAPIKey: "[encrypted-steam-web-api-key]" # encrypted value
  pluginConfigs:
    ThirdPartyNodeService.orderProviderPlugins:
      plugins:
        Steam:
          class: "pragma.order.SteamOrderProviderPlugin"
          config:
            sharedConfigKey: "Steam" # required when using shared config
    AccountService.identityProviderPlugins:
      plugins:
      Steam:
        class: "pragma.account.SteamIdentityProviderPlugin"
        config:
          sharedConfigKey: "Steam" # required when using shared config
          playerLoginEnabled: true
          accountLinkingEnabled: true
          accountLinkingCooldownInDays: 30
Encrypting config values

All secrets must be encrypted and decrypted per shard. Shards use different encryption keys.

  1. Connect to the VPN using the *.ovpn file provided to you during onboarding.
  2. Navigate to your Homebase API URL: https://api.homebase.<studioname>.pragmaengine.com/
  3. Choose /secrets/encryptV1
  4. Enter the following values in the request body:
    1. shardId - The name of the shard you are encrypting a value for.
    2. titleId - The working title of your game that uses the secret.
    3. value - The secret you’re encrypting.

Your encrypted secret will appear below in the Responses section.

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 #

  1. Navigate to the Order Providers page: select the Commerce Tab → Order Providers in side menu.
  2. Select platform to configure and fill out the form.
  3. Click Confirm to see changes.
  4. Click Deploy to apply changes.

order-providers-config-portal

Id provider configuration #

  1. Navigate to the ID Provider page: select the Accounts Tab → ID Provider in the side menu.
  2. Select a provider and fill out the form.
  3. Click Confirm to see changes.
  4. Click Deploy to apply changes.

id-providers-config-portal

Order mapping example #

The content format for a Steam inventory item and application are different. Follow examples below when adding order mapping content.

Order mapping example for a inventory item:

[project]/content/src/OrderMappingsSpecs.json

{
    "skuId": "SmallGoldBundle",
    "sources": [
        {
            "provider": "STEAM",
            "steamSource": {
                "inventory": {
                    "itemDefId": "[item-def-id-from-steam-catalog]"    
                }
            }
        }
    ]
}

Order mapping example for a application id:

[project]/content/src/OrderMappingsSpecs.json

{
    "skuId": "SmallGoldBundle",
    "sources": [
        {
            "provider": "STEAM",
            "steamSource" : {
                "ownership" : {
                    "appId" : "[application-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.

  • This lets you authenticate and call the fulfill orders API through a unsafe account vs having to login with a Steam account.
  • You can use the Postman collection for this flow.

Grant items to the Steam account using the Add Item API #

  • This API lets you grant items without going through the Steam store. Use this when you want to test the Pragma processing and not Steam’s payment flow.

Refunds and charge backs #

Steam does not support refunds on inventory items that have been consumed. If Pragma has recorded an order for a Steam inventory item, it has been consumed and can not be returned.