1.0.7 • Published 8 months ago

shinara-react-native-sdk v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

Shinara React Native SDK

This SDK provides a simple interface for integrating Shinara into your React Native application.

Installation

You can install the SDK using npm or yarn:

npm i shinara-react-native-sdk

or

yarn add shinara-react-native-sdk

Usage

Import Library

import ShinaraSDK from 'shinara-react-native-sdk';

Initialize Client

Initializes Shinara SDK and monitors In App Purchases to Attribute Conversion

await ShinaraSDK.initialize('API_KEY');

Validate Referral Code

Validates Affiliate's Referral Code Note: Call validateReferralCode before In App Purchase for successful Attribution linking of Purchase and Affiliate

await ShinaraSDK.validateReferralCode({code: 'Code'});

Attribute Purchase

To attribute a purchase. Recommended to call this after successful in app purchase. Shinara will handle logic to only attribute purchase coming from a referral code

ShinaraSDK.attributePurchase('in-app-purchase-product', 'in-app-purchase-transaction-id')

Register a user (Optional)

By default, Shinara creates a new random userId and assign it to a conversion. Use registerUser if you want to use your own internal user id.

ShinaraSDK.registerUser({userId: 'internal_user_id', name: '', email: '', phone: ''})