# Module: stream

### Methods

#### (inner) connect(apiKey, apiSecretopt, appIdopt, optionsopt) → {StreamClient}

Create StreamClient

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`apiKey` | string |  | API key
`apiSecret` | string | <optional> | API secret (only use this on the server)
`appId` | string | <optional> | Application identifier

`options`

object

<optional>

Additional options

###### Properties

Name | Type | Attributes | Description
--- | --- | --- | ---
`location` | string | <optional> | Datacenter location

Source:
  - getstream.js, line 11

##### Returns:

StreamClient

Type
  StreamClient

##### Examples

Basic usage

    stream.connect(apiKey, apiSecret);

or if you want to be able to subscribe and listen

    stream.connect(apiKey, apiSecret, appId);

or on Heroku

    stream.connect(streamURL);

where streamURL looks like

    "https://thierry:pass@gestream.io/?app=1"