Skip to main content

Utility methods

Inspect SDK state or update context at runtime. The plugin's init is async; some helpers are synchronous accessors after initialization completes.

import { CoralogixRum } from '@coralogix/react-native-plugin';

// Confirm the SDK is initialized.
const initialized = CoralogixRum.isInited;

// Read the current session ID.
const sessionId = await CoralogixRum.getSessionId();

// Read the current user context or labels.
const user = CoralogixRum.getUserContext();
const labels = CoralogixRum.getLabels();

// Update the application context after init.
CoralogixRum.setApplicationContext({ application: 'my-app', version: '1.2.0' });

Log severity shorthand methods

The plugin exposes shorthand methods for each log severity in addition to the full log(severity, message, data, labels) form:

CoralogixRum.debug('debug message');
CoralogixRum.verbose('verbose message');
CoralogixRum.info('info message');
CoralogixRum.warn('warn message');
CoralogixRum.error('error message', { context: 'value' });
CoralogixRum.critical('critical message');
Last updated on
On this page
Was this page helpful?