1.1.2 • Published 9 months ago

@riskified/react-native-riskified-sdk v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

react-native-riskified-sdk

Riskified's react native wrapper for mobile SDK's

Installation

npm install @riskified/react-native-riskified-sdk

Usage

import RiskifiedSdk from '@riskified/react-native-riskified-sdk';

// On main page load
RiskifiedSdk.startBeacon(
  shopDomain: string,
  token: string,
  debug: boolean
): Promise<void>;

// On significant events and page visits
RiskifiedSdk.logRequest(
  requestUrl: string
): Promise<void>;

// If session ID updates for the user
RiskifiedSdk.updateSessionToken(
  newToken: string
): Promise<void>;

// To render OTP widget
RiskifiedSdk.renderOtpWidget(
  widgetToken: string,
  environment: 'sandbox' | 'staging' | 'production',
  debug: boolean
): Promise<string>;

// example for rendering the OTP widget
RiskifiedSdk.renderOtpWidget('token123', 'sandbox', true)
    .then((challengeAccessToken : string) => {
        // handle success verification
    })
    .catch((error) => {
        if (error.code === 'timeout') {
            // handle timeout
        } else if (error.code === 'widget_closed') {
            // handle close
        } else {
            // handle other errors
        }
    });

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

1.1.2

9 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.1

3 years ago

0.1.0

3 years ago