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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@symplify-conversion/mobile-sdk-react-native

v1.0.1

Published

An SDK to implement Symplify conversion for React Native

Readme

mobile-sdk-react-native

An SDK to implement Symplify conversion

Installation

To minimze the impact on the user experience we are using background task to check for new tests and consume the outcome of tests. We are expecting that expo-background-task is installed to do this, if not, install it in your project.

Expo

npx expo install @symplify-conversion/mobile-sdk-react-native
# if not already using expo-background-task install it explicitly
npx expo install expo-background-task

Bare react native

npx install @symplify-conversion/mobile-sdk-react-native
# if not already using expo-background-task install it explicitly, example is with help from expo
npx expo install-expo-modules@latest
npx expo install expo-background-task

Usage

Add the base component SymplifyProvider to your app. This will provide the context for the SDK and you will be able to use the Symplify components. Here's how you can use it:

import {SymplifyProvider} from "@symplify-conversion/mobile-sdk-react-native";

function AppWrapper() {
  return (
    <SymplifyProvider
      siteId="5620620">
      <App />
    </SymplifyProvider>
  );
}

The siteId is required and needs to match the website ID in the Symplify UI.

Options:

| Option | Default | Description | |----------|----------|----------| | siteId | undefined | Enter website id of the website in the Symplify UI dashboard | | logLevel | info | Accepted values: "debug", "info", "warn", "error", "disabled" | | trackingEnabled | true | Useful if consent is needed before starting to track the test. Set to true after consent. | | clearStorage | false | Set to true to get a brand new session of tracking. Useful for testing different variations and triggering goals on new userid | | foregroundConfigIntervalSeconds | undefined | Fetch new config at interval when app is in foreground, useful for debugging | | foregroundConsumeIntervalSeconds | 5 | Submit pending interactions when app is in foreground at interval. Useful when app is not paused or closed by users. | | debugBackgroundFetchURL | undefined | This URL will be called with fetch in the background together with regular config update and submit of interaction, useful for debugging. Setup with a webhook recieving site. | | userCountry | undefined | Set the current users country to be able to filter on country in the dashboard. Maximum 20 characters. | | userCountryCode | undefined | Set the current users country code to be able to filter on country code in the dashboard. Maximum 2 characters. |

Components

<SymProject name="Symplify DEMO sst" screen={route?.name}>
    <SymVariation name="Original">
      {/* 
        Your Control/Original code.
        Example;
      */}
        <Text>Original header text</Text>
    </SymVariation>

    <SymVariation name="Variation 1">
      {/* 
        Your variation code.
        Example;
      */}
        <Text>New possilby better header text</Text>
      
    </SymVariation>
    
    <SymVariation name="Default">
      {/* 
        Fallback code. This should most likely be the same as for the Original.
        The difference is that users who get the Default won't be part of the statistics for the test.
        Example;
      */}
        <Text>Original header text</Text>
    </SymVariation>
</SymProject>

Here we use a SymProject component, which means if we have more then one project we'll specify which project to use. We place two variations and a fallback (Default) in the project. Which variation that will be used/shown is randomized for each user. The name on the SymVariation needs to exactly match the name in the Symplify UI dashboard.

If the project has less than 100% (total) allocation and the user is randomized to not be part of the project the Default is used/shown. Place your fallback code in the Default.

A visit will automatically be registered for a user that has been allocated a variation for a project. For all other views you will need to add a SymAppView component to register a visit (app view event).

View event

This should be implemented on all screen views. The property 'screen' is optional but populating that will enable filtering the statistics on that.

<SymAppView screen={route.name}/>

Goal event

To register a goal you need to populate the SymAppView with eventId and trigger properties. The property 'screen' is optional but populating that will enable filtering the statistics on that.

<SymAppView eventId={59442} trigger={Trigger.PRESS} screen={route.name}>
  <Text>I will send a app goal event with id 59442 on press</Text>
</SymAppView>
  • eventId = The event id (configured in your project in the Symplify UI, see the goals for the A/B test and use the provided ID).
  • trigger = The trigger that will send the event. This can be either Trigger.PRESS (runs on press) or Trigger.VIEW (runs on render). Default is Trigger.VIEW so if you want to trigger on render there is no need to set this property.

In this case the SymAppView will send an event with eventId 59442 when the text is pressed. Please note - if you add a Pressable component inside the SymAppView, then this component might stop the events from the SymAppView to be sent.

License

MIT


Made with create-react-native-library

Release notes

1.0.1

  • Added "disabled" option for logLevel
  • Allow for trackingEnabled to be toggled without recreating the component
  • Added information to readme