Sdks
JavaScript SDK
LocalSDK for web and Node.js applications.
Installation
npm install @localsdk/jsQuick 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
| Browser | Min Version |
|---|---|
| Chrome | 90+ |
| Firefox | 88+ |
| Safari | 15+ |
| Edge | 90+ |
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
});