You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor: Use backend API for inventory sync (matches web app)
PROBLEM:
- Content script trying to fetch from Steam directly
- Getting HTML instead of JSON (privacy/auth issues)
- Complex error-prone approach
SOLUTION:
- Extension calls backend API (same as web app)
- Backend fetches from Steam (server-side Steam API)
- Backend enriches with prices and float values
- Backend stores in database
- Returns stats to extension
FLOW:
1. User clicks "Sync Full Inventory" button
2. Popup → Background → POST /api/steam/inventory/sync
3. Backend (Investment API):
- Fetches Steam inventory
- Converts to JSON
- Enriches with market prices
- Stores in portfolio table
4. Returns: {success, added, updated, skipped, total}
BENEFITS:
- No Steam cookie/auth issues
- Automatic price enrichment
- Automatic float value lookup
- Consistent with web app
- More reliable
Based on API docs: D:\AppADay\cs2float-checker\csfloat-api-docs\pages\steam-integration.mdx
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
alert(`Failed to sync inventory:\n${error.message}\n\nTroubleshooting:\n1. Make sure you're logged into Steam\n2. Reload the extension (chrome://extensions)\n3. Try again from your inventory page`);
556
+
alert(`Failed to sync inventory:\n${error.message}\n\nMake sure:\n1. You're logged into SteamLedger\n2. Your Steam account is linked\n3. Your Steam inventory is set to Public`);
0 commit comments