# SubscriptionParams

**Kind**: interface | **Module**: [Interop](https://docs.interop.io/desktop/reference/javascript/interop/index.md)

**Source**: https://docs.interop.io/desktop/reference/javascript/interop/subscriptionparams/index.html

Optional object with parameters passed to [`subscribe()`](https://docs.interop.io/desktop/reference/javascript/interop/api/index.md#API-subscribe) when subscribing to a stream.

## Properties

- **`arguments`** (`object`, optional)
  A plain JavaScript object (or JSON) holding key/value pairs passed as named arguments to the handler of the registered Interop stream.
- **`methodResponseTimeout`** (`number`, optional) default: `30000`
  Timeout to wait for a stream reply.
- **`onClosed`** (`() => void`, optional)
  Subscribe for the event which fires when the subscription is closed.
- **`onConnected`** (`(server: Instance, reconnect: boolean) => void`, optional)
  Subscribe for the event which your subscription is connected to a server
- **`onData`** (`(data: StreamData) => void`, optional)
  Subscribe for the event which fires when new data is received.
- **`target`** (`InstanceTarget`, optional)
  Specifies which servers to target. Can be one of: "best", "all", [`Instance`](https://docs.interop.io/desktop/reference/javascript/interop/instance/index.md), `Instance[]`.
- **`waitTimeoutMs`** (`number`, optional) default: `30000`
  Timeout to discover the stream, if not immediately available.

## Related types

- [Instance](https://docs.interop.io/desktop/reference/javascript/interop/instance/index.md)
- [InstanceTarget](https://docs.interop.io/desktop/reference/javascript/interop/instancetarget/index.md)
- [StreamData](https://docs.interop.io/desktop/reference/javascript/interop/streamdata/index.md)
