LocalSDK

Quickstart

Go from zero to live location tracking in under 10 minutes.

Prerequisites

  • A LocalSDK account with an API key
  • Node.js 18+ (for JavaScript SDK) or your platform's native SDK

Step 1: Install the SDK

npm install @localsdk/js

Step 2: Initialize with your API key

import LocalSDK from '@localsdk/js';

const sdk = new LocalSDK({
  apiKey: 'your_api_key',
  trackingMode: 'adaptive',
  updateInterval: 5000,
});

Configuration Options

OptionTypeDefaultDescription
apiKeystringYour LocalSDK API key (required)
trackingModestring'adaptive'Tracking mode: 'active', 'adaptive', or 'passive'
updateIntervalnumber5000Location update interval in milliseconds

Step 3: Start tracking

// Start location tracking
sdk.startTracking();

// Listen for location updates
sdk.on('location', (update) => {
  console.log(`Lat: ${update.latitude}, Lng: ${update.longitude}`);
});

Step 4: Go live

Deploy your application — LocalSDK's auto-scaling infrastructure handles millions of location updates per second. No infrastructure configuration needed.

Next Steps

On this page