LocalSDK

React Native SDK

LocalSDK for React Native and Expo applications.

Installation

Expo

npx expo install @localsdk/react-native

Bare React Native

npm install @localsdk/react-native
npx pod-install

Quick Start

import { LocalSDK, useLocation } from '@localsdk/react-native';

// Initialize once at app startup
LocalSDK.init({ apiKey: 'your_api_key' });

function TrackingScreen() {
  const { location, isTracking } = useLocation({
    mode: 'adaptive',
    interval: 5000,
  });

  return (
    <View>
      <Text>Tracking: {isTracking ? 'Active' : 'Inactive'}</Text>
      {location && (
        <Text>
          {location.latitude}, {location.longitude}
        </Text>
      )}
    </View>
  );
}

Requirements

  • React Native 0.73+
  • Expo SDK 50+ (for Expo projects)
  • iOS 15.0+ / Android API 26+

Hooks

useLocation(options?)

Returns current location and tracking state. Automatically handles start/stop lifecycle.

useGeofences(geofences)

Monitor geofence events with a declarative API.

useTrips()

Access active trip data and trip history.

On this page