Skip to main content
The Partner SDK is the supported way to integrate Swapnice. It wraps the Partner API so your app can connect a customer you already know, collect purpose-limited consent, send activity events, and read permissioned profile intelligence. Partners do not call the consumer Firebase backend. Use this SDK (or the HTTP API underneath it). Consumer product guides live under Swapnice App.

Integration guide and sample code

Implementation requirements, OAuth, consent, events, profile reads, and TypeScript, Python, and cURL examples.

What this documentation covers

These guides are written for technical teams preparing an integration review or pilot.

SDK and API integration

Implementation requirements, OAuth, consent, events, and sample code.

SDK versus API

Where the SDK adds capability beyond raw HTTP, and when to call the API directly.

Data collection

What the SDK observes, how it is collected, when it is sent, and what never leaves the device.

Outputs

Profiles, claims, and intent scores partners can read today.

Architecture and data flow

End-to-end path from a consumer action to a Swapnice output.

Sandbox and testing

Environments, credentials, and the expected implementation and test process.

Authentication

OAuth 2.1, PKCE, scopes, tokens, and the errors that usually block a first call.

Consent and linking

Partner customer vs Swapnice account, purposes in product language, revocation.

Events and intents

Event catalog, intent ontology, claims vs overwrites, and confidence guidance.

Catalog entries

How SKUs and collectibles become objects intents can attach to.

Example use cases

Worked partner scenarios for personalization, checkout, and catalog flows.

Request walkthrough

Ordered sandbox calls from authorize through profile read and revoke.

What a pilot enables

What integrating the SDK unlocks in the partner product.

API reference

OpenAPI playground for every Partner API route.

How the product is structured

1

Connect and consent

The partner creates a customer record, starts a connection session, and records a consent receipt for specific purposes such as personalization or analytics.
2

Ingest events

The SDK or API sends consented activity events. Swapnice accepts them quickly, preserves per-customer order, and archives them asynchronously.
3

Read intelligence

The partner backend reads a resolved profile, underlying claims, and intent scores for that customer and purpose. Reads are synchronous and consent-aware.

What is live in V1

CRUD endpoints are infrastructure. The product partners integrate for is consented profile intelligence: resolved facts, provenance, and intent scores on top of the same event stream.

Implementation requirements

A V1 integration needs:
  • A confidential partner backend that can store client_id and client_secret
  • HTTPS redirect URIs registered exactly (no production wildcards)
  • PKCE (S256) for authorization-code exchange
  • An idempotency key on every mutating request
  • A consent receipt before events are accepted
  • Scopes that match the calls you will make (events:write, consent:write, profile:read, and so on)
The integration guide walks through each step with sample TypeScript, Python, and cURL.

Environments

Sandbox credentials and a test app are issued during onboarding. See sandbox and testing.