Registry / communication / react-native-converted-in-sdk

react-native-converted-in-sdk

JSON →
library1.1.0jsnpmunverified

The `react-native-converted-in-sdk` package provides a React Native bridge for integrating the ConvertedIn tracking and analytics SDKs into both iOS and Android applications. It simplifies the process of incorporating e-commerce event tracking, such as 'view content', 'add to cart', 'initiate checkout', and 'purchase', as well as user identification features. The current stable version is 1.1.0, with a recent history of rapid releases (September 2024) addressing bug fixes and minor feature enhancements, indicating active development. A key differentiator is its dual API approach, offering both a functional `initializeSDK` method and a `RNConvertInSDKProvider` component with a `useConvertedInSdk` hook for flexible integration patterns. The library ships with TypeScript type definitions, improving developer experience. ConvertedIn itself is a marketing operating system for e-commerce, focusing on personalized multi-channel marketing to boost customer engagement and ROI.

npm install react-native-converted-in-sdk
INSTALL
IMPORT
SIG · REACT-NATIVE-CONVE
R
react-native-converted-in-sdk
communicationjavascriptv1.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

initializeSDK
import { initializeSDK } from 'react-native-converted-in-sdk';
const initializeSDK = require('react-native-converted-in-sdk').initializeSDK;
Primarily used for manual, root-level SDK initialization without the Provider component. The package ships with TypeScript types, favoring ESM imports.
RNConvertInSDKProvider
import { RNConvertInSDKProvider } from 'react-native-converted-in-sdk';
import RNConvertInSDKProvider from 'react-native-converted-in-sdk';
This is a named export for the context Provider component, not a default export. Used for declarative initialization and providing the SDK context to child components.
useConvertedInSdk
import { useConvertedInSdk } from 'react-native-converted-in-sdk';
A React hook designed for convenient access to SDK methods within functional components when using the `RNConvertInSDKProvider`.
identifyUser
import { identifyUser } from 'react-native-converted-in-sdk';
One of the core tracking methods for user identification. Can be used directly after `initializeSDK` or via the `useConvertedInSdk` hook.

This quickstart demonstrates how to initialize the ConvertedIn SDK using the `RNConvertInSDKProvider` and how to use the `useConvertedInSdk` hook to identify users and track e-commerce events like 'Purchase' within a React Native component. It showcases both provider-based setup and direct method calls.

