# React

## 1. Installation

To install the Preventor Web SDK, add the following to your project’s:

1. Add `https://sdk.preventor.com/pvtidaas/broker/broker.esm.js` in your `public/index.html`.

```html
<script
    type="module"
    src="https://sdk.preventor.com/pvtidaas/broker/broker.esm.js"
></script>
```

2\. Setup the button in your component file

```tsx
import React, { useEffect, useRef } from "react";

export default function App() {
  const pvtButtonRef = useRef(null);
  useEffect(() => {
    window.PvtBrokerSDK = YOUR_CONFIGURATION;
  }, []);

  return <pvt-broker ref={pvtButtonRef}></pvt-broker>;
}
```

{% hint style="success" %}
You have successfully installed the Preventor Web SDK!
{% endhint %}
