Setup
Web
The Kloudfuse RUM SDK is available as a package on npm. To get started instrumenting your frontend application include the Kloudfuse RUM SDK dependency in your application:
npm install --save kf-browser-sdk
The SDK needs to be initialized before it begins gathering frontend telemetry. This initialization should occur as early as possible in your applications loading phase. Customize and include the below code snippet:
import kfuseRumSDK from 'kf-browser-sdk';
kfuseRumSDK.init({
config: {
applicationId: '<APPLICATION_ID>',
clientToken: '<CLIENT_TOKEN>',
proxy: '<KFUSE_RUM_ENDPOINT>',
service: '<APPLICATION_NAME>',
env: 'production',
version: '1.0.0',
sessionSampleRate: 100,
defaultPrivacyLevel: 'mask', 'mask-user-input' | 'allow'
enableSessionRecording: true,
enableLogCollection: true,
},
});
The permitted configuration options are documented below:
applicationId
: a UUID that uniquely identifies a specific frontend application. All RUM telemetry will be associated with it.clientToken
: a token that identifies valid producers of RUM telemetry. You may supply the valuedummy
here if the kloudfuse installation does not have authenticated ingestion enabled. If authenticated ingestion is enable this value should match one of the configured auth tokens for RUM (see Step 5 on the Enable RUM on Customer’s Kloudfuse installation page)proxy
: the Kloudfuse ingest endpoint for RUM events. Its value would behttps://<kfuse-public-endpoint>/ddrumproxy
service
: a friendly name unique to the the frontend application being instrumentedenv
: a name identifying a logical source of RUM events (e.g. test environment or production environment)version
: a string representing the unique frontend application build (e.g.1.0.0
)sessionSampleRate
: percentage of user sessions that will generate RUM telemetry (0 to 100)defaultPrivacyLevel
: privacy level for session replays, which can be one of three values:mask
: masks all HTML text, user input, images, links anddata-*
attributes. Text on your application is replaced withX
, rendering the page into a wireframe.mask-user-input
: Masks most form fields such as inputs, text areas, and checkbox values while recording all other text as is. Inputs are replaced with three asterisks (***
) and text areas are obfuscated with space-preservingx
characters.allow
: Records everything unmasked.
enableSessionRecording
: controls whether the users session will be recordedenableLogCollection
: controls whether frontend logs will be collected or not
Associating User Information
As soon as your application has access to user information you may provide that information to the SDK to enrich all generated telemetry. To do this add the following code snippet:
kfuseRumSDK.setUser({
id: "joebarra",
email: "joe.barra@kloudfuse.com",
})
Flutter
The Kloudfuse Flutter SDK is available as a Flutter plugin
Installation
Add the following to your
pubspec.yaml
file:Fetch the SDK with
$ flutter pub get
Initialize the SDK
applicationId
: a UUID that uniquely identifies a specific frontend application. All RUM telemetry will be associated with it.clientToken
: a token that identifies valid producers of RUM telemetry. You may supply the valuedummy
here if the kloudfuse installation does not have authenticated ingestion enabled. If authenticated ingestion is enable this value should match one of the configured auth tokens for RUM (see Step 5 on the Enable RUM on Customer’s Kloudfuse installation page)customEndpoint
: the Kloudfuse ingest endpoint for RUM events. Its value would behttps://<kfuse-public-endpoint>/ddrumproxy
service
: a friendly name unique to the the frontend application being instrumentedenv
: a name identifying a logical source of RUM events (e.g. test environment or production environment)version
: a string representing the unique frontend application build (e.g.1.0.0
)sessionSamplingRate
: percentage of user sessions that will generate RUM telemetry (0 to 100)
React Native
The Kloudfuse React Native SDK is available as an NPM package
Install
Use your favorite package manager to install the Kloudfuse React Native SDK
Install the added pod
Initialize the sdk in your App
applicationId
: a UUID that uniquely identifies a specific frontend application. All RUM telemetry will be associated with it.clientToken
: a token that identifies valid producers of RUM telemetry. You may supply the valuedummy
here if the kloudfuse installation does not have authenticated ingestion enabled. If authenticated ingestion is enable this value should match one of the configured auth tokens for RUM (see Step 5 on the Enable RUM on Customer’s Kloudfuse installation page)proxy
: the Kloudfuse ingest endpoint for RUM events. Its value would behttps://<kfuse-public-endpoint>/ddrumproxy
service
: a friendly name unique to the the frontend application being instrumentedenv
: a name identifying a logical source of RUM events (e.g. test environment or production environment)version
: a string representing the unique frontend application build (e.g.1.0.0
)sessionSamplingRate
: percentage of user sessions that will generate RUM telemetry (0 to 100)