{"_id":"@alvie-tech/react-native-tiktok-business-sdk","_rev":"3-cf46dcea0ad93cd7cc6d26fb2bcf48f7","name":"@alvie-tech/react-native-tiktok-business-sdk","dist-tags":{"latest":"1.7.1"},"versions":{"1.6.2":{"name":"@alvie-tech/react-native-tiktok-business-sdk","version":"1.6.2","keywords":["react-native","tiktok","business","sdk","ios","android"],"author":{"url":"https://github.com/alvie-tech","name":"Alvie","email":"tech@alvie.fr"},"license":"MIT","_id":"@alvie-tech/react-native-tiktok-business-sdk@1.6.2","maintainers":[{"name":"alvie-tech","email":"guillaumel@alvie.fr"}],"contributors":[{"url":"https://github.com/mtebele","name":"Matias Tebele","email":"mati.tebele@gmail.com"}],"homepage":"https://github.com/alvie-tech/react-native-tiktok-business-sdk#readme","bugs":{"url":"https://github.com/alvie-tech/react-native-tiktok-business-sdk/issues"},"dist":{"shasum":"d1896b21125b914b6b92b5e7e555ee59df80da7f","tarball":"https://registry.npmjs.org/@alvie-tech/react-native-tiktok-business-sdk/-/react-native-tiktok-business-sdk-1.6.2.tgz","fileCount":34,"integrity":"sha512-jEabuv/Y0CZaonZF2O1iNGmyKS1IVLZN4n6xdi/oXFLoIso4UEURrTmhCa4Rk3SJNZobus+Opb3pWJs4f/fvNA==","signatures":[{"sig":"MEQCIAHq7+7Q2QIDbtS5xFcAsdbvftBuKmK5XYcaE2jz6U01AiBkj62VUq4ypR/Lb+wTXJM8+NZwDU6OmB4xr0H+PviLmg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":140644},"jest":{"preset":"react-native","testMatch":["<rootDir>/src/__tests__/**/*.test.{ts,tsx}","<rootDir>/plugin/src/__tests__/**/*.test.ts"],"coverageReporters":["text","lcov","html"],"setupFilesAfterEnv":["<rootDir>/src/__tests__/setup.ts"],"collectCoverageFrom":["src/**/*.{ts,tsx}","plugin/src/**/*.ts","!src/**/*.d.ts","!plugin/src/**/*.d.ts","!src/__tests__/**","!plugin/src/__tests__/**"],"modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"main":"./lib/commonjs/index.js","module":"./lib/module/index.js","source":"./src/index.tsx","exports":{".":{"import":{"types":"./lib/typescript/module/src/index.d.ts","default":"./lib/module/index.js"},"require":{"types":"./lib/typescript/commonjs/src/index.d.ts","default":"./lib/commonjs/index.js"}},"./package.json":"./package.json","./app.plugin.js":"./app.plugin.js"},"gitHead":"57402e9c42230032d3ebd2e2945566a7cc1cde7e","scripts":{"lint":"eslint \"**/*.{js,ts,tsx}\"","test":"jest","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build lib plugin/build","prepare":"bob build && npm run build:plugin","release":"dotenv release-it --","typecheck":"tsc && tsc --noEmit -p plugin/tsconfig.json","build:plugin":"tsc -p plugin/tsconfig.json"},"_npmUser":{"name":"alvie-tech","email":"guillaumel@alvie.fr"},"prettier":{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"tagName":"v${version}","commitMessage":"chore: release ${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"repository":{"url":"git+https://github.com/alvie-tech/react-native-tiktok-business-sdk.git","type":"git"},"workspaces":["example"],"_npmVersion":"10.9.8","description":"A React Native bridge for the TikTok Business SDK","directories":{},"resolutions":{"@types/react":"^18.2.44","conventional-changelog-conventionalcommits":"9.0.0"},"_nodeVersion":"22.22.3","eslintConfig":{"root":true,"rules":{"prettier/prettier":["error",{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"}],"react/react-in-jsx-scope":"off"},"extends":["@react-native","prettier"]},"eslintIgnore":["node_modules/","lib/"],"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"yarn@3.6.1","devDependencies":{"jest":"^29.7.0","react":"18.3.1","turbo":"^1.10.7","eslint":"^8.51.0","del-cli":"^5.1.0","prettier":"^3.0.3","dotenv-cli":"^11.0.0","release-it":"^19.1.0","typescript":"^5.2.2","@types/jest":"^29.5.5","@types/react":"^18.2.44","react-native":"0.75.5","@commitlint/cli":"^19.7.1","@expo/config-plugins":"^9.0.0","@evilmartians/lefthook":"^1.5.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","react-native-builder-bob":"^0.37.0","@react-native/eslint-config":"^0.73.1","@commitlint/config-conventional":"^19.7.1","@release-it/conventional-changelog":"^9.0.2"},"peerDependencies":{"expo":">=50.0.0","react":"*","react-native":"*"},"peerDependenciesMeta":{"expo":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/react-native-tiktok-business-sdk_1.6.2_1780407200971_0.8469685402034981","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":[["commonjs",{"esm":true}],["module",{"esm":true}],["typescript",{"esm":true,"project":"tsconfig.build.json"}]]},"create-react-native-library":{"type":"legacy-module","version":"0.48.3","languages":"kotlin-swift"}},"1.7.1":{"name":"@alvie-tech/react-native-tiktok-business-sdk","version":"1.7.1","description":"A React Native bridge for the TikTok Business SDK","source":"./src/index.tsx","main":"./lib/commonjs/index.js","module":"./lib/module/index.js","exports":{".":{"import":{"types":"./lib/typescript/module/src/index.d.ts","default":"./lib/module/index.js"},"require":{"types":"./lib/typescript/commonjs/src/index.d.ts","default":"./lib/commonjs/index.js"}},"./app.plugin.js":"./app.plugin.js","./package.json":"./package.json"},"scripts":{"test":"jest","typecheck":"tsc && tsc --noEmit -p plugin/tsconfig.json","lint":"eslint \"**/*.{js,ts,tsx}\"","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build lib plugin/build","build:plugin":"tsc -p plugin/tsconfig.json","prepare":"bob build && npm run build:plugin","release":"dotenv release-it --"},"keywords":["react-native","tiktok","business","sdk","ios","android"],"repository":{"type":"git","url":"git+https://github.com/alvie-tech/react-native-tiktok-business-sdk.git"},"author":{"name":"Alvie","email":"tech@alvie.fr","url":"https://github.com/alvie-tech"},"contributors":[{"name":"Matias Tebele","email":"mati.tebele@gmail.com","url":"https://github.com/mtebele"}],"license":"MIT","bugs":{"url":"https://github.com/alvie-tech/react-native-tiktok-business-sdk/issues"},"homepage":"https://github.com/alvie-tech/react-native-tiktok-business-sdk#readme","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"devDependencies":{"@commitlint/cli":"^19.7.1","@commitlint/config-conventional":"^19.7.1","@evilmartians/lefthook":"^1.5.0","@expo/config-plugins":"^9.0.0","@react-native/eslint-config":"^0.73.1","@release-it/conventional-changelog":"^9.0.2","@types/jest":"^29.5.5","@types/react":"^18.2.44","del-cli":"^5.1.0","dotenv-cli":"^11.0.0","eslint":"^8.51.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^5.0.1","jest":"^29.7.0","prettier":"^3.0.3","react":"18.3.1","react-native":"0.75.5","react-native-builder-bob":"^0.37.0","release-it":"^19.1.0","turbo":"^1.10.7","typescript":"^5.2.2"},"resolutions":{"@types/react":"^18.2.44","conventional-changelog-conventionalcommits":"9.0.0"},"peerDependencies":{"expo":">=50.0.0","react":"*","react-native":"*"},"peerDependenciesMeta":{"expo":{"optional":true}},"workspaces":["example"],"packageManager":"yarn@3.6.1","jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"],"setupFilesAfterEnv":["<rootDir>/src/__tests__/setup.ts"],"collectCoverageFrom":["src/**/*.{ts,tsx}","plugin/src/**/*.ts","!src/**/*.d.ts","!plugin/src/**/*.d.ts","!src/__tests__/**","!plugin/src/__tests__/**"],"coverageReporters":["text","lcov","html"],"testMatch":["<rootDir>/src/__tests__/**/*.test.{ts,tsx}","<rootDir>/plugin/src/__tests__/**/*.test.ts"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":"angular"}}},"eslintConfig":{"root":true,"extends":["@react-native","prettier"],"rules":{"react/react-in-jsx-scope":"off","prettier/prettier":["error",{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false}]}},"eslintIgnore":["node_modules/","lib/"],"prettier":{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false},"react-native-builder-bob":{"source":"src","output":"lib","targets":[["commonjs",{"esm":true}],["module",{"esm":true}],["typescript",{"project":"tsconfig.build.json","esm":true}]]},"create-react-native-library":{"type":"legacy-module","languages":"kotlin-swift","version":"0.48.3"},"_id":"@alvie-tech/react-native-tiktok-business-sdk@1.7.1","gitHead":"dc7c15242acab7b2ab1544557e5ba57094191ff0","_nodeVersion":"22.23.2","_npmVersion":"10.9.8","dist":{"integrity":"sha512-8qQYMElrV876RX63n/WgFKY/dt+A2DM0aFklO4JqHt1aM+enxEHNyMLb9nSPAgA6FebcfBw4yo+bR6HgpK4W7w==","shasum":"4ac381ad9afb6e0612f452d314da1644789bb386","tarball":"https://registry.npmjs.org/@alvie-tech/react-native-tiktok-business-sdk/-/react-native-tiktok-business-sdk-1.7.1.tgz","fileCount":34,"unpackedSize":141700,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDtC5/3lm9LCF6mbGobv3juN287ghcMcAc6ulVvy+kLXAiEAlgurRnm0f0fKuzesld156xTmQym6jObACZIlX6NCgbk="}]},"_npmUser":{"name":"guillaumel","email":"guillaumel@alvie.fr"},"directories":{},"maintainers":[{"name":"guillaumel","email":"guillaumel@alvie.fr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-native-tiktok-business-sdk_1.7.1_1788289626453_0.6230030642189008"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-02T13:33:20.827Z","modified":"2026-09-01T19:07:06.767Z","1.6.2":"2026-06-02T13:33:21.115Z","1.7.1":"2026-09-01T19:07:06.580Z"},"bugs":{"url":"https://github.com/alvie-tech/react-native-tiktok-business-sdk/issues"},"author":{"name":"Alvie","email":"tech@alvie.fr","url":"https://github.com/alvie-tech"},"license":"MIT","homepage":"https://github.com/alvie-tech/react-native-tiktok-business-sdk#readme","keywords":["react-native","tiktok","business","sdk","ios","android"],"repository":{"type":"git","url":"git+https://github.com/alvie-tech/react-native-tiktok-business-sdk.git"},"description":"A React Native bridge for the TikTok Business SDK","contributors":[{"name":"Matias Tebele","email":"mati.tebele@gmail.com","url":"https://github.com/mtebele"}],"maintainers":[{"name":"guillaumel","email":"guillaumel@alvie.fr"}],"readme":"# @alvie-tech/react-native-tiktok-business-sdk\n\n[![npm version](https://img.shields.io/npm/v/@alvie-tech/react-native-tiktok-business-sdk.svg)](https://www.npmjs.com/package/@alvie-tech/react-native-tiktok-business-sdk)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/alvie-tech/react-native-tiktok-business-sdk/ci.yml)](https://github.com/alvie-tech/react-native-tiktok-business-sdk/actions)\n[![npm downloads](https://img.shields.io/npm/dw/@alvie-tech/react-native-tiktok-business-sdk.svg)](https://www.npmjs.com/package/@alvie-tech/react-native-tiktok-business-sdk)\n[![License](https://img.shields.io/npm/l/@alvie-tech/react-native-tiktok-business-sdk.svg)](https://github.com/alvie-tech/react-native-tiktok-business-sdk/blob/main/LICENSE)\n\n> Fork of [`react-native-tiktok-business-sdk`](https://github.com/mtebele/react-native-tiktok-business-sdk) by Matias Tebele, published under the `@alvie-tech` scope with an added Expo config plugin.\n\nA React Native bridge for the TikTok Business SDK\n\nThis library provides a modern, promise-based interface for the TikTok Business SDK, enabling JavaScript apps to initialize the SDK, identify users, and track various events (standard, content, and custom events) with full TypeScript support and comprehensive error handling.\n\n## ✨ Features\n\n- 📱 **Cross-platform** - iOS and Android support\n- 🎯 **Promise-based API** - Modern async/await support\n- 🔒 **TypeScript** - Full type safety and IntelliSense\n- 🧪 **Comprehensive testing** - 100% test coverage with 100+ tests\n- 📊 **Event tracking** - Standard, content, custom events, and ad revenue tracking\n- 🛡️ **Error handling** - Robust error handling with specific error codes\n- 🎨 **Developer friendly** - Simple API with detailed documentation\n\n## Installation\n\nInstall the package using npm (or yarn):\n\n```sh\nnpm install @alvie-tech/react-native-tiktok-business-sdk\n\nyarn add @alvie-tech/react-native-tiktok-business-sdk\n```\n\n### Expo / Continuous Native Generation\n\nIf your app uses Expo (managed or with Continuous Native Generation), add the bundled config plugin to `app.json` / `app.config.ts` to automate the required native edits at prebuild time:\n\n```json\n{\n  \"expo\": {\n    \"plugins\": [\n      [\n        \"@alvie-tech/react-native-tiktok-business-sdk\",\n        {\n          \"ios\": {\n            \"tiktokAppId\": \"YOUR_IOS_TIKTOK_APP_ID\",\n            \"skAdNetworkIds\": [\"abc1234567.skadnetwork\"],\n            \"userTrackingPermission\": \"This identifier will be used to deliver personalized ads to you.\"\n          },\n          \"android\": {\n            \"tiktokAppId\": \"YOUR_ANDROID_TIKTOK_APP_ID\"\n          }\n        }\n      ]\n    ]\n  }\n}\n```\n\nThe plugin automatically:\n\n- Appends `22mmun2rn5.skadnetwork` (TikTok's SKAdNetwork identifier) to `SKAdNetworkItems` in `Info.plist`\n- Appends `tiktok`, `snssdk1233` and `snssdk1180` to `LSApplicationQueriesSchemes` in `Info.plist`\n- Writes the `TikTokAppID` key in `Info.plist` when `ios.tiktokAppId` is provided\n- Writes `NSUserTrackingUsageDescription` when `ios.userTrackingPermission` is provided — omit it if `expo-tracking-transparency` already manages it for your app\n- Adds the `com.tiktok.sdk.AppId` `<meta-data>` entry to `AndroidManifest.xml` when `android.tiktokAppId` is provided\n\nAll mods are idempotent: running `expo prebuild` multiple times will not duplicate entries. After updating the configuration, regenerate the native projects with `npx expo prebuild --clean`.\n\n### iOS Setup\n\n1. Run pod install in your `ios` directory:\n```sh\ncd ios && pod install\n```\n\n2. The SDK will automatically link the TikTok Business SDK dependency.\n\n3. **iOS 14+ — App Tracking Transparency**: The TikTok SDK requires user tracking permission to report install and other automatic events. Add the following key to your `ios/<YourApp>/Info.plist`:\n\n```xml\n<key>NSUserTrackingUsageDescription</key>\n<string>This identifier will be used to deliver personalized ads to you.</string>\n```\n\nCustomize the string to match your app's use case. Without this entry, the install event and other automatic tracking may not function correctly on iOS 14+.\n\n### Android Setup\n\n1. The SDK dependency is automatically included via Gradle.\n\n2. Add ProGuard rules to prevent code obfuscation (see [ProGuard section](#proguard-android) below).\n\n## Usage\n\nBelow are examples of how to use the various methods exposed by the library.\n\n### Importing the Library\n\nThe package exposes a main object, TikTokBusiness, that aggregates all the methods and enums. For example:\n\n```js\nimport { TikTokBusiness } from '@alvie-tech/react-native-tiktok-business-sdk';\n```\n\n### Initialize the SDK\n\nBefore using any event tracking methods, you must initialize the SDK. You can call `initializeSdk` with your appId, tiktokAppId, accessToken, and optionally set debug mode.\n\n#### Single TikTok App ID\n\n```js\nasync function initializeTikTokSDK() {\n  try {\n    await TikTokBusiness.initializeSdk(\n      'YOUR_APP_ID',         // Your app ID (e.g., Android package name or iOS bundle ID)\n      'YOUR_TIKTOK_APP_ID',  // Your TikTok App ID from TikTok Events Manager\n      'YOUR_ACCESS_TOKEN',   // Your access token from TikTok Events Manager (REQUIRED)\n      true                   // Enable debug mode (optional, defaults to false)\n    );\n    console.log('TikTok SDK initialized successfully!');\n    // SDK is now initialized, and tracking is active.\n  } catch (error) {\n    console.error('Error initializing TikTok SDK:', error);\n    // Handle initialization errors (network issues, invalid credentials, etc.)\n  }\n}\n\ninitializeTikTokSDK();\n```\n\n#### Multiple TikTok App IDs\n\nStarting from SDK v1.3.1, you can track events with multiple TikTok App IDs by passing an array:\n\n```js\nasync function initializeTikTokSDKWithMultipleAppIds() {\n  try {\n    await TikTokBusiness.initializeSdk(\n      'YOUR_APP_ID',\n      ['TIKTOK_APP_ID_1', 'TIKTOK_APP_ID_2', 'TIKTOK_APP_ID_3'],  // Array of TikTok App IDs\n      'YOUR_ACCESS_TOKEN',\n      true\n    );\n    console.log('TikTok SDK initialized with multiple App IDs!');\n  } catch (error) {\n    console.error('Error initializing TikTok SDK:', error);\n  }\n}\n```\n\nAlternatively, you can still use comma-separated string format:\n\n```js\nawait TikTokBusiness.initializeSdk(\n  'YOUR_APP_ID',\n  '11,22,33',  // Comma-separated App IDs (no spaces)\n  'YOUR_ACCESS_TOKEN',\n  true\n);\n```\n\n**Important Validation Rules:**\n- App IDs must be numeric strings\n- No spaces allowed in comma-separated format\n- No trailing or leading commas\n- Array format is recommended for better readability and type safety\n- All TikTok App IDs must match your App ID (SDK requirement)\n\n#### Disabling Automatic Tracking Events\n\nBy default, the TikTok SDK automatically reports install, launch, 2D-retention, and in-app purchase events. You can disable any of these at initialization time by passing an optional `options` object:\n\n```js\nimport { TikTokBusiness } from '@alvie-tech/react-native-tiktok-business-sdk';\nimport type { TikTokSdkConfig } from '@alvie-tech/react-native-tiktok-business-sdk';\n\n// Disable all automatic events\nawait TikTokBusiness.initializeSdk(\n  'YOUR_APP_ID',\n  'YOUR_TIKTOK_APP_ID',\n  'YOUR_ACCESS_TOKEN',\n  false,\n  { disableAutoTracking: true }\n);\n\n// Or disable specific events\nconst options: TikTokSdkConfig = {\n  disableInstallTracking: true,       // Don't report install event\n  disableLaunchTracking: true,        // Don't report app launch event\n  disableRetentionTracking: true,     // Don't report 2D-retention event\n  disablePaymentTracking: true,       // Don't report automatic IAP event\n  disableSKAdNetworkSupport: true,    // iOS only: disable automatic SKAdNetwork support\n};\n\nawait TikTokBusiness.initializeSdk(\n  'YOUR_APP_ID',\n  'YOUR_TIKTOK_APP_ID',\n  'YOUR_ACCESS_TOKEN',\n  false,\n  options\n);\n```\n\n> **Note:** All existing calls without the `options` argument continue to work unchanged.\n\n### Identify a User\n\nCall the `identify` method to report user information. All parameters are required.\n\n```js\nasync function identifyUser() {\n  try {\n    await TikTokBusiness.identify(\n      'user_12345',           // External user ID (required)\n      'john_doe',             // External user name (required)\n      '+1234567890',          // Phone number (required)\n      'john@example.com'      // Email address (required)\n    );\n    console.log('User identified successfully!');\n  } catch (error) {\n    console.error('Error identifying user:', error);\n    // Handle identification errors\n  }\n}\n```\n\n### Logout\n\nLog out the user with the `logout` method:\n\n```js\nasync function logoutUser() {\n  try {\n    await TikTokBusiness.logout();\n    console.log('User logged out successfully!');\n  } catch (error) {\n    console.error('Error logging out:', error);\n    // Handle logout errors\n  }\n}\n```\n\n### Track a Standard Event\n\nUse `trackEvent` to report standard events. You can optionally pass an event ID and additional properties.\n\n```js\nimport { TikTokBusiness, TikTokEventName } from '@alvie-tech/react-native-tiktok-business-sdk';\n\nasync function trackStandardEvent() {\n  try {\n    // Simple event tracking\n    await TikTokBusiness.trackEvent(TikTokEventName.REGISTRATION);\n    \n    // Event with custom ID and properties\n    await TikTokBusiness.trackEvent(\n      TikTokEventName.SEARCH,\n      'search_001',                    // Optional event ID\n      {                               // Optional properties\n        query: 'coffee',\n      }\n    );\n    \n    console.log('Standard event tracked successfully!');\n  } catch (error) {\n    console.error('Error tracking standard event:', error);\n  }\n}\n```\n\n### Track a Content Event\n\nFor events that require content details (e.g., \"ADD_TO_CART\", \"CHECK_OUT\", etc.), use `trackContentEvent`. The method accepts an event type string and a parameters object.\n\n```js\nimport { \n  TikTokBusiness, \n  TikTokContentEventName, \n  TikTokContentEventParameter, \n  TikTokContentEventContentsParameter \n} from '@alvie-tech/react-native-tiktok-business-sdk';\n\nasync function trackContentEvent() {\n  try {\n    await TikTokBusiness.trackContentEvent(TikTokContentEventName.PURCHASE, {\n      [TikTokContentEventParameter.CURRENCY]: 'USD',\n      [TikTokContentEventParameter.VALUE]: '29.99',\n      [TikTokContentEventParameter.CONTENT_TYPE]: 'product',\n      [TikTokContentEventParameter.DESCRIPTION]: 'Premium coffee purchase',\n      [TikTokContentEventParameter.CONTENTS]: [\n        {\n          [TikTokContentEventContentsParameter.CONTENT_ID]: 'coffee_001',\n          [TikTokContentEventContentsParameter.CONTENT_NAME]: 'Premium Coffee',\n          [TikTokContentEventContentsParameter.BRAND]: 'Coffee Brand',\n          [TikTokContentEventContentsParameter.PRICE]: 29.99,\n          [TikTokContentEventContentsParameter.QUANTITY]: 1,\n        },\n      ],\n    });\n    \n    console.log('Content event tracked successfully!');\n  } catch (error) {\n    console.error('Error tracking content event:', error);\n  }\n}\n```\n\n### Track a Custom Event\n\nIf you need to report an event that isn't standard, use `trackCustomEvent` and pass the event name and a properties object.\n\n```js\nasync function trackCustomEvent() {\n  try {\n    await TikTokBusiness.trackCustomEvent('user_achievement', {\n      description: 'Level Completed!',\n    });\n    \n    console.log('Custom event tracked successfully!');\n  } catch (error) {\n    console.error('Error tracking custom event:', error);\n  }\n}\n```\n\n### Track Ad Revenue Events\n\nTrack impression-level ad revenue data using the `trackAdRevenueEvent` method. This is useful for monetization tracking with ad networks like AdMob, Unity, IronSource, etc.\n\n```js\nimport { TikTokBusiness, trackAdRevenueEvent } from '@alvie-tech/react-native-tiktok-business-sdk';\nimport type { AdRevenueData } from '@alvie-tech/react-native-tiktok-business-sdk';\n\nasync function trackAdRevenue() {\n  try {\n    const adRevenueData: AdRevenueData = {\n      revenue: 0.05,              // Revenue amount\n      currency: 'USD',            // Currency code\n      adNetwork: 'AdMob',         // Ad network name\n      adUnit: 'banner_main',      // Ad unit identifier\n      adFormat: 'banner',         // Ad format (banner, interstitial, rewarded)\n      placement: 'home_screen',   // Placement in your app\n      country: 'US',              // Country code\n      precision: 'exact',         // Precision level\n    };\n\n    // Track ad revenue with optional event ID\n    await trackAdRevenueEvent(adRevenueData, 'ad-revenue-001');\n    \n    console.log('Ad revenue tracked successfully!');\n  } catch (error) {\n    console.error('Error tracking ad revenue:', error);\n  }\n}\n\n// Alternative: Use standard event tracking\nasync function trackImpressionEvent() {\n  try {\n    await TikTokBusiness.trackEvent(TikTokEventName.IMPRESSION_LEVEL_AD_REVENUE);\n    console.log('Impression event tracked successfully!');\n  } catch (error) {\n    console.error('Error tracking impression event:', error);\n  }\n}\n```\n\n### Flush Events\n\nManually flush pending events to TikTok's servers. This is useful when you want to ensure events are sent immediately, such as before the app terminates.\n\n```js\nasync function flushEvents() {\n  try {\n    await TikTokBusiness.flush();\n    console.log('Events flushed successfully!');\n  } catch (error) {\n    console.error('Error flushing events:', error);\n  }\n}\n```\n\n> **Note:** Events are normally sent automatically at regular intervals. Only use flush when you need immediate synchronization.\n\n## API Reference\n\n### Available Methods\n\nAll methods return promises and support async/await pattern:\n\n```typescript\n// Initialize SDK (required before any other calls)\ninitializeSdk(appId: string, ttAppId: string | string[], accessToken: string, debug?: boolean): Promise<string>\n\n// User management\nidentify(externalId: string, externalUserName: string, phoneNumber: string, email: string): Promise<string>\nlogout(): Promise<string>\n\n// Event tracking\ntrackEvent(eventName: TikTokEventName, eventId?: string, properties?: object): Promise<string>\ntrackContentEvent(eventName: TikTokContentEventName, properties?: object): Promise<string>\ntrackCustomEvent(eventName: string, properties?: object): Promise<string>\ntrackAdRevenueEvent(adRevenueData: AdRevenueData, eventId?: string): Promise<string>\n\n// Other\nflush(): Promise<string>\n```\n\n### Types\n\n#### AdRevenueData Interface\n\n```typescript\ninterface AdRevenueData {\n  revenue?: number;        // Revenue amount in specified currency\n  currency?: string;       // Currency code (e.g., 'USD', 'EUR')\n  adNetwork?: string;      // Ad network name (e.g., 'AdMob', 'Unity', 'IronSource')\n  adUnit?: string;         // Ad unit identifier\n  adFormat?: string;       // Ad format (e.g., 'banner', 'interstitial', 'rewarded')\n  placement?: string;      // Placement identifier in your app\n  country?: string;        // Country code where ad was shown\n  precision?: string;      // Precision level of revenue data\n  [key: string]: string | number | boolean | undefined; // Additional custom properties\n}\n```\n\n### Enums\n\nThe library exports the following enums to ensure consistency when reporting events:\n\n- **TikTokEventName** – Standard event names (LOGIN, REGISTRATION, PURCHASE, etc.)\n- **TikTokContentEventName** – Content event names (ADD_TO_CART, VIEW_CONTENT, etc.)\n- **TikTokContentEventParameter** – Parameters for content events (CURRENCY, VALUE, etc.)\n- **TikTokContentEventContentsParameter** – Parameters for content items (CONTENT_ID, PRICE, etc.)\n\n### Complete Import Example\n\n```js\nimport {\n  TikTokBusiness,\n  trackAdRevenueEvent,\n  TikTokEventName,\n  TikTokContentEventName,\n  TikTokContentEventParameter,\n  TikTokContentEventContentsParameter,\n} from '@alvie-tech/react-native-tiktok-business-sdk';\nimport type { AdRevenueData } from '@alvie-tech/react-native-tiktok-business-sdk';\n```\n\n## Error Handling\n\nThe SDK provides comprehensive error handling with specific error codes:\n\n```js\ntry {\n  await TikTokBusiness.initializeSdk(appId, ttAppId, accessToken, debug);\n} catch (error) {\n  switch (error.code) {\n    case 'INIT_ERROR':\n      console.error('Failed to initialize SDK:', error.message);\n      break;\n    case 'IDENTIFY_ERROR':\n      console.error('Failed to identify user:', error.message);\n      break;\n    case 'TRACK_EVENT_ERROR':\n      console.error('Failed to track event:', error.message);\n      break;\n    default:\n      console.error('Unknown error:', error.message);\n  }\n}\n```\n\n## Requirements\n\n- React Native 0.60+\n- iOS 11.0+\n- Android API level 16+\n\n## ProGuard (Android)\n\nIf you're using ProGuard for code obfuscation, add these rules to your `proguard-rules.pro`:\n\n```java\n-keep class com.tiktok.** { *; }\n-keep class com.android.billingclient.api.** { *; }\n-keep interface com.android.billingclient.api.* { *; }\n-keep class androidx.lifecycle.** { *; }\n-keep class com.android.installreferrer.** { *; }\n```\n\n## Troubleshooting\n\n### Common Issues\n\n1. **\"TikTokBusinessModule.initializeSdk got X arguments, expected Y\"**\n   - Ensure you're passing all required parameters including the new `accessToken`\n   - Check that you're using the latest version of the library\n\n2. **\"The package doesn't seem to be linked\"**\n   - Run `npx react-native clean` and rebuild your project\n   - For iOS: `cd ios && pod install && cd ..`\n   - For Android: `cd android && ./gradlew clean && cd ..`\n\n3. **Events not appearing in TikTok Events Manager**\n   - Verify your `accessToken` is correct and has proper permissions\n   - Check that your app ID and TikTok App ID are correctly configured\n   - Enable debug mode to see detailed logging\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and our development workflow.\n\n## License\n\nMIT\n\n---\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for detailed release notes and version history.\n","readmeFilename":"README.md"}