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

# Node.js SDK - PeerRequestEvent.(constructor)

[Home](https://docs.rainway.com/reference/about) > [@rainway/native](nodejs-sdk) > [PeerRequestEvent](./nodejs-sdk-peerrequestevent) > [(constructor)](./nodejs-sdk-peerrequestevent-constructor-)

## PeerRequestEvent.(constructor)

Constructs a new instance of the `PeerRequestEvent` class

<b>Signature:</b>

```typescript
constructor(owner: RainwayConnection, input: RainwayIncomingConnectionRequestType, onAccepted?: (peer: Peer) => void, onRejected?: (reason?: string) => void);
```

## Parameters

| Parameter  | Type                                                                                      | Description |
| ---------- | ----------------------------------------------------------------------------------------- | ----------- |
| owner      | [RainwayConnection](./nodejs-sdk-rainwayconnection)                                       |             |
| input      | [RainwayIncomingConnectionRequestType](./nodejs-sdk-rainwayincomingconnectionrequesttype) |             |
| onAccepted | (peer: [Peer](./nodejs-sdk-peer)) => void                                                 |             |
| onRejected | (reason?: string) => void                                                                 |             |