@datadog/mobile-react-native
Version:
A client-side React Native module to interact with Datadog
85 lines • 3.69 kB
TypeScript
import type { AutoInstrumentationConfiguration, DatadogProviderConfiguration, PartialInitializationConfiguration } from './DdSdkReactNativeConfiguration';
import { DdSdkReactNativeConfiguration } from './DdSdkReactNativeConfiguration';
import type { TrackingConsent } from './TrackingConsent';
import type { Attributes } from './sdk/AttributesSingleton/types';
import type { UserInfo } from './sdk/UserInfoSingleton/types';
/**
* This class initializes the Datadog SDK, and sets up communication with the server.
*/
export declare class DdSdkReactNative {
private static readonly DD_SOURCE_KEY;
private static readonly DD_SDK_VERSION;
private static readonly DD_VERSION;
private static readonly DD_VERSION_SUFFIX;
private static readonly DD_REACT_NATIVE_VERSION;
private static wasAutoInstrumented;
private static features?;
/**
* Initializes the Datadog SDK.
* @param configuration the configuration for the SDK library
* @returns a Promise.
*/
static initialize: (configuration: DdSdkReactNativeConfiguration) => Promise<void>;
private static initializeNativeSDK;
/**
* FOR INTERNAL USE ONLY.
*/
static _initializeFromDatadogProvider: (configuration: DatadogProviderConfiguration) => Promise<void>;
/**
* FOR INTERNAL USE ONLY.
*/
static _enableFeaturesFromDatadogProvider: (features: AutoInstrumentationConfiguration) => void;
static _enableFeaturesFromDatadogProviderAsync: (features: AutoInstrumentationConfiguration) => Promise<void>;
/**
* FOR INTERNAL USE ONLY.
*/
static _initializeFromDatadogProviderWithConfigurationAsync: (configuration: PartialInitializationConfiguration) => Promise<void>;
/**
* Adds a set of attributes to the global context attached with all future Logs, Spans and RUM events.
* To remove an attribute, set it to `undefined` in a call to `setAttributes`.
* @param attributes: The global context attributes.
* @returns a Promise.
*/
static setAttributes: (attributes: Attributes) => Promise<void>;
/**
* Set the user information.
* @deprecated UserInfo id property is now mandatory (please user setUserInfo instead)
* @param user: The user object (use builtin attributes: 'id', 'email', 'name', and/or any custom attribute).
* @returns a Promise.
*/
static setUser: (user: UserInfo) => Promise<void>;
/**
* Sets the user information.
* @param id: A mandatory unique user identifier (relevant to your business domain).
* @param name: The user name or alias.
* @param email: The user email.
* @param extraInfo: Additional information.
* @returns a Promise.
*/
static setUserInfo: (userInfo: {
id: string;
name?: string;
email?: string;
extraInfo?: Record<string, unknown>;
}) => Promise<void>;
/**
* Set the user information.
* @param extraUserInfo: The additional information. (To set the id, name or email please user setUserInfo).
* @returns a Promise.
*/
static addUserExtraInfo: (extraUserInfo: Record<string, unknown>) => Promise<void>;
/**
* Set the tracking consent regarding the data collection.
* @param trackingConsent: One of TrackingConsent values.
* @returns a Promise.
*/
static setTrackingConsent: (consent: TrackingConsent) => Promise<void>;
/**
* Clears all data that has not already been sent to Datadog servers
* @returns a Promise
*/
static clearAllData: () => Promise<void>;
private static buildConfiguration;
private static enableFeatures;
}
//# sourceMappingURL=DdSdkReactNative.d.ts.map