import FeatureFlagManager from '../core/featureFlags/featureFlagManager'; import Logger from '../core/logging/logger'; import { ContentsquareModule } from '../core/nativeModules'; const { featureFlags } = FeatureFlagManager; /** * Set the URL masking patterns. This API allows you to mask any URL path. By default, the API errors feature collects the URL path of the failed API requests. To prevent the collection of Personal Data in the URL path, you can configure the masking patterns using this method. This ensures sensitive data is replaced or removed. * * Example: Given the pattern "www.example.com/user/:user_id", all matching URLs will be masked as follows: * * Original URLs: * "www.example.com/user/198?param=value" * "www.example.com/user/199?param=value" * * Masked Output: * "www.example.com/user/CS_ANONYMIZED_USER_ID?param=value" */ export const setUrlMaskingPatterns = (patterns: string[]): void => { ContentsquareModule.setUrlMaskingPatterns(patterns); }; /** * Triggers crash in native code * Use this only for testing purposes */ export const triggerNativeCrash = (): void => { if (featureFlags.crashReporter) { ContentsquareModule.triggerNativeCrash(); } else { Logger.warn('The Crash Reporter feature is disabled.'); } };