A wrapper for https://www.backpack.tf OAuth API.
Create an app if you don't have one already: https://backpack.tf/developer/apps.
Breaking changes may occur Until v1
importbackpacktffrom'backpacktf-oauth';//orconstbackpacktf=require('backpacktf-oauth');constbp=newbackpacktf('***client_id***','***client_secret***');bp.once('ready',()=>{//You can use the module however you want now});// Checks current users status. Returns BackpackTF.StatusResponsebp.getStatus();Promise.
I'm too lazy to type them here just use typecript
// Activates User Agent returns Agent.PulseResponseawaitbp.Agent.pulse();// Stops User Agent returns Agent.OnlyStatus (Probably "inactive")awaitbp.Agent.stop();// Checks current User Agent status returns Agent.PulseResponseawaitbp.Agent.status();namespaceAgent{exportinterfacePulseResponseextendsOnlyStatus{current_time?: number;expire_at?: number;client?: string;}exportinterfaceOnlyStatus{status: 'active'|'inactive';}}// Get an alert by alertid (string) returns Alerts.Alertawaitbp.Alerts.getAlert(id)// This endpoint currently doesn't work due to serverside issues.// Delete an alert by alertid(string) returns UNKNOWNawaitbp.Alerts.deleteAlert(id)// Get alerts returns Alerts.Response.// skip and limit variables are Optional.awaitbp.Alerts.getAlerts(skip?,limit?)// Create an Alert by alert (Alerts.Create) returns Alerts.Alertawaitbp.Alerts.createAlert(alert)namespaceAlerts{exportinterfaceResponse{results: Alert[];cursor: {skip: number;limit: number;total: number;};}exportinterfaceAlert{id: string;item_name: string;intent: 'sell'|'buy';appid: number;steamid: string;price: {currency: 'metal'|'key';min: number;max: number;};}exportinterfaceCreate{item_name: string;intent: 'sell'|'buy';currency: 'metal'|'key';min: number;max: number;blanket: string;}}// Get a notification by notificationid (string) returns Notifications.Notificationawaitbp.Notifications.getNotification(id)// This endpoint currently doesn't work due to serverside issues.// Delete a notification by notificationid (string) returns UNKNOWNawaitbp.Notifications.deleteNotification(id)// Get notifications returns Notifications.Response.// skip, limit and unread variables are Optional.awaitbp.Notifications.getNotifications(skip?,limit?,unread?)// Unread all notifications returns Notifications.Notification[] (returns all unread Notifications and marks them as read)awaitbp.Notifications.unreadNotifications(alert)// Mark Notifications returns Notifications.MarkResponseawaitbp.Notifications.markNotifications(alert)namespaceNotifications{exportinterfaceNotification{id: string;steamid: string;lastMoved: number;elementId: string;userId: string;type: number;bunde: {listing?: BackpackTF.classifiedItemBuy|BackpackTF.classifiedItemSell;};contents: {subject: string;message: string;url: string;};}exportinterfaceResponse{results: Notification[];cursor: {skip: number;limit: number;total: number;};}exportinterfaceMarkResponse{modified: number;}}// Gets UserInfos by steamids (string[]) returns WebAPIUsers.UserResponseawaitbp.WebApiUsers.getUsers(steamids)// Gets Impersonated users returns WebAPIUsers.ImpersonatedResponse// skip and limit variables are Optional.awaitbp.WebApiUsers.getImpersonatedUsers(skip?,limit?)namespaceWebAPIUsers{exportinterfaceUserResponse{response: {success: 1|0;current_time: number;players: {[steamid64: string]: {steamid: string;success: 1|0;backpack_value: {[appid: string]: number;};backpack_update: {[appid: string]: number;};name: string;backpack_tf_trust: {for: number;against: number;};};};};}exportinterfaceImpersonatedResponse{results: {steamid: string;personaname: string;avatar: string;}[];total: number;}}// Gets inventory value of a user by steamid (string) returns Inventory.Valuesawaitbp.Inventory.getValue(steamid);// Gets status of a user by steamid (string) returns Inventory.Statusawaitbp.Inventory.getStatus();// Refreshes Status of a user by steamid (string) returns Inventory.Statusawaitbp.Inventory.refresh();namespaceInventory{exportinterfaceValues{market_value: number;value: number;}exportinterfaceStatus{current_time: number;last_update: number;timestamp: number;next_update: number;refresh_interval: number;}}