The Storyteller Android SDK artifacts are published to Maven Central. Most React Native projects include mavenCentral() by default. If your project has a custom repository setup, make sure mavenCentral() is available in your android/build.gradle file:
importStorytellerSdkfrom'@getstoryteller/react-native-storyteller-sdk';constinitializeStoryteller=async()=>{try{awaitStorytellerSdk.initialize('YOUR_API_KEY','USER_ID');console.log('Storyteller initialized successfully');}catch(error){console.error('Storyteller initialization error:',error);}};// ...rest of your code
{"slug": "getting-started-react-native-new-arch", "page_title": "React Native (New Architecture)", "page_url": "getting-started/react-native-new-arch/", "canonical_url": "/react-native/getting-started/react-native-new-arch/", "markdown": "# React Native with New Architecture (v11.0.0+)\n\nThis guide covers the installation and setup of Storyteller SDK v11.0.0 and higher, which requires React Native's New Architecture.\n\n## Verify New Architecture is Enabled\n\n### Android\n\nCheck your `android/gradle.properties` file contains:\n\n```groovy\nnewArchEnabled=true\n```\n\n### iOS\n\nCheck your `ios/Podfile` file contains:\n\n```ruby\nENV['RCT_NEW_ARCH_ENABLED'] = '1'\n```\n\n> **Note:** React Native 0.76 and above have the New Architecture enabled by default.\n\n## Installation\n\nInstall the SDK using npm or yarn:\n\n```bash\nnpm install @getstoryteller/react-native-storyteller-sdk\n```\n\nor\n\n```bash\nyarn add @getstoryteller/react-native-storyteller-sdk\n```\n\n### Android Configuration\n\nThe Storyteller Android SDK artifacts are published to Maven Central. Most React Native projects include `mavenCentral()` by default. If your project has a custom repository setup, make sure `mavenCentral()` is available in your `android/build.gradle` file:\n\n```groovy\nallprojects {\n repositories {\n google()\n mavenCentral()\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-lottie-ios-podspec.git'\nsource 'https://github.com/getstoryteller/storyteller-sdk-ios-podspec.git'\n```\n\n2. Install the native dependencies:\n\n```bash\ncd ios && pod install\n```\n\n## Basic Implementation\n\n### Initialize the SDK (Promise-based API)\n\nExample provided below:\n\n```typescript\nimport StorytellerSdk from '@getstoryteller/react-native-storyteller-sdk';\n\n const initializeStoryteller = async () => {\n try {\n await StorytellerSdk.initialize('YOUR_API_KEY', 'USER_ID');\n console.log('Storyteller initialized successfully');\n } catch (error) {\n console.error('Storyteller initialization error:', error);\n }\n };\n\n // ...rest of your code\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## Support\n\n- Contact <[email protected]> for assistance\n", "copy_markdown_include_header": false, "base_path": "", "ai_dir": "ai", "missing_payload_behavior": "empty"}