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/jsStep 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
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | — | Your LocalSDK API key (required) |
trackingMode | string | 'adaptive' | Tracking mode: 'active', 'adaptive', or 'passive' |
updateInterval | number | 5000 | Location 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
- Configure geofences to detect entries, exits, and dwell time
- Set up webhooks to receive real-time events
- Explore native SDKs for iOS, Android, and more