Geolocation Module

The Geolocation module captures the user's coordinates via the browser's geolocation API and submits them to the backend. Useful for jurisdictional rules and

📘

This guide is specific to Web SDK 2.0. If you are still using 1.x, you can find documentation here. We strongly recommend upgrading - contact your Incode Representative for upgrade information.

The Geolocation module captures the user's coordinates via the browser's geolocation API and submits them to the backend. Useful for jurisdictional rules and fraud signals.

Follows a backend-process pattern variant with a permission step. Requires a user gesture before the browser will prompt for permission.

Tag

<incode-geolocation> is a standard Web Component. Importing the UI subpath registers the custom element; importing the CSS applies the module's styles.

import '@incodetech/web/geolocation';
import '@incodetech/web/geolocation/styles.css';

Properties

PropertyTypeRequiredDescription
configGeolocationConfigConfiguration options
onFinish() => voidCalled when location is captured (or skipped)
onError(error: string) => voidCalled when an error occurs

Configuration

type GeolocationConfig = {
  allowUserToSkipGeolocation?: boolean;
};
OptionTypeRequiredDescription
allowUserToSkipGeolocationbooleanWhen true, a Skip button is shown on the permission-denied screen. Default false. Backend-driven via flow config.

State machine

GeolocationState is a discriminated union over status:

StatusDescription
idleInitial state.
requestingLocationBrowser permission prompt visible / location lookup in progress.
locationAcquiredGot coordinates; transitioning to submit.
permissionDeniedUser denied permission. Show retry instructions or Skip (if enabled).
submittingSending coordinates to the backend.
finishedTerminal.

See also