Documentation

    Installation

    Beta
    The mobile SDKs are currently in beta. If you encounter any issues, please contact us.

    Requirements

    • React Native 0.76.0+ (New Architecture required)
    • React 18.2.0+
    • iOS 14.0+
    • Android API 26+ (Android 8.0)

    Installation

    npm install @upscopeio/react-native-sdk
    

    iOS Setup

    The React Native SDK depends on the native UpscopeSDK iOS framework, which must be added via Swift Package Manager:

    1. Open your iOS project in Xcode (ios/YourApp.xcworkspace)
    2. Go to File > Add Package Dependencies
    3. Enter https://github.com/upscopeio/cobrowsing-ios.git
    4. Select the version and add to your app target

    Then install the CocoaPods bridge:

    cd ios && pod install
    

    Android Setup

    No additional steps required. The native Android SDK is linked automatically via Gradle.

    Initialization

    Initialize the SDK early in your app, before any components that use Upscope hooks mount:

    import Upscope from '@upscopeio/react-native-sdk';
    
    Upscope.initialize({
      apiKey: 'YOUR_API_KEY',
      autoConnect: true,
    });
    

    Full Example

    import React, { useEffect } from 'react';
    import { SafeAreaView } from 'react-native';
    import Upscope from '@upscopeio/react-native-sdk';
    
    export default function App() {
      useEffect(() => {
        Upscope.initialize({
          apiKey: 'YOUR_API_KEY',
          autoConnect: true,
        });
    
        Upscope.updateConnection({
          uniqueId: 'user-123',
          callName: 'John Smith',
        });
      }, []);
    
      return (
        <SafeAreaView>
          {/* Your app content */}
        </SafeAreaView>
      );
    }
    

    The SDK auto-connects by default. To disable this, set autoConnect: false and call Upscope.connect() manually when ready.

    Public API Key

    You can find your public API key in the installation page of your Co-Browsing API dashboard.

    Full Device Screen Sharing

    The React Native SDK supports full device screen sharing, but it requires platform-specific setup:

    Lookup Code on Shake

    By default, shaking the device will display the lookup code in a dialog. This can be disabled via configuration options.