---
agentTools:
  projectIndex: https://docs.rainway.com/llms.txt
---

# Node.js SDK - RainwaySDK.connect()

[Home](https://docs.rainway.com/reference/about) > [@rainway/native](nodejs-sdk) > [RainwaySDK](./nodejs-sdk-rainwaysdk) > [connect](./nodejs-sdk-rainwaysdk-connect)

## RainwaySDK.connect() method

Connects to the Rainway network, creating a [RainwayConnection](./nodejs-sdk-rainwayconnection) if successful. This is the first step required to connect to other [Peer](./nodejs-sdk-peer)s on the Rainway network, or to allow them to connect to you.

<b>Signature:</b>

```typescript
connect(options: ConnectOptions): Promise<RainwayConnection>;
```

## Parameters

| Parameter | Type                                          | Description        |
| --------- | --------------------------------------------- | ------------------ |
| options   | [ConnectOptions](./nodejs-sdk-connectoptions) | connection options |

<b>Returns:</b>

Promise<[RainwayConnection](./nodejs-sdk-rainwayconnection)>

A new connection