---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# `EdgeRateLimiter()`

The **`EdgeRateLimiter` constructor** lets you open an epen a [ERL](https://docs.fastly.com/products/edge-rate-limiting) with the given ratecounter and penaltybox.


>**Note**: Can only be used when processing requests, not during build-time initialization.

## Syntax

```js
new EdgeRateLimiter(rateCounter, penaltyBox)
```

> **Note:** `EdgeRateLimiter()` can only be constructed with `new`. Attempting to call it without `new` throws a [`TypeError`](../../globals/TypeError/TypeError.mdx).

### Parameters

- `rateCounter` _: RateCounter_
  - The RateCounter instance to associate with this EdgeRateLimiter instance
- `penaltyBox` _: PenaltyBox_
  - The PenaltyBox instance which should be associated with this EdgeRateLimiter instance

### Return value

A new `EdgeRateLimiter` object.

### Exceptions

- `TypeError`
  - Thrown if the provided rateCounter value is not an instance of RateCounter
  - Thrown if the provided penaltyBox value is not an instance of PenaltyBox

