Skip to content

Documentation / @imvu/imq / IMQConnectionOptions

Interface: IMQConnectionOptions ​

Defined in: packages/imq/src/IMQConnection.ts:22

Properties ​

createStream? ​

ts
createStream?: (url) => IMQStream;

Defined in: packages/imq/src/IMQConnection.ts:35

Transport factory. Defaults to a stream over the global WebSocket. Override to supply a different transport — or a test double.

Parameters ​

ParameterType
urlstring

Returns ​

IMQStream


logger? ​

ts
logger?: IMQLogger;

Defined in: packages/imq/src/IMQConnection.ts:50

Diagnostics sink for unhandled warnings. Defaults to console.


metadata? ​

ts
metadata?: Record<string, string>;

Defined in: packages/imq/src/IMQConnection.ts:30

Arbitrary connect metadata (e.g. { app: 'imvu_next', platform_type: 'big' }).


newOpId? ​

ts
newOpId?: () => number;

Defined in: packages/imq/src/IMQConnection.ts:37

Monotonic op_id generator, shared with the manager. Defaults to an internal counter.

Returns ​

number


onReconnect? ​

ts
onReconnect?: (msSinceLastMessage) => Promise<void | Partial<IMQConnectionOptions>>;

Defined in: packages/imq/src/IMQConnection.ts:48

Invoked before each reconnect attempt with the time since the last server frame. Return partial options to merge in (e.g. a refreshed sessionId).

Parameters ​

ParameterType
msSinceLastMessagenumber

Returns ​

Promise<void | Partial<IMQConnectionOptions>>


pingInterval? ​

ts
pingInterval?: number;

Defined in: packages/imq/src/IMQConnection.ts:39

Ping keepalive interval, ms. Default 15_000.


reconnect? ​

ts
reconnect?: readonly number[];

Defined in: packages/imq/src/IMQConnection.ts:43

Reconnect backoff schedule, ms; the last value is reused once exhausted. Default [5s,15s,45s,90s,180s].


serverTimeoutInterval? ​

ts
serverTimeoutInterval?: number;

Defined in: packages/imq/src/IMQConnection.ts:41

Disconnect if no server frame arrives within this window, ms. Default 60_000.


sessionId ​

ts
sessionId: string;

Defined in: packages/imq/src/IMQConnection.ts:28

The session/auth cookie ("sauce").


url ​

ts
url: string;

Defined in: packages/imq/src/IMQConnection.ts:24

IMQ WebSocket URL, e.g. wss://wss-imq.imvu.com/streaming/imvu_pre.


userId ​

ts
userId: string;

Defined in: packages/imq/src/IMQConnection.ts:26

The user's legacy cid.

Released under the MIT License.