Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Grants packageId to steamId provided publisher web api key via nodejs endpoint
const fetch = require('node-fetch')
const FormData = require('form-data')
export default function(req, res) {
const payload = new FormData()
payload.append('key', 'publisher_steam_web_api_key')
payload.append('steamid', 'user_steam_id')
payload.append('packageid', 'package_id')
payload.append('ipaddress', '')
fetch('', {
method: 'POST',
body: payload,
headers: payload.getHeaders(),
.then(res => res.json())
.then(json => {
console.log('STEAM GrantPackage Success', json)
console.log('Session Logged Out')
res.status(200).send('steam package granted!')
.catch(err => {
console.log('STEAM GrantPackage Error')
res.status(400).json({message: 'steam granting error occured'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment