{"_id":"@deeptaai/klaritics-react-native-sdk","name":"@deeptaai/klaritics-react-native-sdk","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@deeptaai/klaritics-react-native-sdk","version":"1.0.0","description":"React Native Klaritics SDK","homepage":"https://deeptaai.com/","keywords":["react-native","ios","android"],"license":"MIT","author":{"name":"Kousik Dasari","email":"kousik.d@deeptaai.com"},"main":"lib/commonjs/index.js","module":"lib/module/index.js","types":"lib/typescript/index.d.ts","react-native":"src/index.tsx","scripts":{"lint":"eslint . --ext .ts,.tsx,.js,.jsx","build":"bob build"},"devDependencies":{"@types/react":"^18.3.3","@types/react-native":"^0.73.0","eslint":"^8.57.0","eslint-config-custom":"workspace:*","metro-react-native-babel-preset":"^0.77.0","react":"^18.3.1","react-native":"^0.74.3","react-native-builder-bob":"^0.24.0","tsconfig":"workspace:*","typescript":"^5.5.3"},"peerDependencies":{"react":"*","react-native":"*"},"peerDependenciesMeta":{"react":{"optional":false},"react-native":{"optional":false}},"_id":"@deeptaai/klaritics-react-native-sdk@1.0.0","gitHead":"6c3de44c029bc661bfa963b3d6264dad2780aaa5","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-7H9HqZ7PbKMx1YQJWBTHZqnCO13lV0FblaikNY/lCW3SUBTI11bVqQ7eUXo1mPiyYZXisITC0Rc+57TzRgnybQ==","shasum":"1b15d6d7dde8e59c6a1e8e3f63e8ee5cbe959e71","tarball":"https://registry.npmjs.org/@deeptaai/klaritics-react-native-sdk/-/klaritics-react-native-sdk-1.0.0.tgz","fileCount":28,"unpackedSize":139134,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDPeLgG/FTtMpAQwT4biXeruESGyAr8JuGvW0u4DIvOmQIgfiHZIX47iYdBvSnfXZreEHZRBI3whn90aKHQLkLlads="}]},"_npmUser":{"name":"kousikd","email":"kousik.d@deeptaai.com"},"directories":{},"maintainers":[{"name":"mahesh.pikki","email":"mahesh.p@deeptaai.com"},{"name":"deepta-ai","email":"dev@deeptaai.com"},{"name":"kousikd","email":"kousik.d@deeptaai.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/klaritics-react-native-sdk_1.0.0_1788511152249_0.044452529707311506"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-04T08:39:12.068Z","1.0.0":"2026-09-04T08:39:12.401Z","modified":"2026-09-04T08:39:12.686Z"},"maintainers":[{"name":"mahesh.pikki","email":"mahesh.p@deeptaai.com"},{"name":"deepta-ai","email":"dev@deeptaai.com"},{"name":"kousikd","email":"kousik.d@deeptaai.com"}],"description":"React Native Klaritics SDK","homepage":"https://deeptaai.com/","keywords":["react-native","ios","android"],"author":{"name":"Kousik Dasari","email":"kousik.d@deeptaai.com"},"license":"MIT","readme":"<h1 align=\"center\">@deeptaai/klaritics-react-native-sdk</h1>\n\n<p align=\"center\">\n  <a href=\"https://npmjs.com/package/@deeptaai/klaritics-react-native-sdk\"><img src=\"https://img.shields.io/npm/v/@deeptaai/klaritics-react-native-sdk?style=for-the-badge&labelColor=000000\" alt=\"npm-v\"></a>\n  <a href=\"https://npmjs.com/package/@deeptaai/klaritics-react-native-sdk\"><img src=\"https://img.shields.io/npm/dt/@deeptaai/klaritics-react-native-sdk.svg?style=for-the-badge&labelColor=000000\" alt=\"npm-d\"></a>\n  <a href=\"https://bundlephobia.com/result?p=@deeptaai/klaritics-react-native-sdk\"><img src=\"https://img.shields.io/bundlephobia/minzip/@deeptaai/klaritics-react-native-sdk?style=for-the-badge&labelColor=000000\" alt=\"minzip\"></a>\n</p>\n\n## Description\n\nReact Native SDK for **Klaritics**. You write your integration **once in JavaScript** — the\nsame code runs on both Android and iOS. You never write native Java/Kotlin or Swift/Objective-C.\n\n---\n\n## 🏁 Getting Started\n\nInstall the package:\n\n```bash\nnpm install @deeptaai/klaritics-react-native-sdk\n# or\nyarn add @deeptaai/klaritics-react-native-sdk\n```\n\nReact Native `0.60+` **autolinks** the native module, so there is no `react-native link`,\nno `MainApplication` edits, and no `settings.gradle` changes.\n\n- **Android** — ready after install. See [Android](#-android).\n- **iOS** — run `pod install`; the Klaritics core is fetched and wired automatically. See [iOS](#-ios).\n\n---\n\n## ⚙️ Initialize\n\nWrap your app in `KlariticsProvider` — this is the only setup you write, and it initializes\nthe SDK on **both** platforms:\n\n```jsx\nimport { KlariticsProvider } from '@deeptaai/klaritics-react-native-sdk'\n\nexport default function App() {\n  return (\n    <KlariticsProvider apiKey=\"YOUR_APP_ID\" options={{ host: 'YOUR_HOST' }}>\n      {/* your app */}\n    </KlariticsProvider>\n  )\n}\n```\n\nPrefer to initialize imperatively? Call `setup` once, early in your app's lifecycle:\n\n```js\nimport { setup } from '@deeptaai/klaritics-react-native-sdk'\n\nsetup('YOUR_APP_ID', { host: 'YOUR_HOST' })\n```\n\n> The app id and host are provided here at runtime — you do **not** put them in\n> `AndroidManifest.xml`, `Info.plist`, or Gradle.\n\n---\n\n## 🤖 Android\n\nThe Klaritics Android SDK is pulled in **automatically** via autolinking — the AAR is declared\nas a dependency of this package and resolved from its Maven repository at build time. There are\n**no manual steps**: no `MainApplication` edits, no manifest `meta-data`, and no app id in Gradle.\n\n> **If Android dependency resolution fails** because your app uses Gradle's centralized\n> `dependencyResolutionManagement` with `RepositoriesMode.FAIL_ON_PROJECT_REPOS`, add the\n> Klaritics Maven repo to `android/settings.gradle`:\n>\n> ```groovy\n> dependencyResolutionManagement {\n>   repositories {\n>     maven { url \"https://asia-south1-maven.pkg.dev/org-infra-471907/klaritics-android-sdk\" }\n>   }\n> }\n> ```\n\n---\n\n## 🍎 iOS\n\niOS is **zero-config** — just run `pod install`:\n\n```sh\nnpm install @deeptaai/klaritics-react-native-sdk\ncd ios && pod install\n```\n\nReact Native autolinking picks up this package's podspec, which fetches the prebuilt\n**Klaritics** core framework and wires up the headers, linking, and embedding for you. There\nare **no Xcode steps, no Podfile edits, and nothing to add manually** — this mirrors how the\nAndroid side pulls the core from Maven.\n\nThen initialize from JavaScript exactly as shown in [Initialize](#️-initialize) — the same\n`KlariticsProvider` / `setup` call drives iOS. No `AppDelegate` code is required.\n\n---\n\n## 🚀 API & Usage\n\n### Imports\n\n```javascript\n// Import the SDK as a module\nimport Klaritics from '@deeptaai/klaritics-react-native-sdk'\n\n// Or, import required functions\nimport { logAppEvent, trackScreen } from '@deeptaai/klaritics-react-native-sdk'\n```\n\n### Set Custom User IDs\n\n```javascript\n// Syntax\nKlaritics.setUserIdentifier('user_id')\n\n// Example\nKlaritics.setUserIdentifier('john@doe.com')\n```\n\n### Set Custom User and Session Properties\n\n```javascript\n// Syntax\nKlaritics.setUserCustomInfo(properties)\nKlaritics.setSessionCustomInfo(properties)\n\n// Example\nKlaritics.setUserCustomInfo({\n  city: 'Hyderabad',\n  age: 12,\n})\n```\n\n### Logging Events\n\n```javascript\n// Syntax\nKlaritics.logAppEvent(event_name, properties)\n\n// Example\nKlaritics.logAppEvent('ADD_TO_CART', {\n  userId: 'user@example.com',\n  value: 1299,\n  item: 'Sony Head Phone 1201',\n})\n```","readmeFilename":"README.md","_rev":"1-3c9fe93e8b02f6dd9f3c35e82665a166"}