npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

proba-sdk-react-native

v1.0.0

Published

Mobile AB-testing SDK

Downloads

4

Readme

proba-sdk-react-native

React Native wrapper for Proba SDK (ios, android)

Installation

Note that RN SDK currently doesn't support projects with RN < 0.62.
If you want to use RN SDK in your project, please, upgrade your project to RN >= 0.62

Common steps

install library

Yarn:

yarn add proba-sdk-react-native

npm:

npm install --save proba-sdk-react-native

Platform-specific steps

iOS

1. Swift support step
use_frameworks! # You already use it in your project!

# add next lines of code:

pre_install do |installer|
  installer.pod_targets.each do |pod|
    if pod.name.eql?('proba-sdk-react-native')
      def pod.build_type; # Uncomment one line depending on your CocoaPods version
        Pod::BuildType.static_library # Pods version >= 1.9 (uncommented by default)
        # Pod::Target::BuildType.static_library # Pods version < 1.9
      end
    end
  end
end
  1. In XCode, in the project navigator, right click your [your project's name] folder, choose ➜ Add Files to [your project's name]

Create Swift File

  1. Select Swift FileNext

Create Swift File

  1. Specify name for example Dummy.swiftCreate

Create Swift File

  1. Now a pop up is shown select Create Bridging Header

Create Swift File

2. Pods installation step
cd ios && pod install && cd ..

Android

You no need to do anything!

Usage

import ProbaSdk from 'proba-sdk-react-native';

Initialization:

const connected = await ProbaSdk.connect({
  appId: 'YOUR_APP_ID',
  sdkToken: 'YOUR_SDK_TOKEN',
  deviceId: 'YOUR_DEVICE_ID', // optional, UUID generated by default
  appsFlyerId: 'YOUR_APPSFLYER_ID', // optional, null by default, use appsFlyer.getAppsFlyerUID if AppsFlyer integration is needed
  amplitudeUserId: 'YOUR_AMPLITUDE_ID', // optional, null by default, use id that you set with `amplitudeInstance.setUserId` method if Amplitude integration is needed
  deviceProperties: {
    installedAt: '2021-05-20T09:55:05.000+03:00',
  }, // optional, empty object by default, additional information about device. You can use next data types: String, Number, Boolean, Date.
  usingShake: false, // false by default, cause React Native already uses shake motion in debug mode for own purposes (show React Native debug window after shaking your device)
  defaults: {
    ['TEST_1_KEY']: 'TEST_1_DEFAULT_VALUE',
    ['TEST_2_KEY']: 'TEST_2_DEFAULT_VALUE',
  },
}); // boolean

How to fetch known test values that associated with your device?

const fetched = await ProbaSdk.fetch(); // boolean

How to get the value for a specific test?

const experiments = await ProbaSdk.getExperiments(); // object with experiments

// or if you need additional details for experiments
// const experiments = await ProbaSdk.getExperimentsWithDetails(); // object with experiments

const value = experiments['TEST_1_KEY']; // string

In case of problems with no internet connection or another, the values obtained in the previous session will be used, or if they are missing, the default values specified during initialization will be used.

How to get user tests for analytics?

const experiments = await ProbaSdk.getExperiments(); // object with experiments

// or if you need additional details for experiments
// const experiments = await ProbaSdk.getExperimentsWithDetails(); // object with experiments

// example: send to amplitude and appsflyer

// https://github.com/amplitude/Amplitude-ReactNative
const amplitudeInstance = Amplitude.getInstance();
amplitudeInstance.init('Your Amplitude key');
amplitudeInstance.setUserProperties(experiments);

// https://github.com/AppsFlyerSDK/appsflyer-react-native-plugin
try {
  await appsFlyer.initSdk(/*object with options*/);
  appsFlyer.setAdditionalData(experiments, (res) => {
    /*...*/
  });
} catch (err) {}

How to debug?

Before debug make sure that debug-mode for your App is turned-on on settings page

const connected = await ProbaSdk.connect({
  //...
  showLogs: true, // false by default, to print all debugging info in the console (note that currently you can see logs in XCode or Android Studio but not in JS console)
  //...
});

const duration = await ProbaSdk.getLastOperationDurationMillis(); // number (the duration of the last operation in milliseconds)

In debug mode you can see all actual tests and check how the user will see each option of the test. To show the debug activity you just need to turn it on in your personal cabinet and call

const isDebugModeLaunched = await ProbaSdk.launchDebugMode(); // boolean

Platform specific (optional info for React Native project)

You can find more info about debug menu usage in iOS and Android here: ios, android

==================================================

You can see the example of usage here
For additional info you also can see docs of native Proba SDK (ios, android)

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT