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

@farfetch/blackout-react-native-riskified-integration

v0.6.4

Published

Riskified integration for @farfetch/blackout-react-native-analytics

Downloads

30

Readme

@farfetch/blackout-react-native-riskified-integration

Riskified integration for @farfetch/blackout-react-native-analytics.

Installation

yarn

yarn add @farfetch/blackout-react-native-riskified-integration

npm

npm i @farfetch/blackout-react-native-riskified-integration

Peer dependencies

Make sure that you have installed the correct Farfetch's peer dependencies:

Autolinking

Due to a bug on the @react-native-community/cli package, you will need to add a react-native.config.js file to the root of your react native project and declare the packageName for android project there, so that the cli can detect the correct package name for compilation:

// react-native.config.js
module.exports = {
  project: {
    android: {
      packageName: 'package name of your android app',
    },
  },
};

Usage

You will need to add the Omnitracking integration from @farfetch/blackout-react-native-analytics to your analytics instance.

import analytics, {
} from '@farfetch/blackout-react-native-analytics';
import Riskified from '@farfetch/blackout-react-native-riskified-integration';
import Omnitracking from '@farfetch/blackout-react-native-analytics/integrations/omnitracking';

// Add the integration to analytics instance
analytics.addIntegration('riskified', Riskified, {
  shopName: 'my shop name', // Required: The name of your Riskified account.
  token: '00000000-aaaa-0000-aaaa-000000000000', // Optional: The associated session token
  // A valid entry must exist in either `eventsToLog` or `screensToLog` options in order to the integration be correctly configured
  eventsToLog: {
    [eventTypes.PRODUCT_VIEWED]:
      'URL that will be logged when a PRODUCT_VIEWED event is tracked in analytics',
  },
  screensToLog: {
    [screenTypes.HOMEPAGE]:
      'URL that will be logged when the HOMEPAGE screen is tracked in analytics',
  },
});

// Add `Omnitracking` integration is required for this integration to work correctly
analytics.addIntegration('omnitracking', Omnitracking);

Options

| Option name | Type | Required | Description | | -------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- | | shopName | string | yes | The name of your Riskified account. | | token | string | no | A unique identifier that is generated for the user’s current browsing session. If not provided, then user.localId will be used instead. | | eventsToLog | object | yes¹ | An object that contains a map of an event type to a URL string | | screensToLog | object | yes¹ | An object that contains a map of a screen type to a URL string |

¹ - Either eventsToLog or screensToLog must be passed with an object containing at least one entry.

Session token

If you provide a session token through the token option, make sure you are using the same token in Omnitracking integration through the correlationId context value so that order data that is sent to Riskified service contain the same session identifier in its cart_token property. If no session token is provided, user.localId is used instead and this value will be the same value that will be used in Omnitracking integration's correlationId field.

Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

Please read the CONTRIBUTING file to know what we expect from your contribution and the guidelines you should follow.

License

MIT @ Farfetch