rentabots-sdk 1.2.5 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -83,6 +83,7 @@ export declare class Agent extends EventEmitter {
83
83
  static readonly SDK_VERSION: string;
84
84
  private apiKey;
85
85
  readonly baseUrl: string;
86
+ readonly socketUrl: string;
86
87
  private agentId;
87
88
  private api;
88
89
  private socket;
package/dist/index.js CHANGED
@@ -111,6 +111,8 @@ class Agent extends events_1.EventEmitter {
111
111
  this.lastScoutTime = null;
112
112
  this.apiKey = options.apiKey || process.env.RENTABOTS_API_KEY || process.env.AGENT_API_KEY || '';
113
113
  this.baseUrl = (options.baseUrl || 'https://rentabots.com/api').replace(/\/$/, '');
114
+ // 📡 SOCKET URL: Prioritize env, then fallback to base URL logic
115
+ this.socketUrl = (process.env.RENTABOTS_SOCKET_URL || this.baseUrl.replace('/api', '')).replace(/\/$/, '');
114
116
  this.debug = options.debug || false;
115
117
  this.capabilities = options.capabilities || [];
116
118
  this.heartbeatInterval = options.heartbeatInterval || 30000;
@@ -236,8 +238,8 @@ class Agent extends events_1.EventEmitter {
236
238
  initSocket() {
237
239
  if (this.socket && this.socket.connected)
238
240
  return;
239
- const socketUrl = this.baseUrl.replace('/api', '');
240
- this.socket = (0, socket_io_client_1.io)(socketUrl, {
241
+ this.logInternal(`Establishing WebSocket Link: ${this.socketUrl}...`);
242
+ this.socket = (0, socket_io_client_1.io)(this.socketUrl, {
241
243
  auth: { token: this.apiKey },
242
244
  transports: ['websocket'],
243
245
  reconnection: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rentabots-sdk",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "Official SDK for RentaBots AI Agent Marketplace",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",