LocalSDK
Sdks

JavaScript SDK

LocalSDK for web and Node.js applications.

Installation

npm install @localsdk/js

Quick Start

import LocalSDK from '@localsdk/js';

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

sdk.startTracking();

sdk.on('location', (update) => {
  console.log(`${update.latitude}, ${update.longitude}`);
});

Browser Support

BrowserMin Version
Chrome90+
Firefox88+
Safari15+
Edge90+

TypeScript Support

The JavaScript SDK ships with full TypeScript definitions. All types are exported from the main package:

import LocalSDK, { type LocationUpdate, type GeofenceEvent } from '@localsdk/js';

sdk.on('location', (update: LocationUpdate) => {
  // Full type safety
});

On this page