import React, { useEffect } from 'react'; import { SafeAreaView, Text, Button, Alert } from 'react-native'; import { RNConvertInSDKProvider, useConvertedInSdk } from 'react-native-converted-in-sdk'; const AppContent = () => { const { initializeSDK, identifyUser, trackEvent, isInitialized } = useConvertedInSdk(); useEffect(() => { if (!isInitialized) { // This is a redundant call if using RNConvertInSDKProvider, but shows manual initialization if not wrapped initializeSDK({ pixelId: process.env.CONVERTEDIN_PIXEL_ID ?? 'CI-YOUR_PIXEL_ID', storeUrl: process.env.CONVERTEDIN_STORE_URL ?? 'https://your-store.com', }); } console.log('SDK Initialized:', isInitialized); }, [initializeSDK, isInitialized]); const handleIdentifyUser = () => { identifyUser("user@example.com", "+1", "5551234567"); Alert.alert("User Identified", "Check console for details."); }; const handleTrackPurchase = () => { trackEvent( 'Purchase', { currency: 'USD', total: 99.99, products: [ { id: 'SKU123', quantity: 1, name: 'Sample Product' }, ], } ); Alert.alert("Event Tracked", "Purchase event sent."); }; return ( <SafeAreaView style={{ flex: 1, justifyContent: 'center', alignItems: 'center', gap: 20 }}> <Text style={{ fontSize: 20, fontWeight: 'bold' }}>ConvertedIn SDK Demo</Text> <Button title="Identify User" onPress={handleIdentifyUser} /> <Button title="Track Purchase Event" onPress={handleTrackPurchase} /> <Text style={{ marginTop: 20 }}>SDK Initialized: {isInitialized ? 'Yes' : 'No'}</Text> </SafeAreaView> ); }; export default function App() { return ( <RNConvertInSDKProvider pixelId={process.env.CONVERTEDIN_PIXEL_ID ?? 'CI-YOUR_PIXEL_ID'} storeUrl={process.env.CONVERTEDIN_STORE_URL ?? 'https://your-store.com'} > <AppContent /> </RNConvertInSDKProvider> ); }
Debug
Known issues
breakingVersions prior to `v1.0.1` had known issues causing crashes on iOS. It is strongly recommended to use `v1.0.1` or newer for stable iOS compatibility.
fix
Upgrade to `react-native-converted-in-sdk@1.0.1` or later: `npm install react-native-converted-in-sdk@latest` or `yarn add react-native-converted-in-sdk@latest`.
affects: <1.0.1
breakingVersions prior to `v1.0.2` had known issues causing crashes on Android, often related to missing native packages or incorrect configuration. Update to `v1.0.2` or later for Android stability.
fix
Upgrade to `react-native-converted-in-sdk@1.0.2` or later: `npm install react-native-converted-in-sdk@latest` or `yarn add react-native-converted-in-sdk@latest`.
affects: <1.0.2
gotchaThis library requires manual linking steps for both iOS and Android native projects, even with auto-linking in React Native. Ensure you add the Podfile entry for iOS and Gradle configurations for Android as specified in the installation guide.
fix
For iOS: Add `pod 'react-native-converted-in-sdk', :path => '../node_modules/react-native-converted-in-sdk'` to your `Podfile` and run `pod install`. For Android: Add `include ':react-native-converted-in-sdk'` and `project(':react-native-converted-in-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-converted-in-sdk/android')` to `settings.gradle`, and `implementation project(':react-native-converted-in-sdk')` to `app/build.gradle`. Then run `./gradlew sync`.
affects: >=1.0.0
gotchaPrior to `v1.0.2`, the package lacked proper TypeScript type definitions, leading to potential type errors and a diminished developer experience when using TypeScript. Developers using older versions will miss type inference and autocompletion.
fix
Upgrade to `react-native-converted-in-sdk@1.0.2` or later to benefit from included TypeScript definitions: `npm install react-native-converted-in-sdk@latest` or `yarn add react-native-converted-in-sdk@latest`.
affects: <1.0.2
gotchaAny SDK method call before initialization (either via `initializeSDK` or the `RNConvertInSDKProvider`) will throw an error with the message: "SDK must be initialized before calling this method".
fix
Always ensure the SDK is initialized at the root of your application, or verify initialization status before calling any tracking or identification methods.
affects: >=1.0.0
Errors
Common errors & fixes
Invariant Violation: 'main' has not been registered. This can happen if:
This error often indicates an issue with the React Native app's entry point, or a native module crash preventing the JavaScript bundle from loading correctly.
fix
Given past issues, ensure you are on `v1.0.2` or newer, and all native linking steps for both iOS (Podfile) and Android (Gradle) are correctly applied, and run `pod install` (iOS) and `./gradlew sync` (Android).
TypeError: null is not an object (evaluating 'RNConvertedinSdk.initializeSDK')
This means the native module `RNConvertedinSdk` was not properly linked or initialized by React Native's bridge, common on iOS if `pod install` was skipped or failed.
fix
Verify that `pod install` was run in your `ios/` directory, and that the `react-native-converted-in-sdk` entry is correctly present in your `Podfile`. Clean your Xcode build folder and rebuild.
Could not find com.github.convertedin:android-pixel-sdk:latest. Required by: project :app > project :react-native-converted-in-sdk
This Android build error suggests a failure to resolve the underlying native Android SDK dependency, likely due to incorrect Gradle setup or repository access issues.
fix
Ensure your `android/settings.gradle` and `android/app/build.gradle` files contain the correct `include` and `implementation` lines as per the installation instructions, and sync your Gradle project (`./gradlew sync`). Also ensure you have `mavenCentral()` or `google()` repositories configured in your `build.gradle` files.
Property 'identifyUser' does not exist on type 'typeof import("react-native-converted-in-sdk")'
This TypeScript error indicates that the TypeScript compiler cannot find the `identifyUser` method (or similar) in the imported module, often due to missing or outdated type definitions.
fix
Upgrade to `react-native-converted-in-sdk@1.0.2` or later to get proper type definitions. If already on a recent version, ensure your `tsconfig.json` is correctly configured and your `node_modules` are clean (`rm -rf node_modules && yarn install`).
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
reactrequiredPeer dependency for any React Native application.
react-nativerequiredPeer dependency as it's a React Native module.
Agent activity
30 hits · last 30 days
node
26
OpenAI (training)
1
Resources
react-native-converted-in-sdk — npm install react-native-converted-in-sdk · libregistry