Modern CS2/CS:GO Game Coordinator integration with the latest GameTracking-CS2 protobuf definitions. This package provides a simple API for interacting with the Counter-Strike 2 and CS:GO Game Coordinator, with full support for all modern CS2 features.
Note: Large portions of this library were generated with the assistance of AI. While core functionality has been verified, some features — particularly around volatile items — may not have been thoroughly tested and could behave unexpectedly. If you discover a bug or have a working fix for an open issue, I'd appreciate it if you could submit a Pull Request or leave a comment on the GitHub Issue with your solution. Community contributions help make this project better for everyone.
- Latest Protobuf Definitions - Always up-to-date with GameTracking-CS2
- Complete Field Support - All modern CS2 fields including
highlight_reel,wrapped_sticker,variations - Promise-Based API - Modern async/await support with backward-compatible callbacks
- Volatile Items - Support for rental items and temporary items
- XP Shop & Rewards - Redeem rewards and track XP progress
- Recurring Missions - Request and track mission schedules
- Premier Season - Access premier season data and leaderboards
- Enhanced Error Handling - Comprehensive error detection and validation
- 100% Backward Compatible - Drop-in replacement for
globaloffensive
npm install node-cs2constSteamUser=require('steam-user');constNodeCS2=require('node-cs2');constuser=newSteamUser();constcs2=newNodeCS2(user);user.logOn({accountName: 'your_username',password: 'your_password'});user.on('loggedOn',()=>{user.gamesPlayed([730]);// CS2/CS:GO app ID});user.on('appLaunched',(appid)=>{if(appid==730){cs2.helloGC();}});cs2.on('connectedToGC',async()=>{// Inspect an itemconstitem=awaitcs2.inspectItem('76561198057249394','2569415699','7115007497');console.log('Item:',item);});// Promise styleconstitem=awaitcs2.inspectItem(owner,assetid,classid);// Callback stylecs2.inspectItem(owner,assetid,classid,(item)=>{console.log(item);});// Load volatile item contentsconstitems=awaitcs2.loadVolatileItemContents(volatileItemId);// Claim volatile item rewardawaitcs2.claimVolatileItemReward(defindex);// Redeem free rewardawaitcs2.redeemFreeReward(generationTime,redeemableBalance,items);// Listen for XP shop updatescs2.on('xpShopNotification',(data)=>{console.log('XP:',data.current_xp,'Level:',data.current_level);});// Request mission scheduleconstschema=awaitcs2.requestRecurringMissionSchedule();// Set leaderboard safe namecs2.setLeaderboardSafeName('MySafeName');// Listen for premier season datacs2.on('premierSeasonSummary',(summary)=>{console.log('Premier season:',summary);});// Open a crateawaitcs2.openCrate(toolItemId,subjectItemId);awaitcs2.openCrate(toolItemId,subjectItemId,false,100,1);// Extract/encapsulate stickersawaitcs2.extractSticker(itemId,stickerSlot);awaitcs2.encapsulateSticker(stickerId);// Apply/remove patchesawaitcs2.applyPatch(itemId,patchId,patchSlot);awaitcs2.removePatch(itemId,patchSlot);// Apply/remove keychainsawaitcs2.applyKeychain(itemId,keychainId,keychainSlot);cs2.removeKeychain(itemId);// Commend a playercs2.commendPlayer(accountId,{cmd_friendly: true,cmd_teaching: true,cmd_leader: true});Commendation note:
commendPlayer()is a low-level GC request. The protobuf payload is supported, but Valve may reject or silently ignore it unless the target is eligible. Use the target's 32-bit account ID, and expect a real recent/live match ID involving the sender and target to be required in practice. Thetokensvalue may also depend on GC-side eligibility state, so it should not be treated as an arbitrary counter. Profile commendation totals may not update immediately.
- EXAMPLES.md - Comprehensive usage examples
- DETAILED_DOCUMENTATION.md - Complete API reference and technical details
- CHANGELOG.md - Version history and release changes
This package is 100% API compatible with the original globaloffensive package:
// OldconstGlobalOffensive=require('globaloffensive');// New - just change the require!constNodeCS2=require('node-cs2');// All your existing code works unchanged!constcs2=newNodeCS2(steamUser);- Missing Fields -
highlight_reelandwrapped_stickernow properly extracted - Modern CS2 Support - All new CS2 fields and arrays supported
- Error Handling - Comprehensive error detection and validation
- Code Quality - Deduplication, better maintainability
- Node.js >= 14.0.0
- steam-user >= 4.2.0
MIT License - see LICENSE file for details.
- Original Author:DoctorMcKay - Original
globaloffensivepackage - Protobuf Definitions:SteamDatabase GameTracking-CS2
- Fork Maintainer:sak0a
- Issues:GitHub Issues
- Examples: See EXAMPLES.md
- Documentation: See DETAILED_DOCUMENTATION.md