@splitsoftware/splitio-react
Version:
A React library to easily integrate and use Split JS SDK
16 lines (15 loc) • 937 B
TypeScript
import { ISplitContextValues, IUseSplitClientOptions } from './types';
/**
* `useSplitClient` is a hook that returns an Split Context object with the client and its status corresponding to the provided key.
*
* @param options - An options object with an optional `splitKey` to retrieve the client, optional `attributes` to configure the client, and update options to control on which SDK events the hook should update.
* @returns A Split Context object merged with the client and its status.
*
* @example
* ```js
* const { factory, client, isReady, isReadyFromCache, hasTimedout, lastUpdate } = useSplitClient({ splitKey: 'user_id' });
* ```
*
* @see {@link https://developer.harness.io/docs/feature-management-experimentation/sdks-and-infrastructure/client-side-sdks/javascript-sdk/#advanced-instantiate-multiple-sdk-clients}
*/
export declare function useSplitClient(options?: IUseSplitClientOptions): ISplitContextValues;