@launchdarkly/react-native-client-sdk
Version:
React Native LaunchDarkly SDK
36 lines • 1.48 kB
TypeScript
import { AutoEnvAttributes, ConnectionMode, LDClientImpl } from '@launchdarkly/js-client-sdk-common';
import LDOptions from './RNOptions';
/**
* The React Native LaunchDarkly client. Instantiate this class to create an
* instance of the ReactNativeLDClient and pass it to the {@link LDProvider}.
*
* @example
* ```tsx
* const featureClient = new ReactNativeLDClient(MOBILE_KEY, AutoEnvAttributes.Enabled);
*
* <LDProvider client={featureClient}>
* <Welcome />
* </LDProvider>
* ```
*/
export default class ReactNativeLDClient extends LDClientImpl {
private _connectionManager;
/**
* Creates an instance of the LaunchDarkly client.
*
* @param sdkKey The LaunchDarkly mobile key.
* @param autoEnvAttributes Enable / disable Auto environment attributes. When enabled, the SDK will automatically
* provide data about the mobile environment where the application is running. To learn more,
* read [Automatic environment attributes](https://docs.launchdarkly.com/sdk/features/environment-attributes).
* for more documentation.
* @param options {@link LDOptions} to initialize the client with.
*/
constructor(sdkKey: string, autoEnvAttributes: AutoEnvAttributes, options?: LDOptions);
setConnectionMode(mode: ConnectionMode): Promise<void>;
/**
* Gets the SDK connection mode.
*/
getConnectionMode(): ConnectionMode;
isOffline(): boolean;
}
//# sourceMappingURL=ReactNativeLDClient.d.ts.map