React Native with Legacy Architecture (v10.x and below)#
This guide covers the installation and setup of Storyteller SDK v10.x and below, which requires React Native's Old Architecture (New Architecture must be disabled).
The examples are verified against the historical 10.8.2 package, which declares React Native >=0.63.0. Use a host that still supports the Legacy Architecture: React Native 0.82 and later cannot enable it. See the React Native 0.82 release notes.
Important: On React Native 0.76–0.81, explicitly disable the New Architecture using the settings above. React Native 0.82 and later require the New Architecture, so these flags cannot make a v10.x integration compatible.
importStorytellerSdkfrom'@getstoryteller/react-native-storyteller-sdk';constinitializeStoryteller=()=>{StorytellerSdk.initialize({apiKey:'YOUR_API_KEY',externalId:'USER_ID',},(callback:{result:boolean;message:string})=>{console.log(`Result: ${callback.result}, Message: ${callback.message}`);if(callback.result){console.log('Storyteller initialized successfully');}else{console.error('Failed to initialize:',callback.message);}},);// ...rest of your code};
{"slug": "getting-started-react-native-legacy", "page_title": "React Native (Legacy)", "page_url": "getting-started/react-native-legacy/", "canonical_url": "/react-native/getting-started/react-native-legacy/", "markdown": "# React Native with Legacy Architecture (v10.x and below)\n\nThis guide covers the installation and setup of Storyteller SDK v10.x and below, which requires React Native's Old Architecture (New Architecture must be disabled).\n\nThe examples are verified against the historical `10.8.2` package, which declares React Native `>=0.63.0`. Use a host that still supports the Legacy Architecture: React Native 0.82 and later cannot enable it. See the [React Native 0.82 release notes](https://reactnative.dev/blog/2025/10/08/react-native-0.82).\n\n## Ensure New Architecture is Disabled\n\n### Android\n\nCheck your `android/gradle.properties` file contains:\n\n```groovy\nnewArchEnabled=false\n```\n\n### iOS\n\nCheck your `ios/Podfile` file contains:\n\n```ruby\nENV['RCT_NEW_ARCH_ENABLED'] = '0'\n```\n\n> **Important:** On React Native 0.76\u20130.81, explicitly disable the New Architecture using the settings above. React Native 0.82 and later require the New Architecture, so these flags cannot make a v10.x integration compatible.\n\n## Installation\n\nInstall the SDK using npm or yarn:\n\n```bash\nnpm install @getstoryteller/react-native-storyteller-sdk@^10.8.2 # or your desired version\n```\n\nor\n\n```bash\nyarn add @getstoryteller/react-native-storyteller-sdk@^10.8.2 # or your desired version\n```\n\n### Android Configuration\n\nAdd the following to your `android/build.gradle` file:\n\n```groovy\nallprojects {\n repositories {\n // Required for Storyteller SDK native dependencies\n maven { url 'https://storyteller.mycloudrepo.io/public/repositories/storyteller-sdk' }\n }\n}\n```\n\n### iOS Configuration\n\n1. Add the following sources to the top of your `ios/Podfile`:\n\n```ruby\nsource 'https://cdn.cocoapods.org/'\nsource 'https://github.com/getstoryteller/storyteller-sdk-ios-podspec.git'\n```\n\n1. Install the native dependencies:\n\n#### Install iOS dependencies\n\n```bash\ncd ios && pod install\n```\n\n## Basic Implementation\n\n### Initialize the SDK (Callback-based API)\n\nExample provided below:\n\n```typescript\nimport StorytellerSdk from '@getstoryteller/react-native-storyteller-sdk';\n\nconst initializeStoryteller = () => {\n StorytellerSdk.initialize(\n {\n apiKey: 'YOUR_API_KEY',\n externalId: 'USER_ID',\n },\n (callback: { result: boolean; message: string }) => {\n console.log(`Result: ${callback.result}, Message: ${callback.message}`);\n\n if (callback.result) {\n console.log('Storyteller initialized successfully');\n } else {\n console.error('Failed to initialize:', callback.message);\n }\n },\n );\n\n // ...rest of your code\n};\n```\n\n## Next Steps\n\n- Explore the [Components](../Storyteller.md) and their configuration\n- Learn about [Theming](../Themes.md) to customize the appearance\n- Explore [Analytics](../Analytics.md) for tracking user engagement\n- Set up [User Attributes](../UserCustomization.md) for personalization\n- Configure [Ads](../Ads.md) integration\n\n## Upgrading to v11.0.0+\n\nReady to upgrade to the latest version? Check our [Migration Guide (v10.x to v11.0.0+)](migration-v10-to-v11.md)\n\n## Support\n\n- Contact <[email protected]> for assistance\n", "copy_markdown_include_header": false, "base_path": "", "ai_dir": "ai", "missing_payload_behavior": "empty"}