# Before send and transport

Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fuser-guides%2Frum%2Fsdk-installation%2Fjavascript%2Fbrowser-sdk%2Fconfiguration%2Fbefore-send-and-transport.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fuser-guides%2Frum%2Fsdk-installation%2Fjavascript%2Fbrowser-sdk%2Fconfiguration%2Fbefore-send-and-transport.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

### Before Send[​](#before-send "Direct link to Before Send")

Enable event access and modification before sending to Coralogix, supporting content modification, and event discarding.

```
CoralogixRum.init({

  // ...

  beforeSend: (event) => {

    // Discard events from @company.com users.

    if (event.session_context.user_email?.endsWith('@company.com')) {

      return null;

    }



    // Redact sensitive information from the page URL.

    event.page_context.page_url = event.page_context.page_url.replace('sensitive-info', 'redacted');



    return event;

  },

});
```

### Proxy Url[​](#proxy-url "Direct link to Proxy Url")

Proxy configuration to route requests.<br />By specifying a proxy URL, all RUM data will be directed to this URL via the POST method. However, it is necessary for this data to be subsequently relayed from the proxy to Coralogix. The Coralogix route for each request that is sent to the proxy is available in the request’s cxforward parameter (for example, <https://www.your-proxy.com/endpoint?cxforward=https%3A%2F%2Fingress.eu1.rum-ingress-coralogix.com%2Fbrowser%2Fv1beta%2Flogs>).

```
CoralogixRum.init({

  // ...

  coralogixDomain: 'EU1',

  proxyUrl: 'https://www.your-proxy.com/endpoint',

});
```

#### ignoreProxyUrlParams[​](#ignoreproxyurlparams "Direct link to ignoreProxyUrlParams")

If you want the SDK to ignore the cxforward parameter and always send data to the proxy URL directly, you can use the ignoreProxyUrlParams option. By default, this option is disabled.

```
CoralogixRum.init({

  // ...

  coralogixDomain: 'EU1',

  proxyUrl: 'https://proxy.mycompany.com/rum',

  ignoreProxyUrlParams: true,

});
```

### Ingress URL[​](#ingress-url "Direct link to Ingress URL")

`coralogixDomain` resolves your account's ingress endpoint from the supported Coralogix regions and is the standard way to configure it. `coralogixDomainUrl` accepts an explicit ingress URL, for accounts whose endpoint has no corresponding `coralogixDomain` key:

```
CoralogixRum.init({

  // ...

  coralogixDomainUrl: 'https://ingress.<region>.rum-ingress-coralogix.com',

});
```

One of `coralogixDomain` or `coralogixDomainUrl` is required; initialization is aborted with a console error when neither is provided. When both are provided, `coralogixDomainUrl` takes precedence.

The value must be an absolute `http(s)` URL with no query string or fragment: the SDK appends its endpoint paths to it, so a `?` or `#` would truncate the resulting request URL. A trailing slash is accepted and normalized.

The option composes with [Proxy URL](#proxy-url): the configured ingress URL is the value the SDK places in the request's `cxforward` parameter.

### Collect IP Data[​](#collect-ip-data "Direct link to Collect IP Data")

Determines whether the SDK should collect the user's IP address and corresponding geolocation data. Defaults to true.

```
CoralogixRum.init({

  // ...

  collectIPData: true,

});
```

### SDK Fetch Priority[​](#sdk-fetch-priority "Direct link to SDK Fetch Priority")

Controls the [`priority`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit#priority) hint applied to the SDK's own network requests — the internal calls it makes to send logs and recordings to Coralogix. This is unrelated to your application's requests. When omitted, the browser uses its default (Chromium treats this as `high`), which can cause SDK traffic to compete with your application's critical requests. Set `sdkFetchPriority: 'low'` to deprioritize SDK traffic.

Accepted values: `'low'`, `'high'`, or `'auto'` (default).

```
CoralogixRum.init({

  // ...

  sdkFetchPriority: 'low',

});
```

Note

The `priority` hint only works in Chromium browsers (Chrome/Edge 101+) and is a no-op elsewhere. We type this option with our own `SdkFetchPriority` alias instead of the DOM `RequestPriority` type, so it still compiles on older TypeScript versions (the SDK supports `>= 4.4.2`).
