Skip to content

Repository files navigation

BACKPACKTF

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

Constructor

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});

Method

// Checks current users status. Returns BackpackTF.StatusResponsebp.getStatus();

⚠️ All Methods Return their shown values wrapped by a Promise. ⚠️

Classes

Classifieds

I'm too lazy to type them here just use typecript

Agent

Methods

// 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();

Types

namespaceAgent{exportinterfacePulseResponseextendsOnlyStatus{current_time?: number;expire_at?: number;client?: string;}exportinterfaceOnlyStatus{status: 'active'|'inactive';}}

Alerts

Methods

// 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)

Types

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;}}

Notifications

Methods

// 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)

Types

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;}}

WebAPIUsers

Methods

// 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?)

Types

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;}}

Inventory

Methods

// 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();

Types

namespaceInventory{exportinterfaceValues{market_value: number;value: number;}exportinterfaceStatus{current_time: number;last_update: number;timestamp: number;next_update: number;refresh_interval: number;}}

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages