{"id":25076,"library":"clevertap-react-native","title":"CleverTap React Native SDK","description":"CleverTap React Native SDK v4.1.0 provides a native bridge to CleverTap's mobile customer engagement and analytics platform for React Native apps (requires react-native >=0.65.0). The SDK supports push notifications, in-app notifications (including Picture-in-Picture, GIF, and video), user segmentation, event tracking, and A/B testing. It ships with TypeScript definitions and supports New Architecture on React Native >=0.71. Releases typically align with CleverTap’s iOS and Android SDKs every few months. Key differentiators: native performance, deep integration with CleverTap's dashboard, and support for rich media in-app templates.","status":"active","version":"4.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/CleverTap/clevertap-react-native","tags":["javascript","analytics","android","clevertap","in-app","ios","notification","push","react","typescript"],"install":[{"cmd":"npm install clevertap-react-native","lang":"bash","label":"npm"},{"cmd":"yarn add clevertap-react-native","lang":"bash","label":"yarn"},{"cmd":"pnpm add clevertap-react-native","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for the React Native bridge and native modules.","package":"react-native","optional":false}],"imports":[{"note":"The default import is the recommended way to use the SDK. CommonJS require() may work but is not recommended for ESM projects.","wrong":"const CleverTap = require('clevertap-react-native');","symbol":"default import","correct":"import CleverTap from 'clevertap-react-native';"},{"note":"The SDK exports a default object, not a named export. Named import will result in undefined.","wrong":"import { CleverTap } from 'clevertap-react-native';","symbol":"CleverTap","correct":"import CleverTap from 'clevertap-react-native';"},{"note":"registerForPush is a method on the default export, not a standalone function.","wrong":"CleverTap.registerForPush()","symbol":"registerForPush","correct":"import CleverTap from 'clevertap-react-native';\nCleverTap.registerForPush();"},{"note":"onUserLogin accepts a profile object. For older versions (<3.0), the method was 'onUserLogin' with callback; check changelog for breaking changes.","wrong":"CleverTap.onUserLogin(...)","symbol":"onUserLogin","correct":"import CleverTap from 'clevertap-react-native';\nCleverTap.onUserLogin({...});"}],"quickstart":{"code":"import CleverTap from 'clevertap-react-native';\n\n// Initialize (auto if installed correctly)\n// Record an event\nCleverTap.recordEvent('Product Viewed', {\n  'Product Name': 'Casio Watch',\n  'Category': 'Mens Accessories'\n});\n\n// Set user profile\nCleverTap.onUserLogin({\n  'Name': 'John Doe',\n  'Email': 'john.doe@example.com',\n  'Phone': '+14155551234'\n});\n\n// Register for push notifications\nCleverTap.registerForPush();\n\n// Fetch in-app notifications\nCleverTap.recordEvent('App Launched');","lang":"typescript","description":"Basic setup: record events, set user profile, register push, and trigger in-app notifications."},"warnings":[{"fix":"Update react-native to >=0.65.0. See the version support table in README.","message":"v4.0.0 requires React Native >=0.65.0 and drops support for older versions.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use `import CleverTap from 'clevertap-react-native'`.","message":"Default import only: using named import `{ CleverTap }` results in undefined.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Migrate to new signature: `CleverTap.onUserLogin(profileObject)`.","message":"The `onUserLogin` callback signature changed in v3.0.0; old callback style no longer works.","severity":"deprecated","affected_versions":"<3.0.0"},{"fix":"Integrate push templates as per the documentation.","message":"iOS Push Templates SDK requires additional setup: follow docs/iospushtemplates.md.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Refer to the CleverTap Huawei Push Integration guide.","message":"Android: for Huawei push, changed integration steps since v3.4.0. See guide.","severity":"gotcha","affected_versions":">=3.4.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `import CleverTap from 'clevertap-react-native'`.","cause":"Wrong import syntax: named import instead of default import.","error":"Error: `CleverTap` is undefined when using `import { CleverTap } from 'clevertap-react-native'`"},{"fix":"Ensure you are using default import and the SDK version is >=3.0.0.","cause":"Importing the module incorrectly or using an outdated version of the SDK.","error":"TypeError: CleverTap.recordEvent is not a function"},{"fix":"For RN <0.60, run `react-native link clevertap-react-native`. For iOS, ensure `cd ios && pod install`. For New Architecture, ensure enabled.","cause":"Native module not linked properly (for RN <0.60) or pods not installed (iOS).","error":"Native Module: CleverTap is undefined (React Native)"},{"fix":"Use `CleverTap.onUserLogin({...})` with a profile object. Update SDK to >=3.0.0.","cause":"Using an outdated callback pattern from older SDK versions.","error":"Invariant Violation: `onUserLogin` is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}