# Revolink Integration

A lightweight plugin for integrating Revolink redirect flows to handle and track external link redirects.

## Installation

```bash
npm install revolink-npm
```

## Usage

```javascript
import { initializeRevolinkFlow } from 'revolink-npm';

// Initialize with revolink flow integration
initializeRevolinkFlow({
    clientKey: 'your-client-key',
    flowKey: 'your-flow-key',
    redirectingDomains: ['example.com', 'affiliate.com'],  // Optional: allow redirect only to specific domains
    excludedDomains: ['trusted.com', 'myother.com'],       // Optional: exclude certain domains from redirecting
    showConsentPopup: true,                                // Optional (default: true): show consent popup
    consentPopupText: 'Some links may redirect through a short partner link. By clicking Accept, you agree.' 
});
```

### Parameters

| Name                      | Type     | Required | Default                 | Description                                                            |
|---------------------------|----------|----------|-------------------------|------------------------------------------------------------------------|
| `clientKey`               | string   | ✅        | —                       | Your Revolink client key                                              |
| `flowKey`                 | string   | ✅        | —                       | Your Revolink flow key                                                |
| `redirectingDomains`      | string[] | ❌        | `[]`                    | Domains eligible for redirection (if set, only these domains will be redirected) |
| `excludedDomains`         | string[] | ❌        | `[]`                    | Domains that should never be redirected                               |
| `disableConsentPopup`     | boolean  | ❌        | `false`                 | Whether to show the user consent popup                                |
| `consentPopupText`        | string   | ❌        | **Our default message** | Custom text displayed inside the popup message               |
