Skip to main content

MockPlugin

The MockPlugin is built into the Astral SDK and implements all four plugin methods (collect, create, sign, verify). It generates deterministic location data for testing and development. Runs in all environments: Node.js, browser, and React Native.

Installation

No separate installation needed — MockPlugin ships with the SDK:

Configuration

Plugin properties


collect()

Returns simulated GPS-like signals.
Returns RawSignals:
When jitterMeters is set, coordinates will vary randomly within the specified radius on each call.

create()

Converts signals into an UnsignedLocationStamp.
Returns:

sign()

Signs a stamp. If privateKey was provided in options, uses that key. Otherwise uses the provided signer.

verify()

Validates stamp structure and signals.
Returns StampVerificationResult:

Full pipeline example

Use cases

  • Unit testing — Deterministic stamps for testing proof verification logic
  • Integration testing — End-to-end pipeline testing without real devices
  • Development — Build applications against the full stamp/proof pipeline
  • Demos — Show the location proof workflow without hardware dependencies