PPactDocs
Mobile & SDKs

Mobile SDKs

Embed Pact's consent-native CRM into your own iOS, Android, or React Native app. Native concurrency, offline writes, white-label theming, cost-transparent AI agent calls.

The Pact mobile SDKs let you build a CRM, marketing, or AI-agent feature directly into your own app. There are three packages, all backed by the same /v1/api/* REST surface and the /v1/events/* event stream:

PlatformPackageInstallSource
JS / RN / Capacitor / Node@pact/sdk-mobilenpm i @pact/sdk-mobilepackages/sdk-mobile
iOS / macOS (Swift)PactSDK (SwiftPM)Xcode ▸ Add Package Dependenciespackages/sdk-ios
Android / Kotlinplace.pact:pact-sdkimplementation("place.pact:pact-sdk:0.1.0")packages/sdk-android

Every SDK shares the same defaults so the same engineering reasoning applies on every platform:

  • Consent-native by default. The server already filters reads against the tenant's consent state; the SDK surfaces the consent_filtered flag verbatim so your UI can tell users when a list is short on purpose.
  • BYOK respected. Agent calls fired through the SDK route to the tenant's own LLM credentials when configured; the response carries byok: true and cost_cents: 0 so the cost meter doesn't double-count.
  • Audit baked in. The SDK posts to /v1/events/emit on every mutation so Wave AT downstream subscribers (webhooks, the deal-room compile, the in-tenant audit table) stay in sync without app code.
  • Cost transparent. Every billed call carries an actual_cents, predicted_cents, and drift_pct field, sourced from PR #1327's cost predictor. The SDK exposes a single onCost hook so you can render a per-screen meter without polling.
  • Offline-first writes. Mutations made offline are parked behind an idempotency key and replayed the moment the device is back online. Replays share the same key, so duplicates never land.
  • White-label theming. A canonical defaultTokens object mirrors Pact's Wave V design tokens; pass tenant overrides to resolveTokens() / PactTheme.resolve(...) at app start so the embed picks up the host's brand colours.

Read the platform-specific pages for the install + first call + lifecycle recipes. Every example below builds against the same live sandbox at https://api.pact.place.

What you'll need

  1. A sandbox API key (pact_test_...) for development, or a live key (pact_live_...) for production. Mint them under Settings ▸ Developers ▸ API keys.
  2. The OAuth scopes you plan to use (read:contacts, write:activities, …). The SDK doesn't add any; the server enforces every scope per request.
  3. (Optional) A tenant-supplied theme_overrides map for white-label embeds.

Verifying

Once you have the SDK installed and a token wired, every entity helper returns a typed envelope with data, cost, and consentFiltered. The cost block is the truth meter: if it ever reads null after a billed call, the token is unauthenticated or the call hit a stub.