Documentation

Get from install to first send in an afternoon. These are the essentials; the full reference lives in your dashboard.

Quickstart

  1. 1. Create a project in the dashboard and copy your pk_ and sk_ keys.
  2. 2. Connect a channel (FCM or SMTP). Retainza verifies it with a test send.
  3. 3. Install a client SDK and identify your users.
  4. 4. Build and send a campaign from the dashboard or the server SDK.

Install

Pick the wrapper for your platform.

terminal
pnpm add @retainza/react-native   # client SDK (public key)
pnpm add @retainza/sdk-node       # server SDK (secret key)

Client SDK

The public key is write-only and safe to ship. Identify, track, register push tokens, and handle in-app messages + deep links with your own UI.

App.tsx
import { Retainza } from "@retainza/react-native";

const engage = Retainza.init({ publicKey: "pk_live_…" });
await engage.identify(uid, { plan: "free", locale: "de" });
engage.track("opened_paywall");
engage.onInApp((msg) => showModal(msg));
engage.onNavigate((route) => router.push(route));

Server SDK

The secret key unlocks the Management API — create campaigns and segments, count audiences, and send now. Never ship it to a client.

server.ts
import { createRetainzaServer } from "@retainza/sdk-node";

const engage = createRetainzaServer({ secretKey: process.env.ENGAGE_SECRET_KEY! });

await engage.campaigns.upsert({
  name: "Trial ending nudge",
  channels: ["push", "email", "inapp"],
  audience: { filters: [{ key: "trial_days_left", op: "lt", value: 3 }] },
  trigger: { type: "event", event: { name: "trial_started", delayHours: 96 } },
});

API reference

Two surfaces: a high-volume Ingest API (public key) and a privileged Management API (secret key). All auth is Authorization: Bearer <key>.

Ingest (public key)

  • POST /v1/identify
  • POST /v1/track
  • POST /v1/token
  • POST /v1/inapp/ack
  • GET /v1/inapp/pending

Management (secret key)

  • GET /v1/projects
  • POST /v1/projects
  • POST /v1/campaigns
  • GET /v1/campaigns
  • POST /v1/campaigns/:id/activate
  • POST /v1/campaigns/:id/pause
  • POST /v1/send
  • POST /v1/segments
  • GET /v1/segments/:id/count
  • POST /v1/connections
  • GET /v1/connections
  • GET /v1/usage
  • GET /v1/analytics/campaigns/:id
  • POST /v1/scheduler/tick
  • GET /v1/users/:id
  • GET /v1/users/:id/export
  • DELETE /v1/users/:id

Own your engagement stack today

Start free on the hosted dashboard. Your data, your credentials, your rules.