Polyfence is in Early Access — APIs and limits may still change. Your feedback shapes what we build.

Skip to content

Documentation

Polyfence documentation

Polyfence is a geofence layer: you define a zone once, and the same zone is evaluated on your mobile app, on your own hardware, and on your server — four separate implementations of the same rules.

Install an SDK, define a zone, start getting events. Each runtime’s own README carries its setup and configuration; everything else is below.

Start

Two ways in.

Hand it to your coding agent

Paste this into Claude Code, Cursor or Codex:

Add Polyfence to this project. Install the SDK for the framework you find here, follow its README for platform setup, then define one zone and log its enter and exit events.

Or do it yourself

Pick your runtime below, run its install line, and follow its README.

Managing zones from a terminal instead? npm i -g polyfence-cli

Neither needs an API key to start — zones you write in code are evaluated on the device, and nothing leaves it. A key is for when you want zones to arrive from us, or events to reach your account. Create an API key →

Quickstart

Quickstart

Pick your platform below: install, add a zone, start detecting.

Each SDK’s README carries the full install, platform setup, configuration and background-reliability detail for that runtime — Flutter, React Native, core (Kotlin/Swift), embedded C. All MIT.

Flutterpubspec.yaml
flutter pub add polyfence
12345678910111213
import 'package:polyfence/polyfence.dart';
await Polyfence.instance.initialize();
await Polyfence.instance.requestPermissions();
await Polyfence.instance.addZone(Zone.circle(
  id: 'depot-north',
  name: 'Depot North',
  center: PolyfenceLocation(latitude: 51.95724, longitude: 1.30962),
  radius: 230,
));
Polyfence.instance.onZoneEnter.listen((event) {
  print('Entered: ${event.zoneName}');
});
await Polyfence.instance.startTracking();
README §Getting Started 1–513 lines
Same circle in all 4: 51.95724, 1.30962 · r 230 mCounts measured from the panels, not asserted

Runtimes

Pick your runtime

Each README carries that runtime’s minimum version, platform setup and configuration.

On a phone

Flutter and React Native are wrappers around the Kotlin and Swift engines listed below them. Choosing one doesn’t add a second implementation to trust — it’s the same code underneath, called a different way.

Every runtime runs the same algorithms against the same constants, and the C library has been tested against this server and against itself on two CPU architectures. No test compares a phone’s event stream to either. If Kotlin or Swift drifted, nothing in the suite would currently catch it — both runs, and what they cover →

Scope

What Polyfence does not do

Deliberately, and with no plan to change: these are the parts of a location product only you can write.

No map renderingA zone is geometry, not a tile layer. Bring your own map.
No routingWe answer “is it inside”, never “how does it get there”.
No user identitiesWe hold a pseudonymous device_id. Who that is lives in your database, never in ours.
No push deliveryEvents reach your code. What you do with them is your product.
No position storageEvaluated and dropped, unless you switch retention on.

Reference

API reference

DeliveryThere are no outbound webhooks. Events reach you from the SDK callback on the device, or by polling GET /v1/events — cursor-paginated, newest first. The loop is yours to write and schedule.
LimitsNo monthly call cap or zone cap during Early Access. A 429 means slow down: it carries Retry-After and an X-RateLimit-Limit header with your per-second ceiling. 403 means this key is not allowed to do that.

Ready to start building?

Create your first zone and start integrating Polyfence.

Free during Early Access. No credit card.

Polyfence docs — geofencing SDKs for mobile and IoT