{"id":29946103,"url":"https://github.com/wingify/vwo-fme-react-native-sdk","last_synced_at":"2026-01-20T17:28:39.452Z","repository":{"id":269412857,"uuid":"906199767","full_name":"wingify/vwo-fme-react-native-sdk","owner":"wingify","description":"VWO Feature Management and Experimentation SDK for React Native","archived":false,"fork":false,"pushed_at":"2025-07-25T12:52:28.000Z","size":462,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-08-03T05:22:28.074Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://developers.vwo.com/v2/docs/fme-react-native","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wingify.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-20T11:24:35.000Z","updated_at":"2025-07-25T12:52:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"e7bef363-1df5-45dc-bf90-69201f0ac011","html_url":"https://github.com/wingify/vwo-fme-react-native-sdk","commit_stats":null,"previous_names":["wingify/vwo-fme-react-native-sdk"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/wingify/vwo-fme-react-native-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-fme-react-native-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-fme-react-native-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-fme-react-native-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-fme-react-native-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wingify","download_url":"https://codeload.github.com/wingify/vwo-fme-react-native-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wingify%2Fvwo-fme-react-native-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273886638,"owners_count":25185509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-03T05:12:49.572Z","updated_at":"2026-01-20T17:28:39.441Z","avatar_url":"https://github.com/wingify.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VWO Feature Management and Experimentation SDK for React Native\n\n[![npm version](https://img.shields.io/npm/v/vwo-fme-react-native-sdk?style=for-the-badge\u0026color=green\u0026logo=npm)](https://www.npmjs.com/package/vwo-fme-react-native-sdk)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge)](http://www.apache.org/licenses/LICENSE-2.0)\n\n## Overview\n\nThe **VWO Feature Management and Experimentation SDK** (VWO FME iOS SDK) enables iOS developers to integrate feature flagging and experimentation into their applications. This SDK provides full control over feature rollout, A/B testing, and event tracking, allowing teams to manage features dynamically and gain insights into user behavior.\n\n\n## Installation\n\n```bash\n# via yarn\nyarn add vwo-fme-react-native-sdk\n\n# via npm\nnpm install vwo-fme-react-native-sdk\n```\n\nFor iOS, install the CocoaPods dependencies by running below command. Supports iOS version 12.0 and above.\n\n```bash\ncd ios \u0026\u0026 pod install\n```\n\n## Official Documentation\n\nFor more detailed documentation, please refer [here](https://developers.vwo.com/v2/docs/fme-react-native-install).\n\n## Basic Usage\n\n```javascript\nimport { init } from 'vwo-fme-react-native-sdk';\n\nimport {\n  VWOInitOptions,\n  VWOUserContext,\n  GetFlagResult,\n} from 'vwo-fme-react-native-sdk/src/types';\n\nlet vwoClient;\n\n// initialize sdk\nuseEffect(() =\u003e {\n  const initializeSDK = async () =\u003e {\n    const options: VWOInitOptions = { sdkKey: SDK_KEY, accountId: ACCOUNT_ID };\n    try {\n      vwoClient = await init(options);\n      // console.log('VWO init success');\n    } catch (error) {\n      // console.error('Error initialising', error);\n    }\n  };\n\n  initializeSDK();\n}, []);\n\n// create user context\nconst userContext: VWOUserContext = { id: 'unique_user_id', customVariables: {key_1: 0, key_2: 1} };\n\n// get feature flag\nconst flagResult: GetFlagResult = await vwoClient.getFlag('feature_key', userContext);\n\n// check if flag is enabled\nconst isEnabled = flagResult.isEnabled();\n\n// get the variable value for the given variable key and default value\nconst variableValue = flagResult.getVariable('feature_flag_variable_key', 'default_value');\n\n// track event for the given event name with event properties\nconst eventProperties = { 'amount': 99 };\nvwoClient.trackEvent('vwo_event_name', userContext, eventProperties);\n\n// send attributes data\nconst attributes = { attr1: value1, attr2: value2 };\nvwoClient.setAttribute(attributes, userContext);\n```\n\n\n## Advanced Configuration Options\nTo customize the SDK further, additional parameters can be passed to the `VWOInitOptions` initializer. Here’s a table describing each option:\n\n\n| **Parameter**                | **Description**                                                                                                                                             | **Required** | **Type** | **Example**                     |\n| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | -------- | ------------------------------- |\n| `accountId`                  | VWO Account ID for authentication.                                                                                                                          | Yes          | number      | `123456`                        |\n| `sdkKey`                     | SDK key corresponding to the specific environment to initialize the VWO SDK Client. You can get this key from VWO Application.                              | Yes          | String   | `\"32-alpha-numeric-sdk-key\"`    |\n| `logLevel`                   | The level of logging to be used.                                                                                                                            | No           | Enum     | `LogLevel.debug`                        |\n| `logPrefix`                  | A prefix to be added to log messages.                                                                                                                        | No           | String   | `\"VWO\"`                         |\n| `pollInterval`               | Time interval for fetching updates from VWO servers (in milliseconds).                                                                                      | No           | Int64    | `60000`                         |\n| `integrations`               | To use callback function to handle integration events.                                                                                                             | No           | Bool | `true` |\n| `cachedSettingsExpiryTime`   | Expiry time for cached settings in milliseconds.                                                                                                            | No           | number    | `3600000`                       |\n| `batchMinSize`               | Minimum size of batch to upload.                                                                                                                            | No           | number      | `10`                            |\n| `batchUploadTimeInterval`    | Batch upload time interval in milliseconds.                                                                                                                 | No           | Int64    | `300000`                        |\n| `maxRetries`                 | Maximum number of retry attempts for SDK initialization (default: 1).                                                                                       | No           | number      | `1`                            |\n| `retryDelayMs`               | Delay between retry attempts in milliseconds (default: 2000).                                                                                               | No           | number      | `2000`                         |\n| `initTimeoutMs`              | Timeout for SDK initialization in milliseconds (default: 15000).                                                                                            | No           | number      | `15000`                        |\n\n### Additional Callbacks\n\n- **Integration Callback**: Use `VWO.registerIntegrationCallback` to manage integration events. Refer [documentation](https://developers.vwo.com/v2/docs/fme-react-native-integrations)\n\n- **Log Callback**: Use `VWO.registerLogCallback` to capture and handle log events.  Refer [documentation](https://developers.vwo.com/v2/docs/fme-react-native-logging)\n\n\n\nRefer to the [official VWO documentation](https://developers.vwo.com/v2/docs/fme-react-native-install) for additional parameter details.\n\n\n### User Context\n\nThe `context` object uniquely identifies users and is crucial for consistent feature rollouts. A typical `context` includes an `id` for identifying the user. It can also include other attributes that can be used for targeting and segmentation, such as `customVariables`.\n\n#### Parameters Table\n\nThe following table explains all the parameters in the `context` object:\n\n| **Parameter**     | **Description**                                                            | **Required** | **Type** | **Example**                       |\n| ----------------- | -------------------------------------------------------------------------- | ------------ | -------- | --------------------------------- |\n| `id`              | Unique identifier for the user.                                            | Yes          | String   | `'unique_user_id'`                |\n| `customVariables` | Custom attributes for targeting.                                           | No           | Object   | `{ age: 25, location: 'US' }`     |\n\n#### Example\n\n```javascript\nimport {  VWOUserContext } from 'vwo-fme-react-native-sdk/src/types';\n\nconst userContext: VWOUserContext = { id: 'unique_user_id', customVariables: { age: 25, location: 'US' } };\n```\n\n### Basic Feature Flagging\n\nFeature Flags serve as the foundation for all testing, personalization, and rollout rules within FME.\nTo implement a feature flag, first use the `getFlag` API to retrieve the flag configuration.\nThe `getFlag` API provides a simple way to check if a feature is enabled for a specific user and access its variables. It returns a feature flag object that contains methods for checking the feature's status and retrieving any associated variables.\n\n| Parameter    | Description                                                      | Required | Type   | Example              |\n| ------------ | ---------------------------------------------------------------- | -------- | ------ | -------------------- |\n| `featureKey` | Unique identifier of the feature flag                            | Yes      | String | `'new_checkout'`     |\n| `context`    | Object containing user identification and contextual information | Yes      | VWOUserContext | `{ id: 'unique_user_id', customVariables: {key_1: 0, key_2: 1} }` |\n\n\nExample usage:\n\n```javascript\nimport {  VWOUserContext, GetFlagResult } from 'vwo-fme-react-native-sdk/src/types';\n\nconst userContext: VWOUserContext = { id: 'unique_user_id', customVariables: {key_1: 0, key_2: 1} };\n\n// get feature flag\nconst flagResult: GetFlagResult = await vwoClient.getFlag('new_checkout', userContext);\n\n// check if flag is enabled\nconst isEnabled = flagResult.isEnabled();\n\nif (isEnabled) {\n  console.log('Feature is enabled!');\n\n  // get all variables of feature flag\n  const allVariables = flagResult.getVariables();\n\n  // get the variable value for the given variable key and default value\n  const variableValue = flagResult.getVariable('feature_flag_variable_key', 'default_value');\n\n} else {\n  console.log('Feature is not enabled!');\n}\n```\n\n### Custom Event Tracking\n\nFeature flags can be enhanced with connected metrics to track key performance indicators (KPIs) for your features. These metrics help measure the effectiveness of your testing rules by comparing control versus variation performance, and evaluate the impact of personalization and rollout campaigns. Use the `trackEvent` API to track custom events like conversions, user interactions, and other important metrics:\n\n| Parameter         | Description                                                            | Required | Type   | Example                |\n| ----------------- | ---------------------------------------------------------------------- | -------- | ------ | ---------------------- |\n| `eventName`       | Name of the event you want to track                                    | Yes      | String | `'purchase_completed'` |\n| `context`    | Object containing user identification and contextual information | Yes      | VWOUserContext | `{ id: 'unique_user_id' }` |\n| `eventProperties` | Additional properties/metadata associated with the event               | No       | Object | `{ amount: 49.99 }`    |\n\nExample usage:\n\n```javascript\nconst userContext: VWOUserContext = { id: 'unique_user_id' };\n\nvwoClient.trackEvent('purchase_completed', userContext, { amount: 49.99 });\n```\nSee [Tracking Conversions](https://developers.vwo.com/v2/docs/fme-react-native-metrics#usage) documentation for more information.\n\n\n### Pushing Attributes\n\nUser attributes provide rich contextual information about users, enabling powerful personalization. The `setAttribute` method provides a simple way to associate these attributes with users in VWO for advanced segmentation. Here's what you need to know about the method parameters:\n\n| Parameter        | Description                                                            | Required | Type   | Example                        |\n| ---------------- | ---------------------------------------------------------------------- | -------- | ------ | ------------------------------ |\n| `attributes`     | An object containing key-value pairs of attributes to set              | Yes      | Object | `{ 'plan_type': 'premium', 'age': 30, 'isActive': true }`   |\n| `context`    | Object containing user identification and contextual information | Yes      | VWOUserContext | `{ id: 'unique_user_id' }` |\n\nExample usage:\n\n```javascript\nconst userContext: VWOUserContext = { id: 'unique_user_id' };\n\nconst attributes = { plan_type: 'premium', age: 25 };\nvwoClient.setAttribute(attributes, userContext);\n```\n\nSee [Pushing Attributes](https://developers.vwo.com/v2/docs/fme-react-native-attributes#usage) documentation for additional information.\n\n### Polling Interval Adjustment\n\nThe `pollInterval` is an optional parameter that allows the SDK to automatically fetch and update settings from the VWO server at specified intervals. Setting this parameter ensures your application always uses the latest configuration.\n\nExample usage:\n\n```javascript\nconst options: VWOInitOptions = { sdkKey: SDK_KEY, accountId: ACCOUNT_ID, pollInterval: 600000 }; // 10 minutes\nvwoClient = await init(options);\n```\n\n### Cached Settings Expiry Time\n\nThe `cachedSettingsExpiryTime` parameter allows you to specify how long the cached settings should be considered valid before fetching new settings from the VWO server. This helps in managing the freshness of the configuration data.\n\nExample usage:\n\n```javascript\nconst options: VWOInitOptions = { sdkKey: SDK_KEY, accountId: ACCOUNT_ID, cachedSettingsExpiryTime: 600000 }; // 10 minutes\nvwoClient = await init(options);\n```\n\n### Event Batching Configuration\n\nThe VWO SDK supports 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. Additionally, 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.\n\n#### NOTE: The batching will trigger based on whichever condition is met first if using both options.\n\n| **Parameter**               | **Description**                                                                                     | **Required** | **Type** | **Example** |\n| --------------------------- | --------------------------------------------------------------------------------------------------- | ------------ | -------- | ----------- |\n| `batchMinSize`              | Minimum size of the batch to upload.                                                               | No           | number      | `10`        |\n| `batchUploadTimeInterval`   | Batch upload time interval in milliseconds. Please specify at least a few minutes.                  | No           | number    | `300000`    |\n\nExample usage:\n\n```javascript\nconst options: VWOInitOptions = { sdkKey: SDK_KEY, accountId: ACCOUNT_ID, batchMinSize: 10, batchUploadTimeInterval: 300000 }; // 5 minutes\nvwoClient = await init(options);\n```\n\n## Authors\n\n* [Vishwajeet Singh](https://github.com/vishwajeet-wingify)\n\n## Changelog\n\nRefer [CHANGELOG.md](https://github.com/wingify/vwo-fme-react-native-sdk/blob/master/CHANGELOG.md)\n\n## Contributing\n\nPlease go through our [contributing guidelines](https://github.com/wingify/vwo-fme-react-native-sdk/blob/master/CONTRIBUTING.md)\n\n## Code of Conduct\n\n[Code of Conduct](https://github.com/wingify/vwo-fme-react-native-sdk/blob/master/CODE_OF_CONDUCT.md)\n\n## License\n\n[Apache License, Version 2.0](https://github.com/wingify/vwo-fme-react-native-sdk/blob/master/LICENSE)\n\nCopyright 2024-2025 Wingify Software Pvt. Ltd.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwingify%2Fvwo-fme-react-native-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwingify%2Fvwo-fme-react-native-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwingify%2Fvwo-fme-react-native-sdk/lists"}