Skip to main content

Proxy URL

Proxy URL​

Set proxyUrl to send the SDK's uploads to your own server instead of straight to Coralogix. This covers all RUM data and session replay uploads, on both iOS and Android.

import 'package:cx_flutter_plugin/cx_domain.dart';
import 'package:cx_flutter_plugin/cx_exporter_options.dart';
import 'package:cx_flutter_plugin/cx_flutter_plugin.dart';

Future<void> initCoralogix() async {
var options = CXExporterOptions(
coralogixDomain: CXDomain.eu2,
environment: 'production',
application: 'my-app',
version: '1.0.0',
publicKey: '<PublicKey>',
enableSwizzling: true,
proxyUrl: 'https://proxy.example.com/rum',
);

await CxFlutterPlugin.initSdk(options);
}

The SDK sends each upload to the proxy as a POST with a cxforward query parameter. It holds the Coralogix endpoint the request was meant for, for example https://ingress.eu2.rum-ingress-coralogix.com/browser/v1beta/logs. Your proxy must forward each request to that URL with the same body and headers, including Authorization, which carries your public key.

Note

Use a proxy URL without a query string. On iOS the SDK replaces the query string with cxforward, so any parameters you add there never reach your proxy.

Leave proxyUrl unset to send data straight to Coralogix.

Last updated on
On this page
Was this page helpful?