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/sym-mobile-sdk-react-native

v0.1.7

Published

An SDK to implement Symplify conversion

Downloads

8

Readme

sym-mobile-sdk-react-native

An SDK to implement Symplify conversion

Installation

npm install @symplify-conversion/sym-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/sym-mobile-sdk-react-native";

function AppWrapper() {
  return (
    <SymplifyProvider
      env="UAT"
      siteId="5620620"
      userId="optional-username">
      <App />
    </SymplifyProvider>
  );
}

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

  • env: The environment to use. This can be either "UAT" or "PROD".
  • siteId: The siteId for the site you want to use.
  • userId: The userId for the user you want to track. This is optional. If no userId is provided a userId will be generated.

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 project="1">
    <SymVariant goal="61" name="variant 1">
        <Text id="a press me variantcomponent">
            <Text>Press me, I'm variant 1</Text>
        </Text>
    </SymVariant>

    <SymVariant goal="62" name="original">
        <Text id="a press me original component">
            <Text>Press me, Im the original</Text>
        </Text>
    </SymVariant>
</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 shown is decided by the config file. If goal is set, then an event will be pushed with the goal value. Otherwise no events will be sent.

You can also wrap objects with a SymAppView. This will send events to the backend. If there is a SymVariant in the SymAppView this will have the SymAppView property also. This way we can filter that an object has been pressed and disregard the SymAppView event.

<SymAppView goal="59">
    <SymVariant goal="61">
        <Text id="a press me component">
            <Text>Press me</Text>
        </Text>
    </SymVariant>
</SymAppView>

In this case the SymAppView will send an event with goal 59. The SymVariant will send an event with goal 61. The SymVariant will also have a parent goal value 59. So two events will be pushed, but we can disregard the SymAppView event. The SymVariant event will also have the component id value "a press me component".

<SymAppView goal="59">
    <Text id="a press me component">
        <Text>Press me</Text>
    </Text>
</SymAppView>

In this case the SymAppView will send an event with goal 59. Please note - if you add a Pressable component inside the SymAppView, then this component might stop the events from the SymAppView to be sent.

Hooks

If you'd prefer to set a goal event or a variation in a hook, you can use the following hooks:

useGoal("Symplify DEMO sst", 9999999)

The parameters are the goal name and the goal value. This will send an event when called.

or

useVariation("Symplify DEMO sst", {})

The parameters are is the project name. Which will return the variation.

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