Releases: wingify/vwo-fme-react-native-sdk
Releases · wingify/vwo-fme-react-native-sdk
Version 1.5.0
Version 1.4.0
[1.4.0] - 2025-03-11
Added
-
Added support for storing impression events while the device is offline, ensuring no data loss. These events are batched and seamlessly synchronized with VWO servers once the device reconnects to the internet.
-
Online event batching allows synchronization of impression events while the device is online. This feature can be configured by setting either the minimum batch size or the batch upload time interval during SDK initialization.
-
Support for sending multiple attributes at once.
const attributes = { attr1: value1, attr2: value2 }; vwoClient.setAttribute(attributes, userContext);
-
Support for configuring SDK when linking with VWO Mobile Insights SDK. This can be configured by setting session data received via callback from Mobile Insights SDK
const options: VWOInitOptions = { sdkKey: SDK_KEY, accountId: ACCOUNT_ID }; vwoClient = await init(options); vwoClient.setSessionData(sessionInfo); // sessionInfo is received from Mobile Insights SDK via a callback function
Version 1.0.0
The first release of Feature Management and Experimentation capabilities for react-native SDK
Basic Usage
import { init } from 'vwo-fme-react-native-sdk';
import {
VWOInitOptions,
VWOContext,
GetFlagResult,
} from 'vwo-fme-react-native-sdk/src/types';
let vwoClient;
// initialize sdk
useEffect(() => {
const initializeSDK = async () => {
const options: VWOInitOptions = { sdkKey: SDK_KEY, accountId: ACCOUNT_ID };
try {
vwoClient = await init(options);
// console.log('VWO init success');
} catch (error) {
console.error('Error initialising', error);
}
};
initializeSDK();
}, []);
// create user context
const userContext: VWOContext = { id: 'unique_user_id', customVariables: {key_1: 0, key_2: 1} };
// get feature flag
const flagResult: GetFlagResult = await vwoClient.getFlag('feature_key', userContext);
// check if flag is enabled
const isEnabled = flagResult.isEnabled();
// get the variable value for the given variable key and default value
const variableValue = flagResult.getVariable('feature_flag_variable_key', 'default_value');
// track event for the given event name with event properties
const eventProperties = { 'amount': 99 };
vwoClient.trackEvent('vwo_event_name', userContext, eventProperties);
// send attributes data
vwoClient.setAttribute('attribute_name', 'attribute_value', userContext);