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 🙏

© 2024 – Pkg Stats / Ryan Hefner

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

v0.1.11

Published

An SDK to implement Symplify conversion for React Native

Downloads

12

Readme

mobile-sdk-react-native

An SDK to implement Symplify conversion

Installation

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

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>
  );
}

Some properties are required, some are optional. The required properties are:

  • env: The environment to use. This needs to be set to "PROD".
  • siteId: This needs to match the website ID in the Symplify UI.
  • userId: This is optional. If no userId is provided a userId (UUID) will be generated and used.

Components

SymProject encapsulates the SymVariants. In this way you can have several projects in the app. If no SymProject is used to wrap the SymVariants, the default project is used. This means that there can only be one project, otherwise an exceptions will be thrown.

<SymProject name="Symplify DEMO sst">
    <SymVariation name="Original">
      <Text>I'm the Original</Text>
    </SymVariation>

    <SymVariation name="Variant 1">
      <Text>I'm Variant 1</Text>
    </SymVariation>
</SymProject>

Here we use a SymProject, which means if we have more then one project we'll specify which project to use. We place two variants in the project. Which variant that will be used/shown is randomized. If a goal is set, then an event will be pushed with the goal value. Otherwise no events will be sent.

To register a visit for a user that have been allocated a project and a variation you can use a SymAppView component. This will send an app view event to the backend.

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)
  • 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.

Contributing

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

License

MIT


Made with create-react-native-library