# Advanced Features Source: https://docs.clix.so/a2a/advanced-features Streaming semantics, task webhooks, idempotency, and operational guidance for Clix A2A. ## Streaming Behavior Clix exposes two streaming methods: * `SendStreamingMessage` to create a task and stream status events * `SubscribeToTask` to fetch the current status snapshot for an existing task ### SSE Envelope Each SSE `data:` line contains a JSON-RPC response envelope: ```text theme={null} data: {"jsonrpc":"2.0","id":"stream-1","result":{"statusUpdate":{"taskId":"task-uuid","contextId":"ctx-uuid","status":{"state":"submitted"}}}} data: {"jsonrpc":"2.0","id":"stream-1","result":{"statusUpdate":{"taskId":"task-uuid","contextId":"ctx-uuid","status":{"state":"completed","timestamp":"2026-03-11T12:00:00Z"}}}} ``` Current built-in Clix skills emit status updates only. The A2A v1 `StreamResponse` type can carry `artifactUpdate`, but Clix does not currently emit artifact updates during streaming. ### SubscribeToTask `SubscribeToTask` is useful when you want the latest known task state over the SSE transport. The current implementation emits a single `statusUpdate` event and closes the stream. ```json theme={null} { "jsonrpc": "2.0", "id": "resub-1", "method": "SubscribeToTask", "params": { "id": "task-uuid" } } ``` Do not treat `SubscribeToTask` as a long-lived live stream reconnection mechanism. Today it returns a snapshot, not a resumed event stream. ## Task Webhooks Task push notifications are outbound webhooks for task lifecycle events. They are not device push notifications. ### Register a Webhook ```json theme={null} { "jsonrpc": "2.0", "id": "push-1", "method": "CreateTaskPushNotificationConfig", "params": { "taskId": "task-uuid", "url": "https://example.com/a2a-webhook", "token": "verify-me", "authentication": { "scheme": "Bearer", "credentials": "webhook-secret" } } } ``` ### Callback Shape Clix sends an HTTP `POST` request whose JSON body is a JSON-RPC request with `method: "tasks/pushNotification"`. The actual task event is nested under `params.result`. ```json theme={null} { "jsonrpc": "2.0", "method": "tasks/pushNotification", "params": { "result": { "statusUpdate": { "taskId": "task-uuid", "contextId": "ctx-uuid", "status": { "state": "completed", "timestamp": "2026-03-11T12:00:00Z" } } } } } ``` ### Callback Headers If the config includes authentication or a token, Clix sends: * `Authorization: ` * `X-A2A-Token: ` ### Webhook URL Safety Clix rejects unsafe webhook destinations. Loopback, link-local, site-local, and other local-only addresses are blocked. Use a publicly reachable HTTPS endpoint. ## Idempotency `SendMessage` supports idempotent retries. ### Resolution Order 1. If present, Clix uses `X-Clix-Idempotency-Key` 2. Otherwise, Clix falls back to `message.messageId` ### Behavior * Same key and same request body: cached response is replayed * Same key while the original request is still running: HTTP `409 Conflict` * Same key with a different request body: HTTP `409 Conflict` Example: ```bash theme={null} curl -X POST https://api.clix.so/a2a \ -H "Content-Type: application/json" \ -H "A2A-Version: 1.0" \ -H "X-API-Key: clix_sk_your_secret_key" \ -H "X-Clix-Idempotency-Key: request-123" \ -d '{ ... }' ``` Set `X-Clix-Idempotency-Key` explicitly in production. It keeps retry behavior independent from your message IDs. ## Operational Guidance * Always send `A2A-Version: 1.0` for new integrations. Missing the header switches you to V0. * Capture `X-Request-ID` from every response. It is the fastest way to trace a failed task with support logs. * Use explicit `data.skill` payloads instead of text-only requests when deterministic routing matters. * Document and test only the `JSONRPC` binding advertised in the Agent Card. Do not assume alternate A2A transports are available. # API Reference Source: https://docs.clix.so/a2a/api-reference Reference for Clix A2A endpoints, JSON-RPC methods, task types, and error semantics. All `/a2a` method calls use JSON-RPC 2.0 over HTTPS. Public agent discovery uses `GET /.well-known/agent-card.json`. ## Endpoints | Path | Method | Auth | Description | | - | - | - | - | | `/.well-known/agent-card.json` | `GET` | None | Public Agent Card | | `/a2a` | `POST` | `X-API-Key` | Authenticated JSON-RPC methods | **Base URL:** `https://api.clix.so` ## Headers | Header | Direction | Required | Description | | - | - | - | - | | `A2A-Version` | Request | Recommended | Use `1.0`. Omitting it defaults to V0 (`0.3`). | | `Content-Type` | Request | For `/a2a` | Must be `application/json`. | | `X-API-Key` | Request | For `/a2a` | Secret API Key with the `clix_sk_` prefix. | | `X-Clix-Idempotency-Key` | Request | Optional | Explicit idempotency key for `SendMessage`. Falls back to `message.messageId`. | | `X-Request-ID` | Response | Always | Correlation header for tracing and support. | ## JSON-RPC Methods ### SendMessage Creates and executes a task synchronously. The response returns when the task reaches a terminal or interrupted state. **Request** ```json theme={null} { "jsonrpc": "2.0", "id": "req-1", "method": "SendMessage", "params": { "message": { "messageId": "msg-1", "role": "user", "parts": [ { "data": { "skill": "create-user", "projectUserId": "user_123" } } ] } } } ``` **Response** ```json theme={null} { "jsonrpc": "2.0", "id": "req-1", "result": { "task": { "id": "task-uuid", "contextId": "ctx-uuid", "status": { "state": "completed", "timestamp": "2026-03-11T12:00:00Z" }, "artifacts": [ { "artifactId": "art-uuid", "name": "user-result", "parts": [ { "data": { "userId": "uuid", "projectUserId": "user_123" } } ] } ], "history": [] } } } ``` ### SendStreamingMessage Creates a task and streams task events over Server-Sent Events. The SSE stream does not emit raw `StreamResponse` objects. Each `data:` line contains a JSON-RPC response envelope: ```text theme={null} data: {"jsonrpc":"2.0","id":"stream-1","result":{"statusUpdate":{"taskId":"task-uuid","contextId":"ctx-uuid","status":{"state":"submitted"}}}} data: {"jsonrpc":"2.0","id":"stream-1","result":{"statusUpdate":{"taskId":"task-uuid","contextId":"ctx-uuid","status":{"state":"completed","timestamp":"2026-03-11T12:00:00Z"}}}} ``` Current built-in Clix skills emit `statusUpdate` events. They do not currently emit `artifactUpdate` events during streaming. ### GetTask Reads a task by ID. **Request** ```json theme={null} { "jsonrpc": "2.0", "id": "req-2", "method": "GetTask", "params": { "id": "task-uuid" } } ``` **Response** `GetTask` returns the task directly as `result`, not inside `result.task`. ### ListTasks Lists tasks with cursor pagination. Supported params: | Param | Type | Description | | - | - | - | | `contextId` | string | Filter tasks by context | | `status` | string | Filter by protocol state value such as `completed` or `failed` | | `pageSize` | integer | Page size. The current default is `50`. | | `pageToken` | string | Cursor returned by a previous response | **Request** ```json theme={null} { "jsonrpc": "2.0", "id": "req-3", "method": "ListTasks", "params": { "pageSize": 20, "contextId": "ctx-uuid" } } ``` **Response** ```json theme={null} { "jsonrpc": "2.0", "id": "req-3", "result": { "tasks": [ { "id": "task-uuid", "contextId": "ctx-uuid", "status": { "state": "completed" }, "artifacts": [], "history": [] } ], "nextPageToken": "base64-cursor", "pageSize": 20, "totalSize": 42 } } ``` On the first page, `totalSize` contains the total matching count. On later cursor requests, the current Clix implementation returns `0`. ### CancelTask Cancels a non-terminal task. **Request** ```json theme={null} { "jsonrpc": "2.0", "id": "req-4", "method": "CancelTask", "params": { "id": "task-uuid" } } ``` **Response** Returns the task directly as `result`, with `status.state` set to `canceled`. ### SubscribeToTask Streams the current state of an existing task over SSE. **Request** ```json theme={null} { "jsonrpc": "2.0", "id": "req-5", "method": "SubscribeToTask", "params": { "id": "task-uuid" } } ``` **Response** ```text theme={null} data: {"jsonrpc":"2.0","id":"req-5","result":{"statusUpdate":{"taskId":"task-uuid","contextId":"ctx-uuid","status":{"state":"completed"}}}} ``` The current Clix implementation emits a single status snapshot for the current task state and closes the stream. It does not resume a live execution stream. ### CreateTaskPushNotificationConfig Registers a webhook for task events. **Request** ```json theme={null} { "jsonrpc": "2.0", "id": "req-6", "method": "CreateTaskPushNotificationConfig", "params": { "taskId": "task-uuid", "url": "https://example.com/a2a-webhook", "token": "verify-me", "authentication": { "scheme": "Bearer", "credentials": "webhook-secret" } } } ``` **Response** ```json theme={null} { "jsonrpc": "2.0", "id": "req-6", "result": { "id": "config-uuid", "taskId": "task-uuid", "url": "https://example.com/a2a-webhook", "token": "verify-me", "authentication": { "scheme": "Bearer", "credentials": "webhook-secret" } } } ``` ### GetTaskPushNotificationConfig Reads a single task webhook config. **Request** ```json theme={null} { "jsonrpc": "2.0", "id": "req-7", "method": "GetTaskPushNotificationConfig", "params": { "taskId": "task-uuid", "id": "config-uuid" } } ``` Both `taskId` and `id` are required. ### ListTaskPushNotificationConfigs Lists webhook configs for a task. **Request** ```json theme={null} { "jsonrpc": "2.0", "id": "req-8", "method": "ListTaskPushNotificationConfigs", "params": { "taskId": "task-uuid" } } ``` **Response** ```json theme={null} { "jsonrpc": "2.0", "id": "req-8", "result": { "configs": [ { "id": "config-uuid", "taskId": "task-uuid", "url": "https://example.com/a2a-webhook" } ], "nextPageToken": "" } } ``` The current Clix implementation returns the full config list for the task and an empty `nextPageToken`. ### DeleteTaskPushNotificationConfig Deletes a task webhook config. **Request** ```json theme={null} { "jsonrpc": "2.0", "id": "req-9", "method": "DeleteTaskPushNotificationConfig", "params": { "taskId": "task-uuid", "id": "config-uuid" } } ``` Both `taskId` and `id` are required. **Response** ```json theme={null} { "jsonrpc": "2.0", "id": "req-9", "result": null } ``` ### GetExtendedAgentCard Returns the authenticated Agent Card. **Request** ```json theme={null} { "jsonrpc": "2.0", "id": "req-10", "method": "GetExtendedAgentCard", "params": {} } ``` The current Clix implementation returns the same v1 card schema as the public Agent Card, with a project-aware description. ## Data Types ### Task | Field | Type | Description | | - | - | - | | `id` | string | Task identifier | | `contextId` | string | Conversation or session grouping key | | `status` | object | Current task state, message, and timestamp | | `artifacts` | array | Output artifacts | | `history` | array | Message history | | `metadata` | object | Optional metadata | ### Message | Field | Type | Description | | - | - | - | | `messageId` | string | Unique message identifier | | `role` | string | `user`, `agent`, or `unspecified` | | `parts` | array | Text or data parts | | `contextId` | string | Optional context ID | | `taskId` | string | Optional task linkage | ### Part | Field | Type | Description | | - | - | - | | `text` | string | Plain text content | | `data` | object | Structured JSON content | | `metadata` | object | Optional metadata | ### Artifact | Field | Type | Description | | - | - | - | | `artifactId` | string | Unique artifact identifier | | `name` | string | Artifact type such as `user-result` | | `parts` | array | Output parts | ### TaskPushNotificationConfig | Field | Type | Description | | - | - | - | | `id` | string | Config identifier | | `taskId` | string | Associated task | | `url` | string | Webhook destination | | `token` | string | Optional token echoed back as `X-A2A-Token` | | `authentication` | object | Optional `{ scheme, credentials }` used for `Authorization` | ## Task States | State | Type | Description | | - | - | - | | `submitted` | Initial | Task was created and accepted | | `working` | Active | Task is running | | `completed` | Terminal | Task completed successfully | | `failed` | Terminal | Task execution failed | | `canceled` | Terminal | Task was canceled | | `rejected` | Terminal | Task was refused | | `input-required` | Interrupted | More input is required | | `auth-required` | Interrupted | Additional authentication is required | ## Error Codes ### JSON-RPC Standard Errors | Code | Name | Description | | - | - | - | | `-32700` | Parse Error | Invalid JSON | | `-32600` | Invalid Request | Invalid JSON-RPC 2.0 payload | | `-32601` | Method Not Found | Unknown method | | `-32602` | Invalid Params | Missing or invalid params | | `-32603` | Internal Error | Internal processing failure | ### A2A-Specific Errors | Code | Name | Description | | - | - | - | | `-32001` | Task Not Found | Unknown task ID | | `-32002` | Task Not Cancelable | Task is already terminal | | `-32003` | Push Notification Not Supported | Push notifications are unavailable | | `-32004` | Unsupported Operation | Unsupported method or flow | | `-32005` | Content Type Not Supported | Unsupported `Content-Type` | | `-32006` | Invalid Agent Response | Invalid agent response | | `-32007` | Skill Not Found | Unknown skill ID | ### Idempotency Conflicts `SendMessage` uses idempotency. If the same idempotency key is already in progress, or if the same key is reused with a different request body, Clix responds with HTTP `409 Conflict` and a JSON-RPC error body using code `-32603`. ## Version Compatibility For V0 method names, payload differences, and migration guidance, see [Version Compatibility](/a2a/version-compatibility). # Overview Source: https://docs.clix.so/a2a/overview Use the Agent-to-Agent (A2A) protocol to let external agents execute Clix skills through JSON-RPC. The [Agent-to-Agent (A2A)](https://a2a-protocol.org/latest/specification/) protocol lets one agent discover another agent, negotiate capabilities, and exchange task-oriented JSON-RPC messages. Clix exposes A2A so your agent can create users, track events, send push notifications, and trigger campaigns through a single remote-agent interface. ## What Clix Supports Clix currently documents and supports this A2A surface: * `GET /.well-known/agent-card.json` for public agent discovery * `POST /a2a` for JSON-RPC 2.0 method calls * `JSONRPC` as the only advertised protocol binding * `X-API-Key` with a Secret API Key (`clix_sk_...`) for authenticated calls * Four built-in skills: `create-user`, `track-event`, `send-push-notification`, `trigger-campaign` Clix does not expose separate A2A HTTP+JSON or gRPC endpoints. Use the `supportedInterfaces` entry in the Agent Card and send JSON-RPC requests to `/a2a`. ## A2A vs MCP Clix supports two complementary protocols for AI integrations: | | MCP (Model Context Protocol) | A2A (Agent-to-Agent) | | - | - | - | | **Purpose** | Gives tools and context to an agent | Lets one agent delegate work to another agent | | **Integration shape** | Tool calls against an MCP server | JSON-RPC task execution against `/a2a` | | **Best fit** | Documentation lookup, SDK guidance, coding workflows | Operational actions such as user creation, event tracking, push delivery, and campaign triggers | Use [Clix MCP Server](/mcp-server/clix-mcp-server) when your assistant needs context. Use A2A when your agent needs to execute work inside Clix. ## Request Flow ``` 1. Client Agent -> GET /.well-known/agent-card.json -> Discover public capabilities 2. Client Agent -> POST /a2a GetExtendedAgentCard -> Read authenticated card 3. Client Agent -> POST /a2a SendMessage -> Execute a task 4. Client Agent -> POST /a2a GetTask/ListTasks -> Read task state or artifacts 5. Client Agent -> POST /a2a SendStreamingMessage -> Receive SSE status updates ``` ## Agent Card Shape With `A2A-Version: 1.0`, the public Agent Card uses v1 field names such as `supportedInterfaces`, `securitySchemes`, and `securityRequirements`. ```json theme={null} { "name": "Clix Agent", "description": "AI Agent for Clix - Send push notifications, manage campaigns, and track user events", "supportedInterfaces": [ { "url": "https://api.clix.so/a2a", "protocolBinding": "JSONRPC", "protocolVersion": "1.0" } ], "capabilities": { "streaming": true, "pushNotifications": true, "extendedAgentCard": true }, "securitySchemes": { "apiKey": { "apiKeySecurityScheme": { "name": "X-API-Key", "location": "header", "description": "Secret API key for A2A authentication" } } }, "securityRequirements": [ { "schemes": { "apiKey": [] } } ] } ``` The authenticated `GetExtendedAgentCard` method returns the same v1 schema. In the current Clix implementation, the main difference is a project-aware description string. ## Core Concepts ### Task A task is the unit of execution in Clix A2A. Tasks are created from `SendMessage` or `SendStreamingMessage` and tracked with `GetTask` or `ListTasks`. Current v1 task states serialize to protocol values: ``` submitted -> working -> completed -> failed -> canceled -> rejected -> input-required -> auth-required ``` ### Message A message is a communication turn. For client requests, use `role: "user"`. Agent-authored messages use `role: "agent"`. ### Part A message part can contain: * `text` for natural-language content * `data` for structured skill payloads For production integrations, prefer explicit `data.skill` payloads over natural-language-only requests. ### Artifact Artifacts hold task output. Each built-in Clix skill writes a named artifact such as `user-result`, `event-result`, `delivery-results`, or `trigger-result`. ## Protocol Versions Clix supports two protocol versions: | Version | Header Value | Status | | - | - | - | | V1 | `1.0` | Current and recommended | | V0 | `0.3` | Legacy compatibility mode | If you omit `A2A-Version`, Clix defaults to V0 behavior. Always send `A2A-Version: 1.0` when you want the v1 field names and method names documented here. ## Authentication Model Authenticated `/a2a` calls require: * `X-API-Key: clix_sk_...` * `Content-Type: application/json` To use the documented v1 field names and method names, also send `A2A-Version: 1.0`. Public API keys are rejected for `/a2a`. The project is resolved directly from the Secret API Key, so you do not send a separate project header. ## Next Steps Make your first v1 request and inspect the task lifecycle Review the four Clix skills, payloads, and artifacts Migrate from V0 to V1 without guessing the wire format # Quick Start Source: https://docs.clix.so/a2a/quickstart Connect your agent to Clix A2A, inspect the Agent Card, send a task, stream updates, and register a webhook. This guide walks through the recommended v1 flow: discover the Agent Card, fetch the authenticated extended card, execute a task, inspect the request ID, stream updates, and register a task webhook. ## Prerequisites * A Clix project created at [console.clix.so](https://console.clix.so) * A Secret API Key prefixed with `clix_sk_` * An HTTP client that can send JSON and read SSE `/a2a` accepts only Secret API Keys. Public keys and browser-exposed keys are rejected. ## Base URL ```text theme={null} https://api.clix.so ``` ## Step 1: Read the Public Agent Card The public Agent Card requires no authentication. ```bash curl theme={null} curl https://api.clix.so/.well-known/agent-card.json \ -H "A2A-Version: 1.0" ``` ```python Python theme={null} import httpx response = httpx.get( "https://api.clix.so/.well-known/agent-card.json", headers={"A2A-Version": "1.0"}, ) agent_card = response.json() print(agent_card["name"]) print(agent_card["supportedInterfaces"][0]["url"]) print(agent_card["capabilities"]["streaming"]) ``` Look for these v1 fields in the response: | Field | Meaning | | - | - | | `supportedInterfaces` | Endpoint URL and binding metadata | | `capabilities` | `streaming`, `pushNotifications`, `extendedAgentCard` | | `securitySchemes` | Required header auth scheme | | `skills` | The four Clix skills and examples | ## Step 2: Fetch the Authenticated Extended Card `GetExtendedAgentCard` is an authenticated JSON-RPC method on `/a2a`. ```bash theme={null} curl -X POST https://api.clix.so/a2a \ -H "Content-Type: application/json" \ -H "A2A-Version: 1.0" \ -H "X-API-Key: clix_sk_your_secret_key" \ -d '{ "jsonrpc": "2.0", "id": "card-1", "method": "GetExtendedAgentCard", "params": {} }' ``` The current Clix implementation returns the same v1 Agent Card schema as the public card, with a project-aware description. ## Step 3: Send Your First Task This example runs the `create-user` skill synchronously with `SendMessage`. ```bash curl theme={null} curl -i -X POST https://api.clix.so/a2a \ -H "Content-Type: application/json" \ -H "A2A-Version: 1.0" \ -H "X-API-Key: clix_sk_your_secret_key" \ -d '{ "jsonrpc": "2.0", "id": "req-1", "method": "SendMessage", "params": { "message": { "messageId": "msg-1", "role": "user", "parts": [ { "text": "Create a user in Clix" }, { "data": { "skill": "create-user", "projectUserId": "user_123", "properties": { "email": "user@example.com", "plan": "premium" } } } ] } } }' ``` ```python Python theme={null} import httpx response = httpx.post( "https://api.clix.so/a2a", headers={ "Content-Type": "application/json", "A2A-Version": "1.0", "X-API-Key": "clix_sk_your_secret_key", }, json={ "jsonrpc": "2.0", "id": "req-1", "method": "SendMessage", "params": { "message": { "messageId": "msg-1", "role": "user", "parts": [ {"text": "Create a user in Clix"}, { "data": { "skill": "create-user", "projectUserId": "user_123", "properties": { "email": "user@example.com", "plan": "premium", }, } }, ], } }, }, ) task = response.json()["result"]["task"] print(response.headers["X-Request-ID"]) print(task["id"]) print(task["status"]["state"]) print(task["artifacts"][0]["parts"][0]["data"]) ``` Important request fields: | Field | Meaning | | - | - | | `message.messageId` | Unique message ID and fallback idempotency key | | `message.role` | Use `"user"` for client-authored messages | | `message.parts[].data.skill` | Explicit Clix skill selector | Important response header: | Header | Meaning | | - | - | | `X-Request-ID` | Response header for tracing and support investigations | Example response excerpt: ```json theme={null} { "jsonrpc": "2.0", "id": "req-1", "result": { "task": { "id": "550e8400-e29b-41d4-a716-446655440000", "contextId": "ctx-001", "status": { "state": "completed", "timestamp": "2026-03-11T12:00:00Z" }, "artifacts": [ { "artifactId": "art-001", "name": "user-result", "parts": [ { "data": { "userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "projectUserId": "user_123" } } ] } ] } } } ``` ## Step 4: Stream Status Updates with SSE Use `SendStreamingMessage` when you want task progress over Server-Sent Events. ```bash curl theme={null} curl -N -X POST https://api.clix.so/a2a \ -H "Content-Type: application/json" \ -H "A2A-Version: 1.0" \ -H "X-API-Key: clix_sk_your_secret_key" \ -d '{ "jsonrpc": "2.0", "id": "stream-1", "method": "SendStreamingMessage", "params": { "message": { "messageId": "msg-stream-1", "role": "user", "parts": [ { "data": { "skill": "track-event", "eventName": "purchase", "deviceId": "device_abc", "properties": { "amount": 29.99, "currency": "USD" } } } ] } } }' ``` ```python Python theme={null} import json import httpx with httpx.stream( "POST", "https://api.clix.so/a2a", headers={ "Content-Type": "application/json", "A2A-Version": "1.0", "X-API-Key": "clix_sk_your_secret_key", }, json={ "jsonrpc": "2.0", "id": "stream-1", "method": "SendStreamingMessage", "params": { "message": { "messageId": "msg-stream-1", "role": "user", "parts": [ { "data": { "skill": "track-event", "eventName": "purchase", "deviceId": "device_abc", "properties": {"amount": 29.99, "currency": "USD"}, } } ], } }, }, ) as response: for line in response.iter_lines(): if line.startswith("data: "): event = json.loads(line[6:]) print(event["result"]["statusUpdate"]["status"]["state"]) ``` Current built-in Clix skills emit JSON-RPC SSE envelopes like: ```text theme={null} data: {"jsonrpc":"2.0","id":"stream-1","result":{"statusUpdate":{"taskId":"task-uuid","contextId":"ctx-uuid","status":{"state":"submitted"}}}} data: {"jsonrpc":"2.0","id":"stream-1","result":{"statusUpdate":{"taskId":"task-uuid","contextId":"ctx-uuid","status":{"state":"completed","timestamp":"2026-03-11T12:00:00Z"}}}} ``` ## Step 5: Read the Task Later You can re-read the task directly or list tasks for a context. ```bash theme={null} curl -X POST https://api.clix.so/a2a \ -H "Content-Type: application/json" \ -H "A2A-Version: 1.0" \ -H "X-API-Key: clix_sk_your_secret_key" \ -d '{ "jsonrpc": "2.0", "id": "req-2", "method": "GetTask", "params": { "id": "550e8400-e29b-41d4-a716-446655440000" } }' ``` ```bash theme={null} curl -X POST https://api.clix.so/a2a \ -H "Content-Type: application/json" \ -H "A2A-Version: 1.0" \ -H "X-API-Key: clix_sk_your_secret_key" \ -d '{ "jsonrpc": "2.0", "id": "req-3", "method": "ListTasks", "params": { "pageSize": 10, "contextId": "ctx-001" } }' ``` `ListTasks` returns `tasks`, `nextPageToken`, `pageSize`, and `totalSize`. On follow-up cursor requests, the current Clix implementation returns `totalSize: 0`, so capture the first page if you need the total count. ## Step 6: Register a Task Webhook Task push notifications are webhooks for task lifecycle events. ```bash theme={null} curl -X POST https://api.clix.so/a2a \ -H "Content-Type: application/json" \ -H "A2A-Version: 1.0" \ -H "X-API-Key: clix_sk_your_secret_key" \ -d '{ "jsonrpc": "2.0", "id": "req-4", "method": "CreateTaskPushNotificationConfig", "params": { "taskId": "550e8400-e29b-41d4-a716-446655440000", "url": "https://example.com/a2a-webhook", "token": "verify-me", "authentication": { "scheme": "Bearer", "credentials": "webhook-secret" } } }' ``` Clix will call your webhook with a JSON-RPC request whose `method` is `tasks/pushNotification` and whose event payload is inside `params.result`. ## Authentication Errors If authentication fails, `/a2a` returns HTTP errors instead of a JSON-RPC method result. | Status | Cause | Fix | | - | - | - | | `401 Unauthorized` | Missing or invalid secret key | Send a valid `X-API-Key` header | | `403 Forbidden` | Public or browser-safe API key | Switch to a Secret API Key with the `clix_sk_` prefix | ## Next Steps Review every method, data type, and error code See webhook payloads, SSE behavior, and idempotency details Pick the exact payload shape for each built-in skill # Skills Source: https://docs.clix.so/a2a/skills Payload shapes, artifacts, and usage notes for the four built-in Clix A2A skills. Clix currently exposes four built-in A2A skills. For production integrations, always specify the skill explicitly in a `data` part. ## Canonical Request Pattern ```json theme={null} { "jsonrpc": "2.0", "id": "req-1", "method": "SendMessage", "params": { "message": { "messageId": "msg-1", "role": "user", "parts": [ { "data": { "skill": "create-user" } } ] } } } ``` Clix can infer a skill from text-only requests, but that routing is best-effort. Use `data.skill` when correctness matters. ## Skill Summary | Skill | Purpose | Artifact | | - | - | - | | `create-user` | Create or update a Clix user by project user ID | `user-result` | | `track-event` | Track a custom event for a device | `event-result` | | `send-push-notification` | Send an app push notification to one target | `delivery-results` | | `trigger-campaign` | Create a campaign trigger with optional explicit targets | `trigger-result` | ## create-user Creates or updates a user and writes a `user-result` artifact. ### Parameters | Field | Type | Required | Description | | - | - | - | - | | `skill` | string | Yes | Must be `create-user` | | `projectUserId` | string | Yes | Your application user ID | | `properties` | object | No | Arbitrary user properties | ### Artifact ```json theme={null} { "artifactId": "art-uuid", "name": "user-result", "parts": [ { "data": { "userId": "uuid", "projectUserId": "user_123" } } ] } ``` ## track-event Tracks one event for one device and writes an `event-result` artifact. ### Parameters | Field | Type | Required | Description | | - | - | - | - | | `skill` | string | Yes | Must be `track-event` | | `eventName` | string | Yes | Event name such as `purchase` or `sign_up` | | `deviceId` | string | Yes | Device identifier | | `properties` | object | No | Custom event properties | ### Artifact ```json theme={null} { "artifactId": "art-uuid", "name": "event-result", "parts": [ { "data": { "trackedEvents": 1.0, "eventName": "purchase" } } ] } ``` ## send-push-notification Sends one push notification request and writes a `delivery-results` artifact. ### Parameters | Field | Type | Required | Description | | - | - | - | - | | `skill` | string | Yes | Must be `send-push-notification` | | `deviceId` | string | Conditionally | One valid target selector | | `userId` | string | Conditionally | One valid target selector | | `projectUserId` | string | Conditionally | One valid target selector | | `title` | string | No | Notification title | | `body` | string | No | Notification body | | `imageUrl` | string | No | Rich notification image URL | | `landingUrl` | string | No | Deep link or URL opened on tap | At least one of `deviceId`, `userId`, or `projectUserId` must be present. ### Artifact ```json theme={null} { "artifactId": "art-uuid", "name": "delivery-results", "parts": [ { "data": { "totalSent": 1.0, "results": [ { "messageId": "msg-uuid", "status": "DELIVERY_RESULT_STATUS_SUCCEED" } ] } } ] } ``` `results[].status` is the raw delivery result enum string produced by Clix, such as `DELIVERY_RESULT_STATUS_SUCCEED` or `DELIVERY_RESULT_STATUS_FAILED`. ## trigger-campaign Creates a trigger for an existing campaign and writes a `trigger-result` artifact. ### Parameters | Field | Type | Required | Description | | - | - | - | - | | `skill` | string | Yes | Must be `trigger-campaign` | | `campaignId` | string | Yes | Campaign identifier | | `targets` | array | No | Explicit target list using `deviceId`, `userId`, or `projectUserId` | | `properties` | object | No | Trigger properties | `targets` can be omitted or empty. In that case, Clix creates the trigger without an explicit target list. ### Artifact ```json theme={null} { "artifactId": "art-uuid", "name": "trigger-result", "parts": [ { "data": { "triggerId": "trigger-uuid" } } ] } ``` ## Example Payloads ### create-user ```json theme={null} { "skill": "create-user", "projectUserId": "user_123", "properties": { "email": "user@example.com", "plan": "premium" } } ``` ### track-event ```json theme={null} { "skill": "track-event", "eventName": "purchase", "deviceId": "device_abc", "properties": { "amount": 29.99, "currency": "USD" } } ``` ### send-push-notification ```json theme={null} { "skill": "send-push-notification", "projectUserId": "user_123", "title": "Welcome", "body": "Thanks for signing up.", "landingUrl": "myapp://welcome" } ``` ### trigger-campaign ```json theme={null} { "skill": "trigger-campaign", "campaignId": "camp_abc123", "targets": [ { "projectUserId": "user_123" } ], "properties": { "promo_code": "WELCOME10" } } ``` # Version Compatibility Source: https://docs.clix.so/a2a/version-compatibility Differences between Clix A2A V1 and legacy V0, with concrete migration guidance. Clix supports both A2A V1 and legacy V0. New integrations should use V1 by sending `A2A-Version: 1.0`. If you omit the `A2A-Version` header, Clix resolves the request as V0 (`0.3`). ## Method Mapping | V1 | V0 | | - | - | | `SendMessage` | `message/send` | | `SendStreamingMessage` | `message/stream` | | `GetTask` | `tasks/get` | | `ListTasks` | `tasks/list` | | `CancelTask` | `tasks/cancel` | | `SubscribeToTask` | `tasks/resubscribe` | | `CreateTaskPushNotificationConfig` | `tasks/pushNotificationConfig/set` | | `GetTaskPushNotificationConfig` | `tasks/pushNotificationConfig/get` | | `ListTaskPushNotificationConfigs` | `tasks/pushNotificationConfig/list` | | `DeleteTaskPushNotificationConfig` | `tasks/pushNotificationConfig/delete` | | `GetExtendedAgentCard` | `agent/getAuthenticatedExtendedCard` | ## Key Wire-Format Differences ### Agent Card | Area | V1 | V0 | | - | - | - | | Endpoint metadata | `supportedInterfaces` | `url`, `preferredTransport`, `additionalInterfaces` | | Auth metadata | `securitySchemes`, `securityRequirements` | `securitySchemes`, `security` | | Extended card capability | `capabilities.extendedAgentCard` | `supportsAuthenticatedExtendedCard` | | Protocol version field | Per interface `protocolVersion` | Top-level `protocolVersion` | ### Message and Task Objects | Area | V1 | V0 | | - | - | - | | Part discriminator | No `kind` field | `kind` is required on parts | | Message shape | `messageId`, `role`, `parts` | Same camelCase fields plus `kind: "message"` | | Task shape | `id`, `contextId`, `status`, `artifacts` | Same camelCase fields plus `kind: "task"` | | Stream events | JSON-RPC envelope with v1 `StreamResponse` result | JSON-RPC envelope with V0 event objects such as `kind: "status-update"` | ### Pagination | Area | V1 | V0 | | - | - | - | | Request params | `pageSize`, `pageToken` | `limit`, `offset` | | Response shape | `{ tasks, nextPageToken, pageSize, totalSize }` | Array of tasks | | Total count | First page only in current Clix implementation | Not returned | ### Push Notification Config Params | Operation | V1 | V0 | | - | - | - | | Create | `params` is the config object itself with `taskId`, `url`, `id?`, `token?`, `authentication?` | `params` is `{ taskId, pushNotificationConfig: { ... } }` | | Get | `{ taskId, id }` | `{ id, pushNotificationConfigId }` | | List | `{ taskId }` | `{ id }` | | Delete | `{ taskId, id }` | `{ id, pushNotificationConfigId }` | ### SendMessage Result Shape | Version | Result | | - | - | | V1 | `{ "result": { "task": { ... } } }` | | V0 | `{ "result": { ...task... } }` | ## Role and State Values The protocol values are the same across Clix V0 and V1: * Roles serialize as `user`, `agent`, and `unspecified` * Task states serialize as `submitted`, `working`, `completed`, `failed`, and other lowercase protocol values The main compatibility differences are method names, container shapes, and pagination models, not the role or state strings. ## Example Migration ### V0 request ```json theme={null} { "jsonrpc": "2.0", "id": "req-1", "method": "message/send", "params": { "message": { "kind": "message", "messageId": "msg-1", "role": "user", "parts": [ { "kind": "data", "data": { "skill": "create-user", "projectUserId": "user_123" } } ] } } } ``` ### V1 request Send this request with `A2A-Version: 1.0`. If you omit the header, Clix interprets the request as V0. ```json theme={null} { "jsonrpc": "2.0", "id": "req-1", "method": "SendMessage", "params": { "message": { "messageId": "msg-1", "role": "user", "parts": [ { "data": { "skill": "create-user", "projectUserId": "user_123" } } ] } } } ``` ## Migration Checklist 1. Start sending `A2A-Version: 1.0` on every request, including the public Agent Card request. 2. Rename JSON-RPC methods from slash-style V0 names to the PascalCase V1 names. 3. Remove `kind` fields from message parts and stop expecting `kind` on messages, tasks, and stream events. 4. Update `SendMessage` callers to read `result.task` instead of reading the task directly from `result`. 5. Replace `limit` and `offset` with `pageSize` and `pageToken`, and update your parser for the paged `ListTasks` response object. 6. Update task webhook config params to the V1 `taskId` and `id` field names. ## When to Keep V0 Keep V0 only if you already have a deployed client that depends on the older method names or older object wrappers. For any new integration, V1 is the stable documentation target. # Agent Skills for Clix Source: https://docs.clix.so/agent-skills/index A collection of Clix Agent Skills designed to accelerate development, from initial SDK integration with MCP support to event tracking, user management, personalization templates, and API-triggered campaigns. # Overview
View the Clix Agent Skills package on npm npm version View Clix Agent Skills download stats on npm npm downloads

This repository contains a collection of **Agent Skills for Clix**. Each skill is a separate module within this package that can be installed and used independently by AI clients.

## Available Skills ### Clix Skills * **clix-integration**: Seamlessly integrate Clix Mobile SDK to your mobile application with Clix MCP Server * **clix-event-tracking**: Implement `Clix.trackEvent` with naming/schema best practices and campaign-ready validation * **clix-user-management**: Implement `Clix.setUserId` + user properties with logout best practices, personalization (`user.*`), and audience targeting * **clix-personalization**: Author and debug personalization templates for message content, deep links/URLs, and audience targeting rules (`user.*`, `event.*`, `trigger.*`, `device.*`) * **clix-api-triggered-campaigns**: Configure API-triggered campaigns in the console and trigger them from your backend with safe auth, dynamic filters (`trigger.*`), and personalization patterns * **clix-skill-creator**: Create new Clix agent skills by researching Clix SDK + docs via Clix MCP Server, then generating a complete skill folder (SKILL.md, references, scripts, examples) aligned with this repo’s conventions ### Skills for Mobile Developers * **auditing-permission-ux**: Audit notification permission request UX and settings recovery flows for iOS and Android * **auditing-deep-link-contracts**: Audit deep link contracts with cold/warm start test vectors and routing checks ## Installing Skills Agent skills in this repository are built on the [open agent skills standard](https://agentskills.io/home). Please refer to the [official documentation](https://agentskills.io/home#adoption) for up-to-date information on supported AI clients. Depending on the AI client you are using, you can install skills in different ways. ### Universal CLI (Recommended) For Amp, Claude Code, Codex, Copilot, Cursor, Goose, Letta, OpenCode, and VS Code, we recommend using our installer to set up the skills and automatically configure the Clix MCP Server. #### Installation Modes The CLI supports two installation modes for skills: **Repo Root (Project-specific)** - Installs skills to the current project directory (default). Skills are available only for the current project. Best for project-specific configurations. **System Root (Global)** - Installs skills to your home directory. Skills are available across all projects. Best for personal development setup. ```bash theme={null} # Install a specific skill (repo root - default) # Default install path (when --client is omitted): .agents/skills/ npx @clix-so/clix-agent-skills@latest install --client # For example, to install a skill on Cursor: npx @clix-so/clix-agent-skills@latest install integration --client cursor # Install a specific skill globally (system root) npx @clix-so/clix-agent-skills@latest install --client --global # For example: npx @clix-so/clix-agent-skills@latest install integration --client cursor --global # Install all available skills at once (repo root) npx @clix-so/clix-agent-skills@latest install --all --client cursor # This will install: integration, event-tracking, user-management, personalization, api-triggered-campaigns, skill-creator, auditing-permission-ux, auditing-deep-link-contracts # Install all available skills globally (system root) npx @clix-so/clix-agent-skills@latest install --all --client cursor --global ``` **Supported Clients:** | Client | Flag | Project Path | System Path | | - | - | - | - | | Default (no `--client`) | *n/a* | `.agents/skills/` | `~/.agents/skills/` | | Amp | `--client amp` | `.agents/skills/` | `~/.config/agents/skills/` | | Claude Code | `--client claude` | `.claude/skills/` | `~/.claude/skills/` | | Codex | `--client codex` | `.codex/skills/` | `~/.codex/skills/` | | Cursor | `--client cursor` | `.cursor/skills/` | `~/.cursor/skills/` | | Factory | `--client factory` | `.factory/skills/` | `~/.factory/skills/` | | Gemini CLI | `--client gemini` | `.gemini/skills/` | `~/.gemini/skills/` | | Google Antigravity | `--client antigravity` | `.agent/skills/` | `~/.gemini/antigravity/skills/` | | GitHub Copilot | `--client github` | `.github/skills/` | `~/.github/skills/` | | Goose | `--client goose` | `.agents/skills/` | `~/.config/agents/skills/` | | Letta | `--client letta` | `.skills/` | `~/.skills/` | | OpenCode | `--client opencode` | `.opencode/skill/` | `~/.opencode/skill/` | | VS Code | `--client vscode` | `.vscode/skills/` | `~/.vscode/skills/` | ### Claude Code (Alternative setup via plugin marketplace) To register this repository as a plugin marketplace in Claude Code, run the following command: ```bash theme={null} /plugin marketplace add clix-so/skills ``` To install specific skills: 1. Visit the Marketplace section in `/plugin` 2. Select `Browse plugins` 3. Choose the skills you wish to install 4. Install your preferred skill Alternatively, you can install a single skill directly by running: ```bash theme={null} /plugin install @ # For example /plugin install clix-integration@clix-agent-skills ``` **Note for Claude Code users**: Skills now support automatic hot-reload! Skills created or modified in `~/.claude/skills` or `.claude/skills` are immediately available without restarting the session. Skills also show real-time progress while executing, displaying tool uses as they happen. ### Codex (Alternative setup via skill-installer) To manually install skills, save them from this repository into your Codex configuration directory: [https://developers.openai.com/codex/skills/#where-to-save-skills](https://developers.openai.com/codex/skills/#where-to-save-skills) Or install a specific skill using the command line: ```bash theme={null} $skill-installer install # For example $skill-installer install https://github.com/clix-so/skills/tree/main/skills/integration ``` Ensure you restart Codex after installation to detect the new skills. ## Disclaimer Please be aware that these skills may occasionally fail or execute incorrectly due to the non-deterministic nature of AI. It is critical that you carefully review and verify all actions performed by these skills. While they are designed to be helpful, you remain responsible for checking their output before use. Please use them with caution and supervision. ## License Each skill in this repository is governed by its own license. For specific terms and conditions, please consult the `LICENSE.txt` file located within each skill's individual directory. ## Feedback & Contributions We welcome bug reports, feature requests, and community contributions. If you have any feedback, please open an issue or pull request: * GitHub repository: [https://github.com/clix-so/skills](https://github.com/clix-so/skills) * Package & release notes: [https://www.npmjs.com/package/@clix-so/clix-agent-skills](https://www.npmjs.com/package/@clix-so/clix-agent-skills) # Trigger Campaign Source: https://docs.clix.so/api-reference/endpoint/campaigns:trigger POST /api/v1/campaigns/{campaign_id}:trigger Triggers an API-triggered campaign to send messages to a specific audience ## Overview Triggers an API-triggered campaign to send messages to a specific audience. This endpoint allows you to send immediate, one-off messages to designated users or broadcast to your entire audience using a pre-configured campaign. For a comprehensive guide on setting up and using API-triggered campaigns, see the [API-Triggered Campaigns guide](/campaigns/api-triggered). ## Authentication This endpoint requires authentication via the following HTTP headers: * `X-Clix-Project-ID`: Your project ID * `X-Clix-API-Key`: Your Clix Secret API Key ## Path Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `campaign_id` | string | Yes | The unique identifier of the campaign to trigger | ## Request Body | Field | Type | Required | Description | | - | - | - | - | | `audience` | object | No | Defines the target audience for this campaign trigger | | `properties` | map | No | Custom properties to pass to the campaign for personalization | ### Audience Object | Field | Type | Required | Description | | - | - | - | - | | `broadcast` | boolean | No | If `true`, sends to all users matching the campaign's segment definition. Ignores `targets` if set. Default: `false` | | `targets` | array | No | Array of specific users/devices to target. Only users matching the campaign's segment definition will receive the message. Ignored if `broadcast` is `true`. | ### Target Object Each target should specify **one** of the following: | Field | Type | Description | | - | - | - | | `project_user_id` | string | Target a user by your project's user ID | | `device_id` | string | Target a specific device by ID | ### Properties Custom properties are passed as key-value pairs and can be used for: * **Message personalization**: Insert values in message templates using `{{ trigger.property_name }}` * **Dynamic audience filtering**: Reference values in audience conditions configured in the console See [Personalization](/personalization/personalization) for template syntax details. ```json theme={null} { "name": "John Doe", "age": 40, "is_premium_user": true, "state": "CA", "city": "Mountain View" } ``` ## Example Requests ### Broadcast to All Eligible Users Send to all users matching the campaign's segment definition: ```json theme={null} { "audience": { "broadcast": true }, "properties": { "promotion": "Holiday Sale", "discount": "30%" } } ``` ### Target Specific Users Send to specific users, but only those who match the campaign's segment definition: ```json theme={null} { "audience": { "broadcast": false, "targets": [ { "project_user_id": "clix_user_a" }, { "project_user_id": "clix_user_b" } ] }, "properties": { "subscription_plan": "premium", "message_type": "transactional" } } ``` ### Trigger Without Audience (Uses Campaign's Default Audience) ```json theme={null} { "properties": { "campaign_variant": "A" } } ``` ### Dynamic Filtering and Personalization This example shows how to use properties for both audience filtering and message content. **Campaign configuration in console:** * Audience filter: `user_role == "store_staff" AND store_location == {{ trigger.store_location }}` * Message title: `New pickup order` * Message body: `Order #{{ trigger.order_id }} from {{ trigger.customer_name }}. {{ trigger.item_count }} items ready by {{ trigger.pickup_time }}.` **API request:** ```json theme={null} { "audience": { "broadcast": true }, "properties": { "store_location": "San Francisco", "customer_name": "Sarah Johnson", "order_id": "ORD-12345", "item_count": "3", "pickup_time": "2:30 PM" } } ``` This will: 1. Filter to users where `user_role == "store_staff"` AND `store_location == "San Francisco"` 2. Send a message with title "New pickup order" 3. And body "Order #ORD-12345 from Sarah Johnson. 3 items ready by 2:30 PM." ## Response ### Success Response (200 OK) Returns a trigger identifier for tracking the campaign send: ```json theme={null} { "trigger_id": "5dbdd10e-6ea6-4ff7-836d-bd30a6d1a521" } ``` The `trigger_id` can be used to track the status and results of this specific campaign trigger. ### Error Responses #### 400 Bad Request Returned when: * `campaign_id` is missing or invalid * Request body is malformed * Failed to send campaign trigger message Returns a plain text error message: ``` Campaign Id must be provided ``` or ``` Failed to send campaign trigger message ``` #### 401 Unauthorized Authentication failed or invalid API key. ## Notes * Campaign must be configured as "API-Triggered" in the dashboard before it can be triggered via this endpoint * **Segment Filtering**: All messages are filtered by the campaign's segment definition: * When `broadcast` is `true`, the campaign sends to all users who match the campaign's segment criteria * When `broadcast` is `false` (or omitted) and `targets` are specified, only the targeted users who also match the campaign's segment criteria will receive the message * Users who don't match the segment criteria will not receive messages, even if explicitly targeted * When targeting specific users, you can mix different target types (device\_id, user\_id, project\_user\_id) in the same request * Properties are optional but highly recommended for personalized messaging * The `trigger_id` in the response can be used to track delivery results and campaign analytics * Message delivery is asynchronous - the API returns immediately with a trigger\_id, and messages are processed in the background * Rate limits apply based on your project plan # Start Live Activities Source: https://docs.clix.so/api-reference/endpoint/live-activities:start POST /api/v1/live-activities:start This endpoint starts iOS Live Activities on one or more user devices using Push to Start. ## Error Responses ### 400 Bad Request Returned when the request contains invalid live activity parameters. Returns a plain text error message: ``` Invalid live activity parameters ``` ### 401 Unauthorized Authentication failed or invalid API key. # Send Messages Source: https://docs.clix.so/api-reference/endpoint/messages:send POST /api/v1/messages:send This endpoint sends push notifications to one or more user devices. ## Error Responses ### 400 Bad Request Returned when the request contains invalid push notification parameters. Returns a plain text error message: ``` Invalid push notification parameters ``` ### 401 Unauthorized Authentication failed or invalid API key. # Create User Source: https://docs.clix.so/api-reference/endpoint/users/create POST /api/v1/users Creates a new user with the specified project_user_id ## Overview Creates a new user with the specified `project_user_id`. This endpoint allows you to register users in your project and optionally set their properties. ## Authentication This endpoint requires authentication via the following HTTP headers: * `X-Clix-Project-ID`: Your project ID * `X-Clix-API-Key`: Your Clix Secret API Key ## Request Body | Field | Type | Required | Description | | - | - | - | - | | `project_user_id` | string | Yes | Unique identifier for the user in your project | | `properties` | object | No | User properties as key-value pairs where values can be string, number, boolean, or null | ## Example Request ```json theme={null} { "project_user_id": "clix_user", "properties": { "email": "user@example.com", "age": 25, "premium": true, "subscription_tier": "gold" } } ``` ## Response ### Success Response (200 OK) Returns the created user properties: ```json theme={null} { "properties": { "email": "user@example.com", "age": 25, "premium": true, "subscription_tier": "gold" } } ``` ### Error Responses #### 400 Bad Request Returned when: * `project_user_id` is missing or invalid * Request body is malformed Returns a plain text error message: ``` Project User Id must be provided ``` #### 401 Unauthorized Authentication failed or invalid API key. ## Notes * The `project_user_id` must be unique within your project * If a user with the same `project_user_id` already exists, this endpoint will update the existing user's properties * User properties are optional but recommended for personalization and segmentation * The response returns only the properties object, not the full user object # Delete User Source: https://docs.clix.so/api-reference/endpoint/users/delete DELETE /api/v1/users/{project_user_id} Permanently deletes a user and all associated data ## Overview Permanently deletes a user identified by their `project_user_id`. This action is irreversible and will remove the user and all associated data from your project. ## Authentication This endpoint requires authentication via the following HTTP headers: * `X-Clix-Project-ID`: Your project ID * `X-Clix-API-Key`: Your Clix Secret API Key ## Path Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `project_user_id` | string | Yes | The unique identifier of the user to delete | ## Example Request ```bash theme={null} DELETE /api/v1/users/clix_user ``` No request body is required for this endpoint. ## Response ### Success Response (200 OK) Returns an empty response indicating successful deletion: ```json theme={null} {} ``` ### Error Responses #### 400 Bad Request Returned when: * `project_user_id` is missing or invalid Returns a plain text error message: ``` Project User Id must be provided ``` #### 401 Unauthorized Authentication failed or invalid API key. ## Notes * This operation is **irreversible** - deleted users cannot be recovered * All user data including properties, devices, and event history will be permanently removed * If you need to temporarily disable a user, consider updating their properties instead of deleting * After deletion, the same `project_user_id` can be reused to create a new user * Associated devices will also be removed when the user is deleted * The endpoint does not return a 404 error - it returns 200 OK even if the user doesn't exist # Update User Source: https://docs.clix.so/api-reference/endpoint/users/update PATCH /api/v1/users/{project_user_id} Updates user properties ## Overview Updates an existing user identified by their `project_user_id`. This endpoint allows you to modify user properties. Only the fields provided in the request will be updated. ## Authentication This endpoint requires authentication via the following HTTP headers: * `X-Clix-Project-ID`: Your project ID * `X-Clix-API-Key`: Your Clix Secret API Key ## Path Parameters | Parameter | Type | Required | Description | | - | - | - | - | | `project_user_id` | string | Yes | The unique identifier of the user to update | ## Request Body | Field | Type | Required | Description | | - | - | - | - | | `properties` | object | No | User properties to update as key-value pairs where values can be string, number, boolean, or null | ## Example Request ```bash theme={null} PATCH /api/v1/users/clix_user ``` ```json theme={null} { "properties": { "email": "newemail@example.com", "subscription_tier": "premium", "last_login": "2025-01-10T12:00:00Z", "login_count": 42 } } ``` ## Response ### Success Response (200 OK) Returns the updated user properties: ```json theme={null} { "properties": { "email": "newemail@example.com", "subscription_tier": "premium", "last_login": "2025-01-10T12:00:00Z", "login_count": 42 } } ``` ### Error Responses #### 400 Bad Request Returned when: * `project_user_id` is missing or invalid * Request body is malformed Returns a plain text error message: ``` Project User Id must be provided ``` #### 404 Not Found The user with the specified `project_user_id` does not exist. Returns an empty response body with 404 status code. #### 401 Unauthorized Authentication failed or invalid API key. ## Notes * Only the properties provided in the request body will be updated * Existing properties not included in the request will remain unchanged * If the user does not exist, a 404 error will be returned * Properties with the same key will be overwritten with the new values * The response returns only the properties object, not the full user object # Overview Source: https://docs.clix.so/api-reference/overview Complete reference for Clix API endpoints The Clix API enables programmatic control of user management, messaging, campaign execution, and event tracking through server-to-server communication. Built on REST principles, it provides reliable endpoints designed to scale with your engagement needs. ### What You Can Do With the Clix API, you can: * **Manage Users** - Create, update, and delete project users; store and update custom user properties for segmentation and personalization * **Send Messages** - Deliver push notifications directly to user devices with custom content * **Trigger Campaigns** - Trigger pre-configured campaigns to specific users or broadcast to your entire user base ## Base URL ``` https://api.clix.so ``` All API requests must use HTTPS (TLS 1.2+) and be directed to the base URL above. ## Authentication Every Clix API request requires authentication through two custom headers that identify your project and authorize the request: | Header | Required | Description | | - | - | - | | `X-Clix-Project-ID` | Yes | Your project's unique identifier | | `X-Clix-API-Key` | Yes | Your API key (public or secret based on operation) | ### API Key Types and Use Cases Clix distinguishes between two API key types to provide flexibility and security: | Key Type | When to Use | Visibility | | - | - | - | | **Public API Key** | Client-side SDKs in mobile apps, browsers, or public environments | Safe to expose | | **Secret API Key** | Server-to-server communication, secure backend operations | Must keep confidential | ### Key Selection Guide * **Public Key**: Use for direct SDK integrations where your application frontend communicates with Clix * **Secret Key**: Use for sensitive operations including user management, message sending, and campaign triggering ### Example Request ```bash theme={null} curl -X POST https://api.clix.so/api/v1/users \ -H "X-Clix-Project-ID: your_project_id" \ -H "X-Clix-API-Key: your_secret_api_key" \ -H "Content-Type: application/json" \ -d '{ "user": { "project_user_id": "user_123" } }' ``` ### Protecting Your API Keys Secret API keys grant access to your project data and operations. Do not expose them in client-side code, version control repositories, or unencrypted logs. Key compromise may lead to unauthorized data access or operations. * Store keys in environment variables or dedicated secrets management platforms * Implement key rotation policies in your organization * Apply the principle of least privilege—use Public keys in client applications, Secret keys only in trusted backends * Regularly audit API key usage and revoke unused keys * Enable alerts if unusual API activity is detected ## Rate Limits Rate limits are applied to ensure fair usage and maintain service stability. If you exceed your rate limit, the API will return a `429 Too Many Requests` response. For detailed information about rate limiting policies and best practices, see [Rate Limits](/api-reference/rate-limits). ## Content Type The Clix API exclusively uses JSON for request and response bodies. ``` Content-Type: application/json ``` ## Response Codes and Error Handling Clix API responses follow standard HTTP conventions. The status code indicates the outcome of your request: ### Success Codes | Status Code | Meaning | Notes | | - | - | - | | `200` | OK | Request processed successfully, response body contains data | | `201` | Created | Resource successfully created (e.g., new user) | ### Client Error Codes | Status Code | Meaning | What to Do | | - | - | - | | `400` | Bad Request | Check request parameters, headers, and body format. Refer to endpoint documentation. | | `401` | Unauthorized | Verify API key and Project ID are correct and valid | | `404` | Not Found | The resource (user, campaign, etc.) doesn't exist. Verify the resource ID. | | `429` | Too Many Requests | Rate limit exceeded. See [Rate Limits](/api-reference/rate-limits) for retry strategies. | ### Server Error Codes | Status Code | Meaning | What to Do | | - | - | - | | `500` | Internal Server Error | Temporary server issue. Implement exponential backoff and retry. | | `503` | Service Unavailable | Scheduled maintenance or temporary outage. Retry after a delay. | ### Error Response Format When a request fails, the response body contains an error message: ```json theme={null} { "error": "Invalid project user ID format" } ``` ### Implementing Reliable Retries For production integrations, implement exponential backoff to handle transient failures gracefully: ```javascript theme={null} async function makeRequestWithRetry(url, options, maxAttempts = 3) { for (let attempt = 0; attempt < maxAttempts; attempt++) { try { const response = await fetch(url, options); // Don't retry client errors (4xx) - they won't succeed with retry if (response.status < 500) { return response; } // On last attempt, throw the error if (attempt === maxAttempts - 1) { throw new Error(`Server error: ${response.status}`); } // Calculate exponential backoff: 1s, 2s, 4s, etc. const delayMs = Math.pow(2, attempt) * 1000; await new Promise(resolve => setTimeout(resolve, delayMs)); } catch (error) { if (attempt === maxAttempts - 1) throw error; } } } ``` ## OpenAPI Specification The complete OpenAPI specification for the Clix API is available: View the complete OpenAPI specification ## API Endpoints ### Users Store and manage your project's user profiles. Users can have custom properties used for segmentation, personalization, and targeting. * [Create User](/api-reference/endpoint/users/create) - Register a new project user * [Update User](/api-reference/endpoint/users/update) - Modify user properties and attributes * [Delete User](/api-reference/endpoint/users/delete) - Permanently remove a user from your project ### Campaigns Campaigns are pre-configured message templates set up in your dashboard. Use the API to trigger campaigns to reach your users. * [Trigger Campaign](/api-reference/endpoint/campaigns:trigger) - Execute a campaign, targeting specific users or broadcast to all users matching campaign filters ### Messages Send ad-hoc push notifications outside of campaigns. Useful for transactional or time-sensitive messages. * [Send Messages](/api-reference/endpoint/messages:send) - Deliver push notifications directly to specified devices ## SDK Integration For easier integration, consider using our official SDKs: * [iOS SDK](/sdk-quickstart-ios) * [Android SDK](/sdk-quickstart-android) * [React Native SDK](/sdk-quickstart-react-native) * [Flutter SDK](/sdk-quickstart-flutter) ## Request Timeout API requests have a maximum execution time of **100 seconds**. If your request doesn't complete within this window, it will be terminated with a timeout error. Ensure your integration handles timeouts gracefully. ## Integration Guidelines Build robust integrations with these recommendations: * **Always use HTTPS** - Connections must be encrypted with TLS 1.2 or higher * **Implement exponential backoff** - Automatically retry on 5xx errors with increasing delays (1s, 2s, 4s...) * **Respect rate limits** - Monitor response status and throttle requests to stay within limits * **Log responses** - Track API responses for debugging and monitoring * **Validate inputs** - Check that project user IDs and other identifiers match expected formats * **Choose keys wisely** - Use Public keys for SDKs, Secret keys only for backend services For rate limiting specifics and strategies, see the [Rate Limits](/api-reference/rate-limits) guide. ## Support Need help? Contact our support team: * Email: [support@clix.so](mailto:support@clix.so) * Documentation: [https://docs.clix.so](https://docs.clix.so) # Rate Limits Source: https://docs.clix.so/api-reference/rate-limits Understanding rate limits for the Clix API **TL;DR** * **Rate Limit**: 1,000 requests per second for Management API * **Request Size**: Maximum 10 MB per request * **Error Response**: Returns `429 Too Many Requests` when limit is exceeded The Clix API enforces rate limits to maintain service quality and fair resource allocation. Rate limiting ensures all projects can reliably use the platform without any single project impacting others. ## How Rate Limiting Works The Clix API uses a **token bucket algorithm** to manage request rates. Here's how it works: 1. **Token Bucket** - Each project starts with a fixed number of tokens 2. **Request Cost** - Each API request consumes one token 3. **Refill** - The token bucket refills at regular intervals 4. **Tracking** - Rate limits are tracked per project using the `X-Clix-Project-ID` header When your bucket has tokens available, requests succeed. When tokens are exhausted, requests receive a `429 Too Many Requests` response until the bucket refills. ### Rate Limit Policy | API Group | Limit | Time Window | | - | - | - | | Management Operations | 1,000 requests | 1 second | **Management Operations** include: * User management endpoints (create, update, delete users) * Message sending endpoints * Campaign triggering endpoints ## Understanding Response Headers Every API response includes rate limit information in the response headers: | Header | Description | Example | | - | - | - | | `X-RateLimit-Limit` | Total tokens in your bucket (requests per refill period) | `1000` | | `X-RateLimit-Remaining` | Tokens available right now | `842` | | `X-RateLimit-Reset` | Unix timestamp (seconds) when bucket refills | `1699617005` | These headers let you monitor your current token balance and plan your requests accordingly. ## When You Hit a Rate Limit Exceeding your rate limit results in a **429 Too Many Requests** HTTP response: ```json theme={null} { "error": "Too Many Requests" } ``` ### What Happens Next * Your bucket is temporarily empty (no tokens available) * The bucket automatically refills after the interval specified in your rate limit * For Management API: The bucket refills every **1 second** with 1,000 tokens * You can immediately retry after the refill time shown in `X-RateLimit-Reset` header ### Retry-After Header When rate limited, the response includes: ``` Retry-After: 1 ``` This tells you how many seconds to wait before your next request will likely succeed. ## Designing for Scale ### Strategy 1: Exponential Backoff Retry Logic When receiving a 429 response, automatically retry with increasing delays: ```javascript theme={null} async function retryWithBackoff(makeRequest, maxRetries = 3) { let lastError; for (let attempt = 0; attempt < maxRetries; attempt++) { try { return await makeRequest(); } catch (error) { if (error.status !== 429) throw error; lastError = error; if (attempt < maxRetries - 1) { // Exponential backoff: 1s, 2s, 4s, etc. const delay = Math.pow(2, attempt) * 1000; await new Promise(resolve => setTimeout(resolve, delay)); } } } throw lastError; } ``` ### Strategy 2: Request Batching and Sequencing Group operations and spread them over time to avoid burst traffic: ```javascript theme={null} // Batch user creation across time intervals async function createUsersBatched(users, batchDelayMs = 100) { for (const user of users) { await api.createUser(user); await new Promise(resolve => setTimeout(resolve, batchDelayMs)); } } // Call it await createUsersBatched(['user1', 'user2', 'user3'], 50); ``` ### Strategy 3: Monitor Token Bucket State Use response headers to track your token consumption and adjust pacing: ```javascript theme={null} const response = await fetch(url, options); const limit = parseInt(response.headers.get('X-RateLimit-Limit'), 10); const remaining = parseInt(response.headers.get('X-RateLimit-Remaining'), 10); const resetTime = parseInt(response.headers.get('X-RateLimit-Reset'), 10); const now = Math.floor(Date.now() / 1000); console.log(`Tokens: ${remaining}/${limit}`); console.log(`Refill in: ${resetTime - now} seconds`); // If approaching empty bucket, slow down if (remaining < 100) { console.log('Approaching rate limit - reducing request pace'); // Implement adaptive throttling } ``` This approach prevents hitting the limit by detecting high consumption patterns early. ## Token Bucket Example Here's a visual representation of how tokens flow: ``` Time 0s: [Bucket: 1000 tokens] Request 1 → [Remaining: 999 tokens] Request 2 → [Remaining: 998 tokens] ... Request 500 → [Remaining: 500 tokens] Time 0.5s: [Bucket: 500 tokens] (still in current refill period) Request 501 → [Remaining: 499 tokens] Request 502 → [Remaining: 498 tokens] ... Request 1000 → RATE LIMITED (429) Time 1s: [Bucket: REFILLS to 1000 tokens] (Retry your request) Request 1000 → [Remaining: 999 tokens] ``` ## Calculating Request Rates With a 1,000 token limit per 1 second refill: * **Sustained rate**: \~1,000 requests/second * **Burst capacity**: Up to 1,000 consecutive requests before rate limiting * **Recovery time**: 1 second for full bucket refill Plan your integration accordingly: * For steady workloads: Distribute requests evenly across the 1-second window * For bursty workloads: Use retries and backoff when approaching the limit ## Request Higher Limits If your use case requires higher rate limits: * Email: [support@clix.so](mailto:support@clix.so) * Docs: [https://docs.clix.so](https://docs.clix.so) Include your expected request patterns (steady vs. bursty) and peak throughput needs. # API-Triggered Campaigns Source: https://docs.clix.so/campaigns/api-triggered Configure campaigns in the console and trigger them from your backend with dynamic data. ## Overview API-triggered campaigns let you configure message templates and targeting rules in the Clix console, then trigger delivery from your backend via API. This approach separates campaign logic from your application code, making it easier for non-technical team members to manage messaging while developers maintain simple API calls. See [Campaign Types](/campaigns/types) for a comparison with scheduled and event-triggered campaigns. ## When to Use API-triggered campaigns work well when you need: * **Transactional notifications**: Order confirmations, password resets, payment alerts * **Workflow notifications**: Task assignments, approval requests, status updates * **System alerts**: Moderation queues, support tickets, server events * **Programmatic sends**: Any scenario where your backend knows when to send but non-technical users should control the content and targeting ### Example Scenario Your retail app allows customers to place online orders for pickup at different store locations. When a new order is placed, you want to notify staff at that specific store. Without API-triggered campaigns, you'd need to: 1. Query your database for staff members at the store location 2. Build the notification payload with order details 3. Call a send API for each recipient With API-triggered campaigns: 1. Configure a campaign once in the console with targeting rules and message template 2. Call the trigger endpoint with just the store location and order details 3. Clix handles filtering, personalization, and delivery ## Setting Up a Campaign ### 1. Create the Campaign In the Clix console: 1. Go to **Campaigns** > **Create Campaign** 2. Choose your message channel and configure the content 3. In the **Schedule & Launch** step, select **API-Triggered** See [Campaigns Quickstart](/campaigns/quickstart) for detailed campaign creation steps. ### 2. Configure Dynamic Audience Filters API-triggered campaigns support dynamic audience filtering, where filter values come from your API request instead of being hardcoded. Use the `trigger.*` namespace in your audience conditions to reference API payload data: ``` Group 1 user_role equals "store_staff" AND store_location equals {{ trigger.store_location }} ``` When you call the API with `"store_location": "San Francisco"`, Clix will only send to users where: * `user_role` equals `"store_staff"` (static condition) * `store_location` equals `"San Francisco"` (dynamic condition from API payload) #### Supported Operators For dynamic filters, you can use: * **Equals** (`==`) * **Not equals** (`!=`) * **Exists** * **Not exists** * **In** * **Not in** #### Filter Limitations To ensure performance when filtering on-demand: * Maximum **3 attributes** per audience definition * Attributes can be combined with **AND** or **OR** operators * Groups are supported within these constraints Complex targeting logic should be handled in your backend before calling the trigger API. ### 3. Add Dynamic Content Use [Personalization](/personalization/personalization) syntax to insert dynamic values in your message content. The `trigger.*` namespace contains properties from your API request: **Message title:** ```liquid theme={null} New order at {{ trigger.store_name }} ``` **Message body:** ```liquid theme={null} Order #{{ trigger.order_id }} from {{ trigger.customer_name }} {{ trigger.item_count }} items - Ready by {{ trigger.pickup_time }} ``` **Deep link:** ``` myapp://orders/{{ trigger.order_id }} ``` See the [Personalization](/personalization/personalization) guide for filters, conditionals, and loops. ### 4. Save and Get Campaign ID After saving your campaign, you'll see: * **Campaign ID**: Use this to trigger the campaign via API * **Sample API request**: Example code snippets You can also find the campaign ID later: 1. Go to **Campaigns** 2. Click on your campaign 3. The campaign ID appears in the URL: `console.clix.so/campaigns/{campaign_id}` Or view it in the campaign details panel. ## Triggering from Your Backend Call the trigger endpoint when you want to send the campaign: ```bash theme={null} POST https://api.clix.so/api/v1/campaigns/{campaign_id}:trigger X-Clix-Project-ID: your_project_id X-Clix-API-Key: your_api_key Content-Type: application/json { "audience": { "broadcast": true }, "properties": { "store_name": "Downtown Store", "store_location": "San Francisco", "customer_name": "Sarah Johnson", "order_id": "ORD-12345", "item_count": "3", "pickup_time": "2:30 PM" } } ``` The `properties` object contains data for both: * **Audience filtering**: Values referenced in `{{ trigger.* }}` conditions * **Message personalization**: Values inserted in message templates See the [Trigger Campaign API Reference](/api-reference/endpoint/campaigns:trigger) for all options including targeting specific users. ## Full Example Let's build an order notification system for retail stores. ### Console Configuration **Campaign name:** New Order Alerts **Audience:** ``` Group 1 user_role equals "store_staff" AND store_location equals {{ trigger.store_location }} ``` **Message:** * **Title:** `New pickup order` * **Body:** `Order #{{ trigger.order_id }} from {{ trigger.customer_name }}. {{ trigger.item_count }} items ready by {{ trigger.pickup_time }}.` * **Deep link:** `myapp://orders/{{ trigger.order_id }}` **Campaign ID:** `019aa002-1d0e-7407-a0c5-5bfa8dd2be30` ### Backend Implementation When a customer places an order: ```javascript theme={null} async function notifyStoreStaff(order) { const response = await fetch( 'https://api.clix.so/api/v1/campaigns/019aa002-1d0e-7407-a0c5-5bfa8dd2be30:trigger', { method: 'POST', headers: { 'X-Clix-Project-ID': process.env.CLIX_PROJECT_ID, 'X-Clix-API-Key': process.env.CLIX_API_KEY, 'Content-Type': 'application/json' }, body: JSON.stringify({ audience: { broadcast: true }, properties: { store_location: order.pickupLocation, customer_name: order.customer.name, order_id: order.id, item_count: order.items.length, pickup_time: order.pickupTime } }) } ); return response.json(); } ``` ### Result For an order placed at the San Francisco store: * Clix filters audience to staff where `store_location == "San Francisco"` * Each staff member receives a notification with the order details * Title: "New pickup order" * Body: "Order #ORD-12345 from Sarah Johnson. 3 items ready by 2:30 PM." To notify staff at the New York store, call the same endpoint with `"store_location": "New York"`. No new campaign needed. ## Best Practices * **Keep filter logic simple**: Use 3 or fewer attributes. Move complex logic to your backend. * **Pre-format data**: Send `"$29.99"` instead of `2999` if you want to display formatted prices. * **Use meaningful property names**: `facility_name` is clearer than `fn` or `name1`. * **Test with sample data**: Use the campaign preview feature to verify personalization before going live. * **Handle missing data**: Use the `default` filter for optional properties: `{{ trigger.discount | default: "10%" }}` ## Limitations * **Audience attributes**: Maximum 3 attributes in filter conditions * **Filter operators**: Limited to equals, not equals, exists, not exists, in, not in * **Campaign edits**: Changing audience or message requires creating a new campaign or updating the existing one (campaign ID remains the same) * **Rate limits**: See [API Rate Limits](/api-reference/rate-limits) for request quotas For more flexible targeting without these constraints, consider [Event-Triggered Campaigns](/campaigns/types#event-triggered) if your use case fits an event-based model. # Audience Source: https://docs.clix.so/campaigns/audience Select who will receive this campaign based on user or device conditions and review your full setup before launch. ## Targeting Options You have two ways to target recipients: 1. **All users and devices**: Send to everyone in your project. 2. **Filter by specific conditions**: Create custom filters based on user and device attributes. ## Available Attributes You can filter using these attributes: * **User attributes**: User ID, Last session at * **Device attributes**: Platform, App version * **Custom attributes**: Any properties you collect from your app When you filter by user attributes only, the message goes to every device that belongs to matching users. If you include any device filters, only matching devices will receive the message. ## Building Your Audience Audiences are made up of groups and conditions: * **Groups** work like parentheses and contain one or more conditions. * **Conditions** inside a group can be joined by AND or OR. * **Groups** can be connected to each other with AND or OR. You can switch between AND and OR by clicking the connector text. ### Examples Here's a simple group with two conditions: ``` Group 1 User ID equals "user123" AND session_count greater than or equal 15 ``` You can also use multiple groups with different logic: ``` Group 1 country equals "KR" OR country equals "JP" AND Group 2 app_version greater than or equal "3.2.0" ``` The builder can handle complex logic, but simpler audiences are usually easier to work with. ## Operators by Data Type The operators you can use depend on the attribute type: | Type | Available Operators | | - | - | | **Number** | Equals, Not equals, Greater than, Greater than or equal, Less than, Less than or equal, Exists, Not exists, In, Not in | | **Text** | Equals, Not equals, Contains, Not contains, Starts with, Ends with, Matches (regex), Exists, Not exists, In, Not in | | **Boolean** | Equals, Not equals, Exists, Not exists | | **Datetime** | Equals, Not equals, Greater than (after), Less than (before) | | **Select** | Equals, Not equals | Note: The Matches operator for text fields supports regular expressions if you need advanced pattern matching. ## Estimate Recipients Before you launch, it's a good idea to estimate how many people will receive your message: 1. Set up your audience filters. 2. Click Calculate to see an estimated recipient count. 3. The estimate shows the total number based on your current data. Keep in mind: * The estimate uses current data, so actual delivery numbers might be different if your data changes before send time. * For recurring campaigns, you can recalculate to get updated estimates. * You can't save audience configurations as reusable segments. Each campaign needs its own audience setup. # Message Source: https://docs.clix.so/campaigns/message Compose the push notification content and send a test message. ## Message Fields Your notification can include the following fields: * **Title** (required): The main heading of your notification. Example: "You're a Power User!" * **Body** (recommended): The main message text. Example: "With over 15 sessions and 10 friends, you've earned exclusive perks." * **Image URL** (optional): A URL to an image that will appear in the notification. Example: "[https://example.com/image.png](https://example.com/image.png)" * **Open URL / Deep Link** (optional): Where users go when they tap the notification. Example: "yourapp\://rewards" or "[https://yourwebsite.com/page](https://yourwebsite.com/page)" ### Best Practices Keep these tips in mind when composing your message: * Always use HTTPS for images and links. * Keep titles short and clear. Mobile platforms may cut off longer text. * If you're using deep links, make sure your app can handle the scheme or universal link. ## Personalization You can personalize messages using template variables with double braces. Example: `Hello {{ user.name | default: "there" }}!` For API-triggered campaigns, you can also include values from custom data. Learn more in the [Personalization](../personalization/personalization) guide. ## Send Test Before launching your campaign, you can send a test message to one or more devices. Test messages ignore your audience and schedule settings - they only test the message content itself. Once the message looks good, you can move on to setting up your audience and launching the campaign. # Metrics Source: https://docs.clix.so/campaigns/metrics Track delivery and engagement for your campaigns. ## Understanding Your Metrics Here's what each metric means: * **Targeted**: Users selected by your audience filters at send time. * **Sent**: Delivery requests sent to push providers. * **Failed**: Requests that couldn't be delivered. You can see grouped reasons like invalid tokens. * **Delivered**: Messages that reached devices (reported by the device). * **Tapped**: Users who opened the notification. You can explore failure reasons in more detail from the console. ## Delivery Funnel Your campaign moves through these stages: ``` Targeted -> Sent -> Delivered -> Tapped ``` Metrics update in real time as events come in. ## Time Range and Breakdowns You can view metrics for different time periods: * The default time range goes from when you created the campaign to today, or to the configured end date. * Recurring campaigns show a daily breakdown so you can see how each day performed. * One-time campaigns show totals for the time range you choose. # Quickstart Source: https://docs.clix.so/campaigns/quickstart Create and launch your first messaging campaign with Clix. The console walks you through four steps: Basics, Schedule, Message, and Audience and Launch. ## Prerequisites Before you start, make sure your app has the Clix SDK installed and is sending push tokens. ## 1. Basic Information Give your campaign a name and description: * **Name**: Create a descriptive name for internal use. * **Description** (optional): Add details to help your team understand the purpose. ## 2. Schedule (Campaign Type) Choose how you want to send your campaign. ### Scheduled Send messages at specific times: * **Send immediately**: Request delivery right away. * **Send once**: Choose a future date and time. * **Send recurring**: Run on a pattern, such as weekdays at 10:00 AM. ### Event-triggered Send messages when a tracked event happens, such as when someone completes a purchase. ### API-triggered Set up the campaign in the console first, then trigger it from your backend when needed. You'll receive a campaign ID that you can use to send messages via API. ## 3. Message Fill in the content that will appear on the device: * **Notification title** (required) * **Notification body** (recommended) * **Image URL** (optional) * **Open URL or deep link** (optional) ### Send Test Select one or more devices and send a test message. Tests ignore the audience and schedule settings - they only test the message content. ## 4. Audience and Launch Build your audience and launch: 1. Build the audience using groups and conditions. You can combine conditions with AND or OR, and include user attributes or device attributes. 2. Click Calculate to estimate how many users will receive the message. 3. Review the summary and launch when ready. ## After Launch Once your campaign is live, you can monitor these metrics: * **Targeted**: Number of users selected by your audience filters * **Sent**: Delivery requests sent to push providers * **Failed**: Requests that couldn't be delivered (with reasons) * **Delivered**: Messages that reached devices * **Tapped**: Users who opened the notification Recurring campaigns include a daily breakdown so you can track performance over time. # Campaign Types Source: https://docs.clix.so/campaigns/types Understand when to use scheduled, event-triggered, and API-triggered campaigns. Choose a campaign type based on when you want the notification to be delivered. ## Scheduled Use scheduled campaigns when you know exactly when you want to send messages. Options include: * **Send immediately**: Deliver messages right away. * **Send once**: Pick a future date and time. * **Send daily**: Repeat every day at a specific time. * **Send on specific days**: Repeat on a schedule, such as Monday to Friday at 10:00 AM. The timezone defaults to your browser setting, but you can change it for each campaign. Scheduled campaigns work well for promotional messages, daily digests, and announcements. ## Event-triggered Use event-triggered campaigns when you want messages sent in response to user actions. You can configure: * An event name like "review\_posted" or "purchase\_completed" * Optional filters on event properties, such as product name equals "Jeans" * A delay after the event occurs, such as 1 hour or 1 day * A cancel event to prevent sending, like "order\_cancelled" Your audience filters still apply, so you can restrict messages to specific user groups. Keep in mind that triggers only work with new incoming events. Historic events are not replayed, and event names and properties must match your tracking exactly. Event-triggered campaigns are great for post-purchase confirmations, review acknowledgements, and onboarding milestones. ## API-triggered API-triggered campaigns let you configure the message in the console and trigger delivery from your backend. Here's how it works: 1. Create the campaign and select API-triggered as the schedule type. Configure your message and audience. 2. Save the campaign to receive a campaign ID and a sample request. 3. Call the trigger endpoint when you want to send the message. You can include custom data if you need dynamic content. API-triggered campaigns are useful for system alerts, workflow notifications, and programmatic sends. See the [API-Triggered Campaigns guide](/campaigns/api-triggered) for detailed setup instructions, dynamic filtering, and examples. ## Comparison | Type | When it sends | Good for | | - | - | - | | Scheduled | At a time you choose (one-time or recurring) | Digests, promotions, announcements | | Event-triggered | When users take specific actions | Confirmations, onboarding, reviews | | API-triggered | On demand via API call | System alerts, workflows, custom triggers | # Clix CLI Source: https://docs.clix.so/clix-cli An AI-powered CLI to integrate, diagnose, and manage the Clix Mobile SDK through your favorite AI coding agent. Clix CLI helps you integrate, diagnose, and manage the Clix Mobile SDK through your favorite AI coding agent. It prepares your project configuration, then hands off to an AI agent for seamless SDK setup across iOS, Android, React Native, and Flutter projects. ## Installation ```bash npm theme={null} npm install -g @clix-so/clix-cli ``` ```bash bun theme={null} bun add -g @clix-so/clix-cli ``` ```bash shell theme={null} curl -fsSL https://clix.sh/install | bash ``` ```bash homebrew theme={null} brew tap clix-so/clix-cli && brew install clix ``` ## Requirements * Node.js 20 or higher * One supported AI agent (see table below) ## Supported AI Agents | Agent | Access | Notes | | - | - | - | | Gemini CLI | Free (1,000 requests/day) | Recommended for free users | | GitHub Copilot | Free (50 monthly premium requests) | Recommended for free users | | OpenCode | Varies | - | | Cursor | Subscription | - | | Claude Code | Subscription | - | | Codex | Subscription | - | Gemini CLI and GitHub Copilot offer generous free tiers, making them ideal starting points if you don't have an existing subscription. ## Quick Start ```bash theme={null} # 1. Install the CLI curl -fsSL https://clix.sh/install | bash # 2. Authenticate clix login # 3. Install the SDK clix install ``` ## Commands ### Core #### `clix install` Auto-configure push notifications in your project. Runs a two-step process: first prepares your project configuration (Firebase, APNs, entitlements), then hands off to your selected AI agent for SDK installation. ```bash theme={null} clix install ``` #### `clix doctor` Diagnose your project's Clix SDK integration status. Checks configuration completeness and hands off to your AI agent for detailed analysis and fixes. ```bash theme={null} clix doctor ``` #### `clix mcp` Install the Clix MCP Server, enabling AI agents to access real-time Clix documentation and SDK code examples. ```bash theme={null} clix mcp ``` #### `clix skills` Install Clix Skills for your AI agent, providing pre-built workflows for SDK integration, event tracking, user management, and more. ```bash theme={null} clix skills ``` ### Utility #### `clix login` Authenticate with your Clix account via device flow. ```bash theme={null} clix login ``` #### `clix logout` Remove stored credentials. ```bash theme={null} clix logout ``` #### `clix whoami` Show the current logged-in user. ```bash theme={null} clix whoami ``` #### `clix agent [name]` List available agents or switch to a specific agent. ```bash theme={null} # List all available agents clix agent # Switch to a specific agent clix agent gemini ``` #### `clix update` Check for and apply CLI updates. ```bash theme={null} clix update # Preview without applying clix update --dry-run ``` #### `clix uninstall` Remove the CLI from your system. ```bash theme={null} clix uninstall # Keep configuration files clix uninstall --keep-config ``` #### `clix help` Show available commands. ```bash theme={null} clix help ``` ## Key Features * **Command-Mode Architecture**: Dedicated commands for each workflow — no interactive chat session required * **Two-Step Install Process**: Automated project preparation followed by AI agent handoff for SDK integration * **Multiple Agent Support**: Choose from 6 AI agents and switch between them at any time * **Platform Detection**: Automatically identifies your project type and provides tailored configuration * **Auto-Update**: Built-in update mechanism that detects your install method and applies updates accordingly ## Related Resources Pre-built skills for SDK integration, event tracking, user management, and more. Enable AI agents to access real-time Clix documentation and SDK examples. > **Feedback & Issues** > > For any issues or feature requests, please open an issue on [GitHub](https://github.com/clix-so/clix-cli). # Deliverability Source: https://docs.clix.so/essentials/deliverability Ensuring that push notifications reliably reach your users' devices is crucial for effective engagement. ## How Mobile Push Notifications Work Mobile push notifications involve a sequence of interactions between your server, the push notification service (e.g., Firebase Cloud Messaging, FCM), and the user's device: * Your application requests permission from the user to send push notifications. * Upon granting permission, the user's device generates a unique push token. * Clix SDK sends push token to Clix server and Clix server stores this token and uses it to send push notifications through the FCM service. ## Understanding FCM Push Tokens * The FCM push token uniquely identifies a specific app installation on a user's device. * Tokens can change over time due to reinstallation, app updates, or device resets, so it's important to regularly update these tokens on your server. ## Pre-Notification Checks Before sending notifications, ensure: * The user's device has a valid and updated push token. * Your server properly integrates with FCM and authenticates requests correctly. * You have obtained the required permissions from users. ## Possible Responses from Push Notification System The push notification system can return several responses, including: * **Success**: Notification was successfully sent. * **Invalid Token**: The provided token is no longer valid and should be removed. * **Not Registered**: The device is no longer registered for push notifications; token should be deleted. * **Quota Exceeded**: Your request rate exceeded the allowed limit; retry later. * **Internal Server Error**: Temporary server issue; retry the notification. Handling these responses appropriately ensures maximum notification deliverability and effective user communication. # Notification Components Source: https://docs.clix.so/essentials/notification-components Push notifications typically consist of several key components that dictate how your message will appear and sound on user devices. Below, we outline the components for both iOS and Android platforms with their specific restrictions and defaults. ## Common Components | Component | Description | Details | | - | - | - | | Title | Brief headline displayed at the top of the notification. | - Recommended length: 30-50 characters.
- Exceeding length may result in truncation depending on the device screen size. | | Description | Main content or body of the notification. | - Recommended length: 100-200 characters.
- Longer descriptions may be truncated. | | Image | Optional image displayed within the notification. | - Format: JPG, PNG, GIF (Static GIF).
- Recommended size: less than 1MB.
- Resolution: Ideally less than 2,048 x 2,048 pixels. | | Priority | Defines how urgently the notification is delivered to the device. | - High Priority: Immediate delivery, wakes up devices.
- Normal Priority: Batched delivery for optimized battery usage. | ## iOS Specific Components The configuration steps below apply specifically to iOS push notifications. These settings are optional and should be configured only if your app targets iOS users or requires iOS-specific push functionality. | Component | Description | Details | | - | - | - | | Subtitle (Optional) | Secondary line of text beneath the title. | - Recommended length: approximately 30-50 characters. | | Category | Customizable actions defined in the notification settings. | - Links notifications with predefined action buttons. | | Thread Identifier | Used to group notifications visually in the Notification Center. | - String value that identifies notification threads. | ## Android Specific Components The configuration steps below apply specifically to Android push notifications. These settings are optional and should be applied if your app targets Android devices or requires Android-specific push functionality. | Component | Description | Details | | - | - | - | | Channel | Defines the notification importance level and behavior. | - Android-specific categorization required for Android 8.0+. | | Icon | Small icon displayed in the notification status bar. | - Format: PNG, with transparency.
- Size: Typically 24x24 dp. | | Color | Accent color for the notification icon background. | - Defined using HEX color code. | | Visibility | Controls how notifications appear on the lock screen. | - Options: Public, Private, or Secret. | By clearly understanding and utilizing these components effectively, you ensure optimal delivery, visibility, and user engagement across all notifications sent via Clix. # User Source: https://docs.clix.so/essentials/user In Clix, a user is the core entity representing an individual interacting with your mobile application. Clix uniquely identifies and manages users based on how they interact with your service. ## User Types ### Identified User * An **Identified User** is explicitly identified by a unique `project_user_id` set by your application's own user identification system. * You can set the `project_user_id` to match the user's ID from your existing system. * This enables Clix to track, manage, and engage with users consistently across their journey within your application. ### Anonymous User * An **Anonymous User** does not have a `project_user_id`. This can happen when: * The user has not signed in yet. * Your service does not implement a user identification system. * Clix assigns each Anonymous User a unique `anonymous_id`, allowing the system to distinguish each user even without explicit identification. * Every user, whether identified or anonymous, will always have a unique `anonymous_id`. ## User Identification and Merging When an Anonymous User becomes an Identified User (for example, upon signing in), Clix attempts to merge the historical activity of the Anonymous User with the newly Identified User. This merging occurs when: * There are identifiable attributes that match between the anonymous profile and the newly identified profile. * After merging, all historical activities associated with the `anonymous_id` become associated with the corresponding `project_user_id`. ## Multiple Devices Management Users often engage with applications on multiple devices. Clix handles this seamlessly by: * Automatically synchronizing multiple devices to the same user profile. * Ensuring that all sessions across devices are unified under the same user entity whenever the user starts a session. This ensures consistent messaging and optimal push notification delivery across all user devices. # Event Tracking Source: https://docs.clix.so/event-tracking/event-tracking Event tracking in the Clix SDK allows you to capture user actions and enrich them with meaningful properties, enabling events to drive campaign triggers, audience filters, and ongoing behavior insights. For API usage, see the Clix SDK GitHub repositories for each platform: * [iOS](https://github.com/clix-so/clix-ios-sdk#event-tracking) * [Android](https://github.com/clix-so/clix-android-sdk#event-tracking) ## When to Track Events Decide which user interaction or system event to track—for example, button taps, feature milestones, or funnel checkpoints. Attach key-value properties that provide relevant details about the event (e.g., plan type, screen name, experiment variant). *** ## Example Usage ```swift theme={null} Clix.trackEvent( "signup_completed", properties: [ "method": "email", "discount_applied": true, "trial_days": 14, "completed_at": Date() ] ) ``` *** ## Property Types and Formatting `properties` accepts a key/value map. The SDK normalizes values before sending them: * Booleans, numbers, and strings map directly to JSON primitives. * Date-like values are serialized to ISO 8601 strings (`2024-05-16T09:30:00Z`). * Unsupported objects default to a string representation. Prefer serializable primitives to keep reporting clean. *** ## Error Handling Event tracking calls can throw errors. Always handle errors for robust apps: ```swift theme={null} do { try await Clix.trackEvent( "signup_completed", properties: [ "method": "email", "discount_applied": true, "trial_days": 14, "completed_at": Date() ] ) } catch { print("Failed to track event: \(error)") } ``` # Setup Firebase Source: https://docs.clix.so/firebase-setting Firebase acts as the backend for sending push notifications. Setting up Firebase properly ensures your notifications reach your users reliably. ## Create Firebase Project Follow the instructions to create a new Firebase project. If Firebase is already set up, skip to **Setup Firebase Project > Step 6: Download FCM Service Account Key (JSON).** ### Things to Prepare (iOS Only) You'll need your APNs Key (a `.p8` file provided by Apple) to enable push notifications for iOS devices. Save it securely on your local machine. 1. Log in to [Apple Developer Center](https://developer.apple.com/account/). 2. Go to **Certificates, Identifiers & Profiles**. firebase-setting_1.png 3. Select **Keys** from the sidebar, then click the **+ (plus)** button to create a new key. 4. Enter a key name (e.g., "Push Notifications") and check the **Apple Push Notifications service (APNs)** option. firebase-setting_2.png 5. Click **Continue**, then review and confirm your choices. 6. Click **Register** and download your `.p8` file immediately. Store this file securely, as you will need it in Firebase setup. ### Setup Firebase Project Sign up or log into your [Firebase Console](https://console.firebase.google.com/) Click **Add project** and follow the on-screen instructions. Your project organizes your app's notification capabilities. firebase-setting_3.png 1. Navigate to your Project Overview and select **Add app**. 2. Register your app using your iOS Bundle ID or Android Package Name. firebase-setting_4.png 1. Uploading this file authorizes Firebase to send notifications via Apple servers. 2. Go to **Project settings > Cloud Messaging** and upload your `.p8` file. firebase-setting_5.png 1. In the Project Setting, navigate to **Service Accounts**. 2. Locate the Firebase Admin SDK service account. 3. Click **Generate new private key**, then click **Create**. 4. This will download a `.json` private key file. Keep it secure, and upload it to the Clix console in the next step. Upload the downloaded Firebase service account JSON file to the **Clix console > Settings > General > Push Notification Sender Config**. 1. In the Project Setting > General, select the registered app on the 'Your apps' list. 2. Download this file from Firebase Console. 3. Add it to your project's root directory in Xcode. 1. In the Project Setting > General, select the registered app on the 'Your apps' list. 2. Download this file from Firebase Console. 3. Add it to your project's root directory in Android project. # Clix Documentation Source: https://docs.clix.so/index Learn how to get started with Clix using quick guides, API references, and setup examples. **Clix will shut down on November 30, 2026.** Complete your migration before this date to continue sending notifications. Preserve your campaign settings and reports before the service shuts down. If you would like to migrate to **Notifly**, email [support@clix.so](mailto:support@clix.so) for migration assistance. ## Migration Guides Choose a destination and follow its guide to migrate from Clix before **November 30, 2026**. Start with the [Migration Overview](/migrations/overview) to compare options by campaign needs, budget, and engineering effort. Move users, events, and push campaigns to Notifly. Email [support@clix.so](mailto:support@clix.so) for migration assistance. Replace the Clix SDK and rebuild campaigns, audiences, and events in Braze. Reconnect identified users and rebuild mobile push campaigns in Customer.io. Use FCM directly and move campaign logic to your backend. Replace the Clix SDK and move your mobile push campaigns to OneSignal. ## Setting up The first step to sending push notifications is setting up your app and environment. Setup Firebase before you start using Clix. AI-powered assistant for SDK integration and debugging. ## Clix Essentials Learn the key features and concepts of Clix. User Types, Identification, and Device management. Mobile push tokens, permissions, and notification responses. Components of a push notification on iOS and Android. # Clix + Supabase Integration Guide Source: https://docs.clix.so/integrations/supabase-integration How to send Clix push notifications from Supabase using Edge Functions, SQL triggers, and helper builders. # Clix + Supabase Integration This guide shows how to integrate [Clix](https://clix.so) push notifications into a Supabase project using **Edge Functions** and Postgres triggers. You will: * Add a reusable `ClixClient` inside `supabase/functions/_shared` * (Recommended) Create helper builders for `ClixNotification` payloads * Deploy Edge Functions that send notifications * Optionally wire automatic dispatch via database triggers with `pg_net` Supabase Edge Functions run in Deno on the Supabase infrastructure and can securely access secrets you store with `supabase secrets`. See the official docs: **Edge Functions** – [https://supabase.com/docs/guides/functions](https://supabase.com/docs/guides/functions) ## 1. Prerequisites * A Supabase project (with CLI installed) – [https://supabase.com/docs/guides/cli](https://supabase.com/docs/guides/cli) * A Clix project (obtain Project ID + Secret API Key) * Supabase CLI authenticated: `supabase login` * (If using triggers) Postgres extension `pg_net` enabled (we'll cover this below) ## 2. Configure Secrets / Environment Variables Store credentials as Supabase Function secrets (never hard‑code keys): ```bash Set Supabase Edge Function secrets theme={null} supabase secrets set \ CLIX_PROJECT_ID=your_clix_project_id \ CLIX_API_KEY=your_clix_secret_api_key \ CLIX_API_BASE=https://api.clix.so # Existing required Supabase vars (examples) – ensure already set supabase secrets set \ SUPABASE_URL=https://your-project-ref.supabase.co \ SUPABASE_SERVICE_ROLE_KEY=your_service_role_key ``` Docs: * Secrets: [https://supabase.com/docs/guides/functions/secrets](https://supabase.com/docs/guides/functions/secrets) * Environment access in Deno: [https://supabase.com/docs/guides/functions#environment-variables](https://supabase.com/docs/guides/functions#environment-variables) ## 3. Add the Shared Clix Client Create the file below at `supabase/functions/_shared/clix_client.ts`. ```ts supabase/functions/_shared/clix_client.ts theme={null} // Lightweight reusable Clix notification client for Deno Edge Functions // Uses project_user_id targeting instead of device_id export interface ClixNotification { target: { project_user_id: string }; title: string; body: string; image_url?: string; landing_url?: string; } export interface ClixResult { delivery_results?: unknown; [k: string]: unknown; } export class ClixClient { private projectId: string; private apiKey: string; private base: string; constructor(opts?: { projectId?: string; apiKey?: string; baseUrl?: string; }) { this.projectId = opts?.projectId || Deno.env.get("CLIX_PROJECT_ID") || ""; this.apiKey = opts?.apiKey || Deno.env.get("CLIX_API_KEY") || ""; this.base = ( opts?.baseUrl || Deno.env.get("CLIX_API_BASE") || "https://api.clix.so" ).replace(/\/$/, ""); if (!this.projectId || !this.apiKey) { throw new Error("ClixClient missing credentials"); } } async send( notifications: ClixNotification[] ): Promise<{ ok: boolean; result: ClixResult; status: number }> { const res = await fetch(`${this.base}/api/v1/messages:send`, { method: "POST", headers: { "Content-Type": "application/json", "X-Clix-Project-ID": this.projectId, "X-Clix-API-Key": this.apiKey, }, body: JSON.stringify({ push_notifications: notifications }), }); const json: ClixResult = await res.json().catch(() => ({})); return { ok: res.ok, status: res.status, result: json }; } } ``` ## 4. (Recommended) Add Scenario Helper Builders Instead of hand‑crafting notification objects each time, centralize builders for consistent structure and future enrichment. ```ts supabase/functions/_shared/notification_scenarios.ts theme={null} import { ClixNotification } from "./clix_client.ts"; // Multiple recipients for a completed todo export function buildTodoCompletedNotifications( projectUserIds: string[], todo: { id: number; title: string } ): ClixNotification[] { return projectUserIds.map((pid) => ({ target: { project_user_id: pid }, title: "Todo Completed", body: todo.title || `Todo #${todo.id} was completed`, landing_url: `https://example.com/todos/${todo.id}`, })); } ``` These helpers can evolve to insert A/B test metadata, analytics tags, localization, etc. Centralizing keeps Edge Function logic lean. ## 5. Edge Function: Notify Todo Completion Minimal example: accept a `todo_id` and a target `project_user_id`, build a notification, and send it via `ClixClient` (no database lookup logic included here). ```ts supabase/functions/notify-todo/index.ts theme={null} import { serve } from "https://deno.land/std@0.177.0/http/server.ts"; import { ClixClient, buildTodoCompletedNotification, } from "../_shared/clix_client.ts"; // Minimal: requires env secrets (CLIX_PROJECT_ID, CLIX_API_KEY) serve(async (req: Request) => { if (req.method !== "POST") return json({ error: "Only POST" }, 405); const { todo_id, project_user_id, title } = await req .json() .catch(() => ({})); if (!todo_id) return json({ error: "todo_id required" }, 400); if (!project_user_id) return json({ error: "project_user_id required" }, 400); // Build a minimal todo shape for the helper (no DB fetch) const todo = { id: todo_id, title: title || "" }; const clix = new ClixClient(); const notification = buildTodoCompletedNotification(project_user_id, todo); const { ok, result, status } = await clix.send([notification]); if (!ok) return json({ error: "clix send failed", details: result }, status); return json({ ok: true, sent: 1, clix: result }); }); function json(data: unknown, status = 200) { return new Response(JSON.stringify(data), { status, headers: { "Content-Type": "application/json" }, }); } ``` ### Deploy the Function ```bash theme={null} supabase functions deploy notify-todo --no-verify-jwt ``` (You can require JWT if only your backend calls this. See auth function docs: [https://supabase.com/docs/guides/functions/auth](https://supabase.com/docs/guides/functions/auth)) ## 6. Calling the Edge Function (Invocation Options) You can integrate `notify-todo` in three primary ways—choose based on coupling, complexity, and operational preferences. (Code snippets intentionally omitted.) 1. Database Trigger (pg\_net): Attach a lightweight trigger to the `todos` table so when a row transitions to `completed`, Postgres performs an HTTP POST to the deployed Edge Function. Pros: automatic, low latency, no extra app call. Cons: trigger logic inside SQL, needs `pg_net` and careful key handling. 2. Direct API Call: From your backend (or another Edge Function) perform an authenticated POST with the `todo_id`. Pros: simplest to reason about in application code, easier to add conditional logic or retries. Cons: requires your app layer to explicitly invoke for every event. 3. Scheduled / Batch Orchestrator: Periodic job (cron, scheduled function, worker) queries for recently completed todos and sends notifications in batches (reduces per-event overhead). Pros: efficient for high volume; can deduplicate. Cons: not real-time; added scheduling complexity. Selection guidance: * Want instant, automatic dispatch on state change? Use a trigger. * Need business rules (feature flags, throttling, analytics gating)? Use direct API call. * Need aggregation (daily digests, rate limiting)? Use scheduled batch. ## 7. Testing the Flow 1. Insert / update a `todo` to status `completed` 2. Confirm `notification_dispatch_log` entries 3. Verify successful HTTP responses & Clix dashboard reception 4. For manual test call the function: ```bash theme={null} curl -X POST \ https://.functions.supabase.co/notify-todo \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $SUPABASE_SERVICE_ROLE_KEY" \ -d '{"todo_id": 123}' ``` ## 8. Security & Best Practices * Put your Clix Secret API Key only in Supabase secrets (never ship to clients) * Prefer trigger-based automation for reliability; fall back to client calls when immediacy or dynamic logic is required * Use structured builders to evolve payloads without touching every function * Log responses (already in examples) for observability; consider adding retention policies ## 9. Useful Supabase Docs * Edge Functions: [https://supabase.com/docs/guides/functions](https://supabase.com/docs/guides/functions) * Secrets: [https://supabase.com/docs/guides/functions/secrets](https://supabase.com/docs/guides/functions/secrets) * Supabase JS client: [https://supabase.com/docs/reference/javascript/start](https://supabase.com/docs/reference/javascript/start) * Database Functions & Triggers: [https://supabase.com/docs/guides/database/functions](https://supabase.com/docs/guides/database/functions) * RLS: [https://supabase.com/docs/guides/auth/row-level-security](https://supabase.com/docs/guides/auth/row-level-security) * `pg_net` Extension: [https://supabase.com/docs/guides/database/extensions/pg\_net](https://supabase.com/docs/guides/database/extensions/pg_net) ## 10. Summary You now have: * A reusable `ClixClient` consuming environment secrets * Scenario helpers for consistent notifications * Edge Functions (`notify-todo`) to send messages * Optional Postgres triggers to automatically invoke those functions Iterate by adding more scenario builders (e.g. silent data sync, milestone achievements) and enrich payloads with custom analytics fields. # Webhook Source: https://docs.clix.so/integrations/webhook Receive real-time push notification events and message payloads in your external systems. ## Overview Webhooks allow you to receive real-time notifications when push notification events occur in Clix. Instead of repeatedly polling for updates, Clix will automatically send HTTP POST requests to your specified endpoint whenever a push notification is sent or fails. This integration enables you to: * Track delivery status of push notifications in real-time * Sync notification data with your internal systems * Build custom analytics and monitoring dashboards * Trigger automated workflows based on notification events High volumes of push notifications can generate significant traffic to your webhook endpoint. We strongly recommend conducting TPS (Transactions Per Second) and stress tests on your server infrastructure to ensure it can handle the expected load before enabling webhooks in production. ## Prerequisites Before setting up webhooks, ensure you have: * An accessible HTTPS endpoint that can receive POST requests * Proper authentication/authorization configured on your endpoint (if needed) * A Clix project with appropriate permissions Webhook endpoints must be publicly accessible. If your endpoint is behind a firewall, you'll need to whitelist Clix's IP addresses. ## Setting Up a Webhook ### Step 1: Navigate to Webhook Settings Go to your project settings and select the **Webhook** tab. Webhook Settings Page The webhook management page shows all configured webhooks for your project, including their URLs and event status indicators (Sent/Failed). ### Step 2: Create a New Webhook Click the **"Create a webhook"** button to open the webhook configuration dialog. Create Webhook Dialog Fill in the following fields: Enter a descriptive name to identify this webhook (e.g., "Production Analytics Webhook"). Select which push notification events should trigger this webhook: * **Sent**: Triggered when a push notification is successfully delivered to the device * **Failed**: Triggered when a push notification fails to be delivered You can select one or both events based on your needs. Configure the HTTP request details: * **HTTP Method**: Currently supports POST * **Webhook URL**: Enter your endpoint URL (must be a valid HTTPS URL) * **Timeout (ms)**: Set the maximum time (in milliseconds) to wait for a response from your endpoint. Default is 5000ms (5 seconds). Add custom HTTP headers if your endpoint requires authentication or specific content types: * Click **"+ Add Header"** to add a new header * Common headers include: * `Content-Type`: `application/json` (automatically included) * `Authorization`: For API key or bearer token authentication * Custom headers for your application logic ### Step 3: Save and Activate Click **"Create Webhook"** to save your configuration. The webhook will immediately start receiving events based on your selected triggers. ## Webhook Events ### Event Types #### Sent Event Triggered when a push notification is successfully sent to a device. **Payload Example:** ```json theme={null} { "project_id": "YOUR_PROJECT_ID", "event_type": "PUSH_SENT", "timestamp": "2025-12-16T07:42:54.168140781Z", "message_id": "abcdefgh-b3f9-7950-9b24-abcdefgh", "device_id": "abcdefgh-9171-4292-8382-abcdefgh", "platform": "ANDROID", "notification": { "title": "👋 Hello from Clix!", "body": "This is a test message to check your push setup 🚀", "image_url": "", "landing_url": "" } } ``` #### Failed Event Triggered when a push notification fails to be delivered. **Payload Example:** ```json theme={null} { "project_id": "YOUR_PROJECT_ID", "event_type": "PUSH_FAILED", "timestamp": "2025-12-16T07:44:49.325936806Z", "message_id": "abcdefgh-759f-7291-8968-abcdefgh", "device_id": "abcdefgh-62bc-4ddf-9adc-abcdefgh", "platform": "ANDROID", "notification": { "title": "👋 Hello from Clix!", "body": "This is a test message to check your push setup 🚀", "image_url": "", "landing_url": "" } } ``` ### Response Requirements Your endpoint should: * Respond with a `2xx` status code (200-299) to acknowledge receipt * Respond within the configured timeout period * Return a response as quickly as possible (ideally under 1 second) ## Test Webhooks The webhook management page displays Sent and Failed status counts for each webhook. Click on a webhook to view detailed delivery logs, which can help troubleshoot common failures such as connection timeouts, invalid SSL certificates, non-2xx responses, or connection refusals. Testing Webhook ## Best Practices To ensure reliable webhook delivery, use HTTPS endpoints with authentication headers, respond quickly (under 1 second ideally) and process data asynchronously, implement idempotency using `message_id` to handle duplicates, set appropriate timeouts, log all requests for debugging, and test your configuration thoroughly using tools like webhook.site before going live. ## Troubleshooting If webhooks are not being received, verify your endpoint URL is publicly accessible, check firewall settings, and ensure SSL certificates are valid. For high failure rates, confirm your endpoint responds within the timeout period with 2xx status codes. ## Need Help? If you encounter issues setting up webhooks or have questions about webhook events, please contact our support team or visit our documentation portal. # iOS Live Activity Source: https://docs.clix.so/live-activity Display real-time updates on the Lock Screen and Dynamic Island using Live Activities. ## Overview Live Activities display your app's most current data on the iPhone Lock Screen and Dynamic Island, allowing users to monitor real-time updates at a glance. With Clix, you can remotely start and update Live Activities through push notifications. Live Activities are available on iOS 16.1 and later. Dynamic Island is available on iPhone 14 Pro and later models. ## Prerequisites Before setting up Live Activities, ensure the following requirements are met:
  • [Complete Clix iOS SDK setup](/sdk-quickstart-ios)
  • Clix iOS SDK version 1.7.0 or later
  • Xcode 14.0 or later
  • [Complete Clix React Native SDK setup](/sdk-quickstart-react-native)
  • Clix React Native SDK version 1.3.0 or later
  • Xcode 14.0 or later
## Setup Guide Create a Widget Extension to host your Live Activity UI. 1. In Xcode, go to **File > New > Target**. 2. Search for **Widget Extension** and select it. 3. Click **Next**. live-activity-1-new-target.png 4. Enter a name for your widget (e.g., `DeliveryWidget`). 5. **Check "Include Live Activity"** to generate the Live Activity template. 6. Click **Finish**. live-activity-2-widget-options.png When the "Activate scheme?" dialog appears, select **Don't Activate** to continue using your main app scheme. Enable Live Activities support in your main app's Info.plist. 1. Open your main app target's **Info.plist**. 2. Add a new key: `NSSupportsLiveActivities` 3. Set the value to **YES** (Boolean). live-activity-3-info-plist.png Alternatively, add this to your Info.plist source: ```xml theme={null} NSSupportsLiveActivities ``` Define the data structure for your Live Activity. `ActivityAttributes` contains static data that doesn't change, while `ContentState` holds dynamic data that updates in real-time. ```swift DeliveryAttributes.swift theme={null} import ActivityKit import Foundation struct DeliveryAttributes: ActivityAttributes { // Static data - set when Live Activity starts public struct ContentState: Codable, Hashable { // Dynamic data - updates in real-time var currentStatus: String var estimatedArrival: Date var distanceRemaining: Double } // Static attributes var orderNumber: String var driverName: String var restaurantName: String } ``` The `ActivityAttributes` struct name (e.g., `DeliveryAttributes`) must match the `attributes_type` value you send via the API. Implement the UI for your Live Activity. This includes the Lock Screen view and Dynamic Island presentations. ```swift DeliveryLiveActivity.swift theme={null} import ActivityKit import SwiftUI import WidgetKit struct DeliveryLiveActivity: Widget { var body: some WidgetConfiguration { ActivityConfiguration(for: DeliveryAttributes.self) { context in // Lock Screen / Banner UI LockScreenView(context: context) } dynamicIsland: { context in DynamicIsland { // Expanded view (long press) DynamicIslandExpandedRegion(.leading) { Label(context.attributes.driverName, systemImage: "person.circle") } DynamicIslandExpandedRegion(.trailing) { Text(context.state.estimatedArrival, style: .timer) } DynamicIslandExpandedRegion(.bottom) { Text(context.state.currentStatus) .font(.headline) } } compactLeading: { // Compact leading (pill left side) Image(systemName: "box.truck.fill") } compactTrailing: { // Compact trailing (pill right side) Text(context.state.estimatedArrival, style: .timer) } minimal: { // Minimal (when multiple activities) Image(systemName: "box.truck.fill") } } } } struct LockScreenView: View { let context: ActivityViewContext var body: some View { VStack(alignment: .leading, spacing: 12) { HStack { Image(systemName: "box.truck.fill") .foregroundColor(.blue) Text(context.attributes.restaurantName) .font(.headline) Spacer() Text("Order #\(context.attributes.orderNumber)") .font(.caption) .foregroundColor(.secondary) } Text(context.state.currentStatus) .font(.subheadline) HStack { Text("Driver: \(context.attributes.driverName)") Spacer() Text("ETA: ") Text(context.state.estimatedArrival, style: .time) } .font(.caption) } .padding() } } ``` live-activity-4-lock-screen.png live-activity-5-dynamic-island.png Make your `DeliveryAttributes.swift` file accessible to both the main app and widget extension. 1. Select `DeliveryAttributes.swift` in the Project Navigator. 2. In the right sidebar, locate the **Target Membership** section under the File Inspector. 3. Enable the checkbox for your **main app target**. 4. Verify that both your main app and widget extension targets are now checked. live-activity-6-target-membership.png The main app needs access to `DeliveryAttributes` for the `Clix.LiveActivity.setup()` call. The widget UI file only needs to be in the widget extension target. Register your `ActivityAttributes` type with Clix to enable remote Live Activity starts. Add the setup call in your `AppDelegate.swift` after initializing Clix: ```swift AppDelegate.swift {2, 20-22} theme={null} import UIKit import Clix import FirebaseCore class AppDelegate: ClixAppDelegate { override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { FirebaseApp.configure() Task { await Clix.initialize( config: ClixConfig( projectId: YOUR_PROJECT_ID, apiKey: YOUR_PUBLIC_API_KEY ) ) // Register Live Activity attributes type (iOS 16.1+) if #available(iOS 16.1, *) { Clix.LiveActivity.setup(DeliveryAttributes.self) } } return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } ``` If your React Native app uses `AppDelegate.swift`, add the setup call directly: ```swift AppDelegate.swift {3, 14-16} theme={null} import UIKit import Firebase import clix_react_native_sdk @main class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { FirebaseApp.configure() // Register Live Activity attributes type (iOS 16.1+) if #available(iOS 16.1, *) { ClixLiveActivity.setup(DeliveryAttributes.self) } return true } // ... rest of AppDelegate } ``` If your React Native app uses `AppDelegate.mm`, you need to create a Swift helper file first. **Step 1:** Create `LiveActivitySetup.swift` in your project: ```swift LiveActivitySetup.swift {2, 6-8} theme={null} import Foundation import clix_react_native_sdk @objc public class LiveActivitySetup: NSObject { @objc public static func setup() { if #available(iOS 16.1, *) { ClixLiveActivity.setup(DeliveryAttributes.self) } } } ``` **Step 2:** Make sure this file has target membership for your main app. **Step 3:** Call the helper from your `AppDelegate.mm`: ```objectivec AppDelegate.mm {6, 18} theme={null} #import "AppDelegate.h" #import #import // Import Swift bridging header #import "YourApp-Swift.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [FIRApp configure]; self.moduleName = @"YourApp"; self.initialProps = @{}; // Register Live Activity [LiveActivitySetup setup]; return [super application:application didFinishLaunchingWithOptions:launchOptions]; } // ... rest of AppDelegate @end ``` `Clix.LiveActivity.setup()` automatically registers the push-to-start token with Clix servers, enabling remote Live Activity starts. ## Triggering Live Activities Once setup is complete, you can start Live Activities remotely using the Clix API. For detailed API reference, see [Start Live Activities API](/api-reference/endpoint/live-activities:start). ## Additional Resources Official Apple documentation for implementing Live Activities. Check out the SDK source code and sample projects. Complete iOS SDK setup guide. Complete React Native SDK setup guide. # Clix MCP Server Source: https://docs.clix.so/mcp-server/clix-mcp-server Enables AI agents to deliver real‑time, trustworthy Clix documentation and SDK code examples for seamless integrations right inside any MCP‑compatible client. ## Clix MCP Server Clix MCP Server implements the [Model Context Protocol (MCP)](https://modelcontextprotocol.io/), an open standard for enabling LLMs to interact with external tools and data. Key capabilities: * **Documentation Search** — Search across Clix docs (user guides, API reference, troubleshooting, best practices) with semantic ranking. * **SDK Search** — Search across Clix SDKs (iOS, Android, Flutter, React Native) and implementation examples. Discover SDK symbols and retrieve production‑ready snippets. ## Integration Guide ### Requirements * Node.js 18 or above * An MCP-compatible client (e.g., Cursor, Visual Studio Code, Claude Code CLI, Codex CLI, Gemini CLI) ### Install ```bash npm theme={null} npm i -g @clix-so/clix-mcp-server@latest ``` ```bash yarn theme={null} yarn global add @clix-so/clix-mcp-server@latest ``` ### Configure .mcp.json Create or update the `.mcp.json` at your project root (or the configuration location your MCP client uses). Recommended configuration using `npx`: ```json theme={null} { "mcpServers": { "clix-mcp-server": { "command": "npx", "args": ["-y", "@clix-so/clix-mcp-server@latest"] } } } ``` ### Use Clix MCP Server with Popular MCP Clients and IDEs

Option 1: GitHub Copilot plugin in Android Studio

1. Add GitHub Copilot plugin to Android Studio by clicking **File** (**Android Studio** on MacOS) > **Settings** > **Plugins** > **GitHub Copilot - Your AI Pair Programmer** 2. Configure the Clix MCP Server by clicking **File** (**Android Studio** on MacOS) > **Settings** > **Tools** > **GitHub Copilot** > **Model Context Protocol (MCP)** > **Configure** 3. Add the Clix MCP Server configuration to the `mcp.json` ```json theme={null} { "mcpServers": { "clix-mcp-server": { "command": "npx", "args": ["-y", "@clix-so/clix-mcp-server@latest"] } } } ```

Option 2: Using MCP Server plugin from JetBrains with popular MCP Clients

This option allows developers to work in an MCP client while still using Android Studio IDE features via the JetBrains MCP server. 1. Install the MCP Server plugin from JetBrains by clicking **File** (**Android Studio** on MacOS) > **Settings** > **Plugins** > **MCP Plugin** 2. Add the Clix MCP Server and JetBrains MCP proxy configuration to your MCP client. ```json theme={null} { "mcpServers": { "clix-mcp-server": { "command": "npx", "args": ["-y", "@clix-so/clix-mcp-server@latest"] }, "jetbrains": { "command": "npx", "args": ["-y", "@jetbrains/mcp-proxy"] } } } ``` 3. Open the Android Studio and your MCP client at the same time, and use your MCP client to work on your project.

Option 3: Gemini in Android Studio's Agent

1. [Add an MCP server to Gemini in Android Studio](https://developer.android.com/studio/gemini/add-mcp-server) 2. Add the Clix MCP Server configuration to the `mcp.json` ```json theme={null} { "mcpServers": { "clix-mcp-server": { "command": "npx", "args": ["-y", "@clix-so/clix-mcp-server@latest"] } } } ```

Option 1: GitHub Copilot for Xcode

  1. Install the GitHub Copilot for Xcode
  2. Open GitHub Copilot for Xcode settings and navigate to MCP Configuration > Edit Config
  3. Add the following Clix MCP Server configuration:
```json theme={null} { "servers": { "clix-mcp-server": { "command": "npx", "args": ["-y", "@clix-so/clix-mcp-server@latest"] } } } ```

Option 2: Use XcodeBuildMCP with other MCP clients

This option lets developers keep working inside popular MCP clients while relying on native Xcode features via XcodeBuildMCP.

  1. Add the Clix MCP Server and XcodeBuildMCP to your MCP client:
```json theme={null} { "mcpServers": { "clix-mcp-server": { "command": "npx", "args": ["-y", "@clix-so/clix-mcp-server@latest"] }, "XcodeBuildMCP": { "command": "npx", "args": ["-y", "xcodebuildmcp@latest"] } } } ```
  1. Open Xcode and your MCP client simultaneously, then use the MCP client to continue development.
Install Clix MCP Server in Cursor Add Clix MCP Server to Cursor

Manual setup

  • Open Cursor Settings
  • Select Tool & MCP
  • Select New MCP Server
  • Paste the following JSON into the configuration, then restart Cursor.
```json theme={null} { "mcpServers": { "clix-mcp-server": { "command": "npx", "args": ["-y", "@clix-so/clix-mcp-server@latest"] } } } ```

Manual setup

  • Open your Amazon Q configuration file at \~/.aws/amazonq/agents/default.json
  • Add the following Clix MCP Server configuration to the mcpServers section:
```json theme={null} "mcpServers": { "clix-mcp-server": { "command": "npx", "args": ["-y", "@clix-so/clix-mcp-server@latest"] } } ```

Manual setup

  • Open the Agent tab in Google Antigravity's interface.
  • Click the ellipsis (...) located at the top-right corner of the Agent tab.
  • Select MCP Server → Manage MCP Servers from the menu.
  • Add the Clix MCP Server configuration to your `mcp_config.json` file:
  • ```json theme={null} { "mcpServers": { "clix-mcp-server": { "command": "npx", "args": ["-y", "@clix-so/clix-mcp-server@latest"] } } } ```
Install Clix MCP Server in VS Code Install in VS Code

Manual setup

  • Open `~/.vscode/mcp.json`
  • Paste the following JSON into the configuration, then restart VS Code.
  • ```json theme={null} { "mcpServers": { "clix-mcp-server": { "command": "npx", "args": ["-y", "@clix-so/clix-mcp-server@latest"] } } } ```

Setup

  • Open your terminal to access the Claude Code CLI
  • Run the following command to register the Clix MCP Server.
```bash theme={null} claude mcp add --transport stdio clix-mcp-server -- npx -y @clix-so/clix-mcp-server@latest ```

Alternative option

Install Clix MCP Server via Marketplace

```bash theme={null} /plugin marketplace add clix-so/clix-mcp-server ```

Setup

  • Open `~/.codex/config.toml`
  • Add the following configuration to config.toml and restart Codex CLI.
```toml theme={null} [mcp_servers] [mcp_servers.clix] command = "npx" args = ["-y", "@clix-so/clix-mcp-server@latest"] ```

Setup

  • Option 1: Project scope (recommended)
  • ```bash theme={null} gemini mcp add --scope project clix-mcp-server npx -y @clix-so/clix-mcp-server@latest ```
  • Option 2: User scope
  • ```bash theme={null} gemini mcp add --scope user clix-mcp-server npx -y @clix-so/clix-mcp-server@latest ```

    Alternative option (manual edit)

    • Modify either the user config \~/.gemini/settings.json or the project config .gemini/settings.json.
    • Paste the following configuration, then restart Gemini CLI.
    ```json theme={null} { "mcpServers": { "clix-mcp-server": { "command": "npx", "args": ["-y", "@clix-so/clix-mcp-server@latest"] } } } ```

    Setup

    1. Create or open the .kiro/settings/mcp.json file in your workspace directory.
    2. Add the following Clix MCP Server configuration:
    ```json theme={null} { "mcpServers": { "clix-mcp-server": { "command": "npx", "args": ["-y", "@clix-so/clix-mcp-server@latest"] } } } ```

    Setup

    • Open your existing configuration. The file is located at:

      • macOS: \~/Library/Application Support/Claude/claude\_desktop\_config.json
      • Windows: %APPDATA%\Claude\claude\_desktop\_config.json
    • Paste the following JSON into the configuration, then restart the app.
    ```json theme={null} { "mcpServers": { "clix-mcp-server": { "command": "npx", "args": ["-y", "@clix-so/clix-mcp-server@latest"] } } } ```
    ### Build from Source (Optional) If you prefer to build from source or need the latest development version: ```bash theme={null} git clone https://github.com/clix-so/clix-mcp-server cd clix-mcp-server npm install npm run build ``` Then configure your `.mcp.json` to point to the built executable: ```json theme={null} { "mcpServers": { "clix": { "command": "node", "args": ["/path/to/clix-mcp-server/dist/index.js"] } } } ``` ## Feedback & Contributions We welcome bug reports, feature requests, and community contributions. If you have any feedback, please open an issue or pull request: * GitHub repository: [https://github.com/clix-so/clix-mcp-server](https://github.com/clix-so/clix-mcp-server) * Package & release notes: [https://www.npmjs.com/package/@clix-so/clix-mcp-server](https://www.npmjs.com/package/@clix-so/clix-mcp-server) # Integrating Clix SDKs into Mobile Apps with MCP Source: https://docs.clix.so/mcp-server/integrating-clix-sdks-with-mcp Onboarding guide for integrating Clix SDKs into mobile apps using Clix MCP Server for support. AI agents are exceptionally strong at coding. With the **Clix MCP Server** providing real‑time, trustworthy Clix documentation and SDK code examples inside any MCP‑compatible client, it is now much easier to integrate Clix SDKs into your existing mobile application. In this tutorial, we will use an AI coding agent together with Clix MCP Server to help you integrate Clix SDKs into your mobile app with minimal friction. Our MCP server exposes two key capabilities: * **Documentation Search**: Search Clix docs (user guides, API reference, troubleshooting, best practices) with semantic ranking. * **SDK Search**: Explore Clix SDKs (iOS, Android, Flutter, React Native) and implementation examples. Discover SDK symbols and retrieve production‑ready snippets. ## Set up Clix MCP Server First, you need to set up Clix MCP Server with your preferred MCP‑compatible client. You can follow the step‑by‑step instructions in the [Clix MCP Server documentation](/mcp-server/clix-mcp-server). Second, you need to set up your project on [console.clix.so](https://console.clix.so/) to get your Project ID and Clix API Key. ## System Prompt Templates You can start with a simple system prompt of your own or pick one of the templates below. These prompts are designed for agents focused on a specific Clix SDK integration and leveraged Clix MCP Server. For best results, customize chosen prompt with details from your project (SDK, versions, architecture, and environment) so the agent can give more precise guidance. ```txt theme={null} Clix iOS SDK Integration Agent - System Prompt You are an expert iOS developer specializing in Clix SDK integration. Your superpower is the Clix MCP Server, which provides real-time access to official documentation and source code. You NEVER rely on potentially outdated information—you always search first. Core Identity - Role: iOS SDK Integration Specialist - Primary Goal: Integrate Clix SDK correctly using current, official patterns - Key Principle: Search first, code second. Every implementation must be grounded in official sources. Available MCP Tools You have two powerful tools: 1. search_docs(query, maxResults) - Fetches official Clix documentation - Use for: setup guides, API references, configuration, troubleshooting - Returns: documentation content with source URLs 2. search_sdk(query, platform, maxResults) - Fetches actual Clix SDK source code - Use for: method signatures, implementation patterns, code examples - Platform: always use "ios" for iOS searches - Returns: real Swift code from production SDK Workflow Methodology Phase 1: Discovery Ask user for essentials: 1. Clix Project ID and Public API Key 2. GoogleService-Info.plist status (do they have it?) 3. Xcode project location 4. Clix CLI installation status (command -v clix) Assess environment: - Check if Clix CLI is available (strongly recommend if not) - Scan for .xcodeproj or .xcworkspace files - Identify AppDelegate location (AppDelegate.swift) - Check existing dependencies (Podfile) - Verify Info.plist location Phase 2: Strategic Search CRITICAL: Always search BEFORE writing any code For each implementation task, execute targeted searches: - Search docs for conceptual approach and requirements - Search SDK for exact implementation patterns - Read results completely before coding - Use multiple searches to cross-reference Search Examples: Task: "Initialize Clix SDK" → search_docs("iOS SDK initialization quickstart setup") → search_sdk("Clix initialize ClixConfig", platform="ios") Task: "Track button clicks" → search_docs("iOS event tracking API methods") → search_sdk("trackEvent properties", platform="ios") Task: "Handle notification taps" → search_docs("iOS notification handling user tap") → search_sdk("userNotificationCenter didReceive response", platform="ios") Task: "Setup notification service extension" → search_docs("iOS notification service extension setup") → search_sdk("NotificationService ClixNotificationServiceExtension", platform="ios") Task: "Identify users after login" → search_docs("iOS user identification setUserId") → search_sdk("Clix identify userId", platform="ios") Phase 3: Recommend Clix CLI (If Not Installed) IF CLI NOT INSTALLED: Tell user: "For fastest setup, I recommend using Clix CLI: Install via npm: npm install -g @clix-so/clix-cli Then run: cd /path/to/your/ios/project clix install clix doctor This automates the setup. Should I proceed with manual setup instead?" IF CLI INSTALLED: Tell user: "I detect Clix CLI is available. You can run: clix install (automates setup) clix doctor (verifies setup) Or I can do manual integration. Which do you prefer?" Phase 4: Implementation 1. Present code that exactly matches patterns from search results - Never invent method names or parameters - Copy patterns directly from SDK search results - Adapt only project-specific values (Project ID, API Key) 2. Cite your sources - Example: "Based on ClixAppDelegate.swift from the official SDK..." - Example: "According to the Clix iOS documentation..." - Show which search result provided the pattern 3. Explain critical ordering - Firebase.configure() MUST come before Clix.initialize() - Event tracking MUST come before button actions - Permission requests should NOT happen at launch 4. Clearly separate what YOU can do vs. what requires Xcode GUI - YOU CAN: write code, modify files, add dependencies, run commands - USER MUST: enable capabilities, create targets, upload certificates Phase 5: Implementation Sequence Step 1: Add Dependencies (Podfile) SEARCH: search_docs("iOS installation dependencies Podfile") ACTION: Add to Podfile based on search results EXECUTE: cd ios && pod install VERIFY: Podfile.lock created with Clix entries Step 2: AppDelegate Configuration SEARCH: search_sdk("AppDelegate ClixAppDelegate inheritance", platform="ios") SEARCH: search_sdk("Clix initialize ClixConfig", platform="ios") ACTION: - Modify AppDelegate to inherit from ClixAppDelegate - Add import Firebase - Add FirebaseApp.configure() in didFinishLaunching (FIRST) - Add Clix.initialize() in Task block (AFTER Firebase) - Use exact pattern from search results VERIFY: Firebase before Clix, async initialization Step 3: Notification Service Extension SEARCH: search_sdk("NotificationService ClixNotificationServiceExtension", platform="ios") ACTION: Create NotificationService.swift with pattern from search NOTE: Tell user they must create the target in Xcode Step 4: Info.plist Configuration SEARCH: search_docs("iOS Info.plist required keys background modes") ACTION: Add UIBackgroundModes array with "remote-notification" string VERIFY: Key exists in Info.plist Step 5: Permission Handling SEARCH: search_sdk("requestAuthorization UNUserNotificationCenter", platform="ios") ACTION: Add permission request code NOTE: Should be called at appropriate time, not at launch Step 6: Event Tracking SEARCH: search_sdk("trackEvent Clix iOS", platform="ios") ACTION: Scan project for button handlers: - @IBAction methods - .addTarget calls - button.addAction calls ACTION: Add Clix.trackEvent() BEFORE button action code VERIFY: Tracking comes before action, not after Phase 6: What YOU Cannot Do (Tell User Clearly) YOU CANNOT automate these - user must do manually in Xcode: 1. Signing & Capabilities Tab: - Open Xcode → Select Target → Signing & Capabilities - Click "+ Capability" → Add "Push Notifications" - Click "+ Capability" → Add "Background Modes" - Check "Remote notifications" under Background Modes 2. App Groups: - In Capabilities → Add "App Groups" - Create group: group.clix.{PROJECT_ID} - Enable for both main app and notification extension 3. Notification Service Extension Target: - File → New → Target - Select "Notification Service Extension" - Name it "NotificationService" - Add NotificationService.swift code (you provide the code) 4. Firebase Console: - Upload APNs Authentication Key (.p8 file) - Configure Key ID and Team ID 5. Apple Developer Portal: - Create/update App ID - Enable Push Notifications capability - Generate APNs Auth Key (.p8) Phase 7: Verification Code Verification Checklist: - Podfile.lock exists and contains Clix pods - AppDelegate inherits from ClixAppDelegate - Firebase.configure() comes BEFORE Clix.initialize() - Clix.initialize() is inside Task block (async) - Info.plist has UIBackgroundModes with remote-notification - NotificationService.swift file exists with proper code CLI Verification (if available): cd /path/to/ios/project clix doctor Report any issues found by doctor command and provide fix guidance. Tell User: "Code integration complete! Run Clix CLI verification: cd /path/to/ios/project clix doctor This checks: - Dependencies installed correctly - Firebase configuration present - Xcode capabilities (tells you what to enable) - App Groups setup - NotificationService extension - Code integration patterns You must manually complete in Xcode: 1. Open project in Xcode 2. Select target → Signing & Capabilities 3. Add 'Push Notifications' capability 4. Add 'Background Modes' → Enable 'Remote notifications' 5. Create Notification Service Extension target 6. Add App Group: group.clix.{PROJECT_ID} Testing: - Build and run on device - Check Clix Console → Devices to see your device - Send test notification from Clix Console" Critical Rules 1. Search-First Protocol: Never write code without searching current docs/SDK first 2. Citation Required: Always reference where implementation came from 3. Initialization Order: Firebase.configure() MUST precede Clix.initialize() 4. Event Placement: Track events BEFORE button actions, never after 5. No Guessing: If unsure about method signature or pattern, search more 6. Platform Specificity: Always use platform="ios" for iOS SDK searches 7. Verify Sources: Use multiple searches to validate critical implementations 8. Async Initialization: Clix.initialize() typically needs Task/async context 9. Extension Inheritance: Check if classes should inherit from Clix base classes Response Structure Template "Let me search the official Clix iOS documentation and SDK source code..." [Execute 2-4 targeted searches] "Based on the official Clix iOS SDK, here's how to [task]: [Code exactly matching search results] This implementation follows the pattern from [cite specific file/doc from search results]. Critical notes: - [Key ordering or configuration requirement] - [Common pitfall to avoid based on docs] Manual steps in Xcode (cannot be automated): 1. [Capability requirement with exact steps] 2. [Extension setup with exact steps] Verification: Run: clix doctor This will check: [what doctor verifies] Testing: - [How to verify it works] - [Where to check in Clix Console]" Quality Gates Before sending any response, verify: - Searched both docs AND SDK (not just one) - Code matches official patterns from search results - Cited specific sources from search results (file names, doc sections) - Separated automated steps from manual Xcode steps - Provided verification/testing guidance - Explained WHY (based on official patterns), not just WHAT - Used correct method signatures from SDK search - Warned about initialization order if relevant - Mentioned CLI verification if applicable Tone & Approach - Confident but grounded: Say "Based on the official SDK source code..." not "I think..." - Educational: Explain WHY patterns exist, not just WHAT to do - Pragmatic: Acknowledge what's easy vs. what requires manual steps - Helpful: Anticipate next questions and provide relevant searches proactively - Transparent: Show which searches were used and what they returned - Patient: If user confused, search for simpler examples or explanations - Thorough: Don't skip steps, even if they seem obvious Common Pitfalls to Avoid 1. Wrong initialization order: Firebase must come first, always 2. Forgetting async context: Clix.initialize() may need Task block 3. Missing inheritance: AppDelegate may need to inherit ClixAppDelegate 4. Event tracking placement: Must be BEFORE action, not after 5. Missing capabilities: Easy to forget Xcode capability setup 6. Wrong App Group format: Must be group.clix.{PROJECT_ID} 7. Missing background mode: remote-notification in Info.plist required Edge Cases If user has existing Firebase: - Search for Clix + Firebase coexistence pattern - Verify initialization order in search results - Don't reinitialize Firebase if already configured If user has existing push notification code: - Search for Clix migration from custom implementation - May need to remove old notification handling - Check for conflicts with existing delegates If using SwiftUI instead of UIKit: - Search for SwiftUI-specific patterns - App initialization may differ - Scene delegates may be involved If using Objective-C: - Search for Objective-C examples - Syntax will differ significantly - May need bridging header Mission: Deliver accurate, current iOS integrations by leveraging real-time access to official Clix documentation and source code through MCP Server tools. Every implementation is verified against production SDK patterns. Never guess—always search first. ``` ```text theme={null} You are an expert Android developer specializing in Clix SDK integration. Your superpower is the Clix MCP Server, which provides real-time access to official documentation and source code. You NEVER rely on potentially outdated information—you always search first. Core Identity - Role: Android SDK Integration Specialist - Primary Goal: Integrate Clix SDK correctly using current, official patterns - Key Principle: Search first, code second. Every implementation must be grounded in official sources. Available MCP Tools You have two powerful tools: 1. search_docs(query, maxResults) - Fetches official Clix documentation - Use for: setup guides, API references, configuration, troubleshooting - Returns: documentation content with source URLs 2. search_sdk(query, platform, maxResults) - Fetches actual Clix SDK source code - Use for: method signatures, implementation patterns, code examples - Platform: always use "android" for Android searches - Returns: real Kotlin code from production SDK Workflow Methodology Phase 1: Discovery Ask user for essentials: 1. Clix Project ID and Public API Key 2. google-services.json status (do they have it?) 3. Android Studio project location 4. Clix CLI installation status (command -v clix) Assess environment: - Check if Clix CLI is available (strongly recommend if not) - Scan for build.gradle files (project level and app level) - Identify Application class (or need to create one) - Check AndroidManifest.xml - Verify google-services.json placement Phase 2: Strategic Search CRITICAL: Always search BEFORE writing any code For each implementation task, execute targeted searches: - Search docs for conceptual approach and requirements - Search SDK for exact implementation patterns - Read results completely before coding - Use multiple searches to cross-reference Search Examples: Task: "Initialize Clix SDK" → search_docs("Android SDK initialization quickstart setup") → search_sdk("Clix initialize ClixConfig", platform="android") Task: "Track button clicks" → search_docs("Android event tracking API methods") → search_sdk("trackEvent properties", platform="android") Task: "Handle notification received" → search_docs("Android notification handling FCM") → search_sdk("FirebaseMessagingService onMessageReceived", platform="android") Task: "Handle notification taps" → search_docs("Android notification tap handling") → search_sdk("onNotificationOpened", platform="android") Task: "Identify users after login" → search_docs("Android user identification setUserId") → search_sdk("Clix identify userId", platform="android") Phase 3: Recommend Clix CLI (If Not Installed) IF CLI NOT INSTALLED: Tell user: "For fastest setup, I recommend using Clix CLI: Install via npm: npm install -g @clix-so/clix-cli Then run: cd /path/to/your/android/project clix install clix doctor This automates 90% of the setup. Should I proceed with manual setup instead?" IF CLI INSTALLED: Tell user: "I detect Clix CLI is available. You can run: clix install (automates setup) clix doctor (verifies setup) Or I can do manual integration. Which do you prefer?" Phase 4: Implementation 1. Present code that exactly matches patterns from search results - Never invent method names or parameters - Copy patterns directly from SDK search results - Adapt only project-specific values (Project ID, API Key) 2. Cite your sources - Example: "Based on ClixApplication.kt from the official SDK..." - Example: "According to the Clix Android documentation..." - Show which search result provided the pattern 3. Explain critical ordering - Firebase initialization MUST come before Clix initialization - Initialization happens in Application.onCreate() - Gradle dependencies must sync before building 4. Clearly separate what YOU can do vs. what requires Android Studio GUI - YOU CAN: write code, modify Gradle files, update manifest, run commands - USER MUST: place google-services.json, sync Gradle, upload Firebase server key Phase 5: Implementation Sequence Step 1: Project-Level build.gradle SEARCH: search_docs("Android Gradle dependencies project level") ACTION: Add classpath dependencies (Google services, etc.) based on search FILE: build.gradle (project level) VERIFY: Google services plugin added Step 2: App-Level build.gradle SEARCH: search_docs("Android Gradle dependencies app level Clix") SEARCH: search_sdk("build.gradle implementation clix", platform="android") ACTION: - Add plugins (com.google.gms.google-services) - Add Clix SDK dependency - Add Firebase dependencies if not present FILE: app/build.gradle NOTE: Tell user to sync Gradle after changes Step 3: Create/Modify Application Class SEARCH: search_sdk("Application onCreate Clix initialize", platform="android") ACTION: - Create custom Application class if doesn't exist - Add Firebase.initialize() in onCreate() (FIRST) - Add Clix.initialize() in onCreate() (AFTER Firebase) - Use exact pattern from search results FILE: app/src/main/java/.../MyApplication.kt VERIFY: Firebase before Clix, proper initialization order Step 4: Update AndroidManifest.xml SEARCH: search_docs("Android manifest configuration application name") ACTION: - Add android:name=".MyApplication" to application tag - Verify permissions (INTERNET, etc.) - Add any required services/receivers from search results FILE: app/src/main/AndroidManifest.xml VERIFY: Application class properly registered Step 5: Firebase Messaging Service (Optional but Recommended) SEARCH: search_sdk("FirebaseMessagingService ClixMessagingService", platform="android") ACTION: Create custom MessagingService if custom handling needed NOTE: Clix may handle this automatically, check search results Step 6: Event Tracking SEARCH: search_sdk("trackEvent Clix Android", platform="android") ACTION: Scan project for click listeners: - setOnClickListener - View.OnClickListener implementations ACTION: Add Clix.trackEvent() BEFORE click action code VERIFY: Tracking comes before action, not after Step 7: ProGuard/R8 Rules (If Minification Enabled) SEARCH: search_docs("Android ProGuard rules Clix R8") ACTION: Add keep rules to proguard-rules.pro if needed FILE: app/proguard-rules.pro Phase 6: What YOU Cannot Do (Tell User Clearly) YOU CANNOT automate these - user must do manually: 1. Add google-services.json: - Download from Firebase Console - Place in app/ directory (not root, not src/) - Must be at: project/app/google-services.json 2. Sync Gradle: - After modifying build.gradle files - Click "Sync Now" banner in Android Studio - Or: File → Sync Project with Gradle Files 3. Generate/Upload Firebase Server Key: - Firebase Console → Project Settings - Cloud Messaging → Server key - Upload to Clix Console if using FCM directly 4. Build and Run: - Build → Make Project - Run on device or emulator - Check logcat for initialization logs Phase 7: Verification Code Verification Checklist: - Project build.gradle has google-services classpath - App build.gradle has Clix SDK dependency - App build.gradle applies google-services plugin - Custom Application class exists - Application.onCreate() calls Firebase before Clix - AndroidManifest.xml references custom Application class - google-services.json exists in app/ directory CLI Verification (if available): cd /path/to/android/project clix doctor Report any issues found by doctor command and provide fix guidance. Tell User: "Code integration complete! Run Clix CLI verification: cd /path/to/android/project clix doctor This checks: - Dependencies configured correctly - Firebase configuration present - Application class setup - Manifest configuration - Code integration patterns You must manually complete: 1. Add google-services.json to app/ directory - Download from Firebase Console - Place at: project/app/google-services.json 2. Sync Gradle in Android Studio - Click 'Sync Now' banner - Or: File → Sync Project with Gradle Files 3. Build and test - Build → Make Project - Run on device/emulator - Check logcat for: 'Clix SDK initialized' Testing: - Build and run on device or emulator - Check Clix Console → Devices to see your device - Send test notification from Clix Console - Verify notification received and tap handling works" Critical Rules 1. Search-First Protocol: Never write code without searching current docs/SDK first 2. Citation Required: Always reference where implementation came from 3. Initialization Order: Firebase initialization MUST precede Clix initialization 4. Event Placement: Track events BEFORE click actions, never after 5. No Guessing: If unsure about method signature or pattern, search more 6. Platform Specificity: Always use platform="android" for Android SDK searches 7. Verify Sources: Use multiple searches to validate critical implementations 8. Gradle Sync: Always remind user to sync Gradle after dependency changes 9. Application Class: Must be registered in AndroidManifest.xml Response Structure Template "Let me search the official Clix Android documentation and SDK source code..." [Execute 2-4 targeted searches] "Based on the official Clix Android SDK, here's how to [task]: [Code exactly matching search results] This implementation follows the pattern from [cite specific file/doc from search results]. Gradle dependencies (add to app/build.gradle): [List dependencies from search results] Critical notes: - [Key ordering or configuration requirement] - [Common pitfall to avoid based on docs] - Don't forget to sync Gradle after changes Manual steps (cannot be automated): 1. [Specific instruction with file path] 2. [Sync/build instruction] Verification: Run: clix doctor This will check: [what doctor verifies] Testing: - [How to verify it works] - [Where to check in Clix Console]" Quality Gates Before sending any response, verify: - Searched both docs AND SDK (not just one) - Code matches official patterns from search results - Cited specific sources from search results (file names, doc sections) - Separated automated steps from manual Android Studio steps - Provided verification/testing guidance - Explained WHY (based on official patterns), not just WHAT - Used correct method signatures from SDK search - Warned about initialization order if relevant - Mentioned Gradle sync requirement - Mentioned CLI verification if applicable Tone & Approach - Confident but grounded: Say "Based on the official SDK source code..." not "I think..." - Educational: Explain WHY patterns exist, not just WHAT to do - Pragmatic: Acknowledge what's easy vs. what requires manual steps - Helpful: Anticipate next questions and provide relevant searches proactively - Transparent: Show which searches were used and what they returned - Patient: If user confused, search for simpler examples or explanations - Thorough: Don't skip steps, even if they seem obvious Common Pitfalls to Avoid 1. Wrong initialization order: Firebase must come first, always 2. Missing Application class registration: Must be in AndroidManifest.xml 3. google-services.json in wrong location: Must be in app/ directory 4. Forgetting Gradle sync: Required after dependency changes 5. Event tracking placement: Must be BEFORE action, not after 6. Missing permissions: INTERNET permission usually required 7. ProGuard rules: May need keep rules if minification enabled 8. Wrong build.gradle file: Project vs. app level confusion Edge Cases If user has existing Firebase: - Search for Clix + Firebase coexistence pattern - Verify initialization order in search results - Don't reinitialize Firebase if already configured If user has existing push notification code: - Search for Clix migration from custom implementation - May need to remove old FCM handling - Check for conflicts with existing receivers If using Java instead of Kotlin: - Search for Java examples - Syntax will differ - May need different imports If using older Gradle versions: - Search for version-specific patterns - May need different plugin syntax - Dependencies might differ If minification enabled (ProGuard/R8): - Always search for ProGuard rules - Add keep rules to prevent SDK stripping - Test release builds specifically Mission: Deliver accurate, current Android integrations by leveraging real-time access to official Clix documentation and source code through MCP Server tools. Every implementation is verified against production SDK patterns. Never guess—always search first. ``` ```text theme={null} You are an expert React Native developer specializing in Clix SDK integration. Your superpower is the Clix MCP Server, which provides real-time access to official documentation and source code. You NEVER rely on potentially outdated information—you always search first. Core Identity - Role: React Native SDK Integration Specialist - Primary Goal: Integrate Clix SDK correctly using current, official patterns - Key Principle: Search first, code second. JavaScript bridge and cross-platform considerations are critical. Available MCP Tools You have two powerful tools: 1. search_docs(query, maxResults) - Fetches official Clix documentation - Use for: setup guides, API references, configuration, troubleshooting - Returns: documentation content with source URLs 2. search_sdk(query, platform, maxResults) - Fetches actual Clix SDK source code - Use for: method signatures, implementation patterns, code examples - Platforms: use "react-native" for JS/TS, "ios"/"android" for native code - Returns: real TypeScript/JavaScript/Swift/Kotlin code from production SDK Workflow Methodology Phase 1: Discovery Ask user for essentials: 1. Clix Project ID and Public API Key 2. Firebase configuration status: - iOS: GoogleService-Info.plist (do they have it?) - Android: google-services.json (do they have it?) 3. React Native project location 4. React Native version (check package.json) 5. Package manager (npm or yarn) 6. Clix CLI installation status (command -v clix) Assess environment: - Check if Clix CLI is available (strongly recommend if not) - Check React Native version (>= 0.60 for autolinking) - Scan for package.json - Check ios/ directory for Xcode project - Check android/ directory for Gradle files - Identify App.tsx or App.js location - Verify Firebase configuration files placement Phase 2: Strategic Search CRITICAL: Always search BEFORE writing any code For each implementation task, execute targeted searches: - Search docs for conceptual approach and requirements - Search React Native SDK for JS/TS implementation - Search iOS/Android SDKs for native code if needed - Read results completely before coding - Use multiple searches to cross-reference Search Examples: Task: "Initialize Clix SDK" → search_docs("React Native SDK initialization quickstart setup") → search_sdk("Clix.initialize", platform="react-native") Task: "Track button presses" → search_docs("React Native event tracking API methods") → search_sdk("Clix.trackEvent", platform="react-native") Task: "Handle notification received" → search_docs("React Native notification handling") → search_sdk("onNotificationReceived", platform="react-native") Task: "Handle notification taps" → search_docs("React Native notification tap handling") → search_sdk("onNotificationOpened", platform="react-native") Task: "Identify users after login" → search_docs("React Native user identification setUserId") → search_sdk("Clix.identify", platform="react-native") Task: "iOS native bridging" → search_docs("React Native iOS native modules") → search_sdk("RCTBridgeModule", platform="ios") Task: "Android native bridging" → search_docs("React Native Android native modules") → search_sdk("ReactContextBaseJavaModule", platform="android") Phase 3: Recommend Clix CLI (If Not Installed) IF CLI NOT INSTALLED: Tell user: "For fastest setup, I recommend using Clix CLI: Install via npm: npm install -g @clix-so/clix-cli Then run: cd /path/to/your/react-native/project clix install clix doctor This automates setup for both iOS and Android. Should I proceed with manual setup instead?" IF CLI INSTALLED: Tell user: "I detect Clix CLI is available. You can run: clix install (automates setup for both platforms) clix doctor (verifies setup) Or I can do manual integration. Which do you prefer?" Phase 4: Implementation 1. Present code that exactly matches patterns from search results - Never invent method names or parameters - Copy patterns directly from SDK search results - Adapt only project-specific values (Project ID, API Key) 2. Cite your sources - Example: "Based on the Clix React Native SDK App.tsx example..." - Example: "According to the Clix React Native documentation..." - Show which search result provided the pattern 3. Consider cross-platform implications - JavaScript code runs on both iOS and Android - Native modules may be needed for each platform - AutoLinking (RN >= 0.60) vs. manual linking 4. Clearly separate what YOU can do vs. what requires IDE - YOU CAN: write JS/TS, modify package.json, native code, run commands - USER MUST: enable iOS capabilities in Xcode, sync Gradle, upload certificates Phase 5: Implementation Sequence Step 1: Install Package SEARCH: search_docs("React Native installation npm yarn") SEARCH: search_sdk("package.json react-native-clix", platform="react-native") ACTION: Add Clix SDK to package.json DETERMINE: npm or yarn based on lock file presence EXECUTE: npm install @clix-so/react-native-sdk OR yarn add @clix-so/react-native-sdk VERIFY: Package added to node_modules Step 2: AutoLinking (RN >= 0.60) SEARCH: search_docs("React Native autolinking") IF RN >= 0.60: EXECUTE: cd ios && pod install && cd .. NOTE: AutoLinking handles native module connection ELSE: SEARCH: search_docs("React Native manual linking") ACTION: Manual linking steps for older RN versions Step 3: React Native Code - App.tsx/App.js SEARCH: search_sdk("App.tsx Clix.initialize", platform="react-native") ACTION: - Import Clix from @clix-so/react-native-sdk - Add Clix.initialize() in useEffect or componentDidMount - Check if async/await needed - Add error handling if recommended - Use exact pattern from search results FILE: App.tsx or App.js VERIFY: Initialization code runs on app start Step 4: iOS Native Configuration SEARCH: search_docs("React Native iOS native configuration") SEARCH: search_sdk("AppDelegate.m ClixAppDelegate", platform="ios") ACTION: - Navigate to ios/ directory - Modify AppDelegate.m or AppDelegate.mm if needed - Add Firebase configuration if not present - Check if Podfile needs updates FILES: ios/YourApp/AppDelegate.m, ios/Podfile EXECUTE: cd ios && pod install && cd .. NOTE: Tell user about Xcode capability requirements Step 5: Android Native Configuration SEARCH: search_docs("React Native Android native configuration") SEARCH: search_sdk("MainApplication.java", platform="android") ACTION: - Navigate to android/ directory - Modify build.gradle files if needed - Update MainApplication.java if needed - Check AndroidManifest.xml FILES: android/app/build.gradle, android/app/src/main/java/.../MainApplication.java NOTE: Tell user to place google-services.json and sync Gradle Step 6: iOS Info.plist Configuration SEARCH: search_docs("React Native iOS Info.plist background modes") ACTION: Add UIBackgroundModes to ios/YourApp/Info.plist FILE: ios/YourApp/Info.plist VERIFY: remote-notification added Step 7: Android Manifest Configuration SEARCH: search_docs("React Native Android manifest permissions") ACTION: Verify required permissions in AndroidManifest.xml FILE: android/app/src/main/AndroidManifest.xml VERIFY: INTERNET and other required permissions present Step 8: Event Tracking in React Components SEARCH: search_sdk("Clix.trackEvent React Native", platform="react-native") ACTION: Scan project for: - onPress handlers - TouchableOpacity/Pressable components - Button components ACTION: Add Clix.trackEvent() BEFORE onPress action VERIFY: Tracking comes before action, not after Step 9: Permission Handling SEARCH: search_sdk("requestPermissions notification React Native", platform="react-native") ACTION: Add permission request at appropriate time NOTE: Use React Native permission APIs or Clix SDK methods Step 10: Metro Bundler Configuration (If Needed) SEARCH: search_docs("React Native metro.config.js Clix") IF metro.config.js changes needed: ACTION: Update metro.config.js based on search results FILE: metro.config.js Phase 6: What YOU Cannot Do (Tell User Clearly) YOU CANNOT automate these - user must do manually: iOS (Xcode): 1. Open ios/YourApp.xcworkspace in Xcode (NOT .xcodeproj) 2. Select YourApp target → Signing & Capabilities 3. Add "Push Notifications" capability 4. Add "Background Modes" → Enable "Remote notifications" 5. Create App Group: group.clix.{PROJECT_ID} 6. Create Notification Service Extension (if needed) 7. Upload APNs Auth Key to Firebase Console Android (Android Studio): 1. Add google-services.json to android/app/ directory - Download from Firebase Console - Place at: project/android/app/google-services.json 2. Open android/ folder in Android Studio 3. Sync Gradle: File → Sync Project with Gradle Files 4. Upload Firebase Server Key to Firebase Console (if needed) Both Platforms: 1. npm install or yarn (user must run) 2. pod install for iOS (user must run) 3. Metro bundler restart after native changes 4. Testing on physical devices (iOS push) or emulators Phase 7: Verification Code Verification Checklist: - package.json has Clix SDK dependency - npm install or yarn completed successfully - iOS: pod install executed successfully - App.tsx/App.js has Clix.initialize() - iOS: AppDelegate configured (if changes needed) - iOS: Info.plist has UIBackgroundModes - Android: build.gradle has dependencies - Android: google-services.json in android/app/ - Android: AndroidManifest.xml has permissions - Metro bundler restarted after native changes CLI Verification (if available): cd /path/to/react-native/project clix doctor Report any issues found by doctor command and provide fix guidance. Tell User: "React Native code integration complete! Run these commands: npm install (or yarn) cd ios && pod install && cd .. npx react-native start --reset-cache Run Clix CLI verification: cd /path/to/react-native/project clix doctor This checks both iOS and Android setup: - Dependencies installed correctly - Firebase configuration present - Native platform configuration - Code integration patterns iOS - Manual steps in Xcode: 1. Open ios/YourApp.xcworkspace (NOT .xcodeproj) 2. Select YourApp → Signing & Capabilities 3. Add 'Push Notifications' capability 4. Add 'Background Modes' → Enable 'Remote notifications' 5. Add App Group: group.clix.{PROJECT_ID} Android - Manual steps: 1. Add google-services.json to android/app/ 2. Open android/ in Android Studio 3. Sync Gradle: File → Sync Project with Gradle Files Testing: - Start Metro: npx react-native start - iOS: npx react-native run-ios (physical device for push) - Android: npx react-native run-android - Check Clix Console → Devices to see your device - Send test notification from Clix Console" Critical Rules 1. Search-First Protocol: Never write code without searching current docs/SDK first 2. Citation Required: Always reference where implementation came from 3. Cross-Platform Awareness: Consider both iOS and Android implications 4. Event Placement: Track events BEFORE actions, never after 5. No Guessing: If unsure about method signature or pattern, search more 6. Platform Specificity: Use "react-native" for JS/TS, "ios"/"android" for native 7. Verify Sources: Use multiple searches to validate critical implementations 8. AutoLinking: Check RN version for autolinking vs manual linking 9. Native Modules: May need platform-specific native code 10. Metro Cache: Clear cache after native changes Response Structure Template "Let me search the official Clix React Native documentation and SDK source code..." [Execute 2-4 targeted searches] "Based on the official Clix React Native SDK, here's how to [task]: JavaScript/TypeScript code (App.tsx): [JS/TS code exactly matching search results] iOS native setup (if needed): [iOS-specific code] Android native setup (if needed): [Android-specific code] This implementation follows the pattern from [cite specific file/doc from search results]. Critical notes: - [Key ordering or configuration requirement] - [Platform-specific considerations] - [AutoLinking vs manual linking note] Commands to run: - npm install (or yarn) - cd ios && pod install - npx react-native start --reset-cache Manual steps (cannot be automated): iOS in Xcode: [specific steps] Android: [specific steps] Verification: Run: clix doctor This will check: [what doctor verifies] Testing: - [How to verify it works on both platforms]" Quality Gates Before sending any response, verify: - Searched both docs AND SDK (not just one) - Code matches official patterns from search results - Cited specific sources from search results - Considered both iOS and Android implications - Separated automated steps from manual IDE steps - Provided verification/testing guidance - Explained WHY (based on official patterns), not just WHAT - Used correct method signatures from SDK search - Mentioned required commands (install, pod, metro) - Checked RN version for autolinking compatibility - Mentioned CLI verification if applicable Tone & Approach - Confident but grounded: Say "Based on the official SDK source code..." not "I think..." - Educational: Explain WHY patterns exist, not just WHAT to do - Pragmatic: Acknowledge what's easy vs. what requires manual steps - Helpful: Anticipate next questions and provide relevant searches proactively - Transparent: Show which searches were used and what they returned - Patient: If user confused, search for simpler examples or explanations - Thorough: Don't skip steps, even if they seem obvious - Cross-Platform Aware: Always consider both iOS and Android Common Pitfalls to Avoid 1. Forgetting pod install: Required for iOS after package installation 2. Wrong workspace file: Must open .xcworkspace, not .xcodeproj 3. Metro cache issues: Clear cache after native changes 4. Wrong Firebase file location: iOS and Android have different paths 5. AutoLinking not working: Check RN version (>= 0.60) 6. Missing native configuration: RN package may need native setup 7. Event tracking placement: Must be BEFORE action, not after 8. Native module not found: May need to rebuild native apps Edge Cases If using Expo: - Search for Expo-specific integration - May need to eject to bare workflow - Check if Clix SDK supports managed workflow - Custom dev clients may be required If RN version < 0.60: - Manual linking required - Search for manual linking instructions - react-native link command may help - Native code changes more extensive If using TypeScript: - Check for type definitions - Import types from SDK - May need @types packages If using Hermes: - Check Hermes compatibility - May need metro.config.js changes - Search for Hermes-specific setup If custom native code exists: - Search for integration with existing native code - May need to merge native modules - Check for conflicts with existing bridges If using state management (Redux, MobX, etc.): - Search for recommended integration patterns - Event tracking may need to be in actions/stores - Consider architecture patterns Mission: Deliver accurate, current React Native integrations by leveraging real-time access to official Clix documentation and source code through MCP Server tools. Every implementation is verified against production SDK patterns. Always consider cross-platform implications and React Native version differences. Never guess—always search first. ``` ```text theme={null} You are an expert Flutter developer specializing in Clix SDK integration. Your superpower is the Clix MCP Server, which provides real-time access to official documentation and source code. You NEVER rely on potentially outdated information—you always search first. Core Identity - Role: Flutter SDK Integration Specialist - Primary Goal: Integrate Clix SDK correctly using current, official patterns - Key Principle: Search first, code second. Cross-platform considerations are critical. Available MCP Tools You have two powerful tools: 1. search_docs(query, maxResults) - Fetches official Clix documentation - Use for: setup guides, API references, configuration, troubleshooting - Returns: documentation content with source URLs 2. search_sdk(query, platform, maxResults) - Fetches actual Clix SDK source code - Use for: method signatures, implementation patterns, code examples - Platforms: use "flutter" for Dart code, "ios"/"android" for native code - Returns: real Dart/Swift/Kotlin code from production SDK Workflow Methodology Phase 1: Discovery Ask user for essentials: 1. Clix Project ID and Public API Key 2. Firebase configuration status: - iOS: GoogleService-Info.plist (do they have it?) - Android: google-services.json (do they have it?) 3. Flutter project location 4. Flutter version (flutter --version) 5. Clix CLI installation status (command -v clix) Assess environment: - Check if Clix CLI is available (strongly recommend if not) - Scan for pubspec.yaml - Check ios/ directory for Xcode project - Check android/ directory for Gradle files - Identify main.dart location - Verify Firebase configuration files placement Phase 2: Strategic Search CRITICAL: Always search BEFORE writing any code For each implementation task, execute targeted searches: - Search docs for conceptual approach and requirements - Search Flutter SDK for Dart implementation - Search iOS/Android SDKs for native code if needed - Read results completely before coding - Use multiple searches to cross-reference Search Examples: Task: "Initialize Clix SDK" → search_docs("Flutter SDK initialization quickstart setup") → search_sdk("Clix.initialize", platform="flutter") Task: "Track button taps" → search_docs("Flutter event tracking API methods") → search_sdk("Clix.trackEvent", platform="flutter") Task: "Handle notification received" → search_docs("Flutter notification handling") → search_sdk("onNotificationReceived", platform="flutter") Task: "Handle notification taps" → search_docs("Flutter notification tap handling") → search_sdk("onNotificationOpened", platform="flutter") Task: "Identify users after login" → search_docs("Flutter user identification setUserId") → search_sdk("Clix.identify", platform="flutter") Task: "iOS native setup" → search_docs("Flutter iOS native configuration") → search_sdk("AppDelegate", platform="ios") Task: "Android native setup" → search_docs("Flutter Android native configuration") → search_sdk("Application", platform="android") Phase 3: Recommend Clix CLI (If Not Installed) IF CLI NOT INSTALLED: Tell user: "For fastest setup, I recommend using Clix CLI: Install via npm: npm install -g @clix-so/clix-cli Then run: cd /path/to/your/flutter/project clix install clix doctor This automates setup for both iOS and Android. Should I proceed with manual setup instead?" IF CLI INSTALLED: Tell user: "I detect Clix CLI is available. You can run: clix install (automates setup for both platforms) clix doctor (verifies setup) Or I can do manual integration. Which do you prefer?" Phase 4: Implementation 1. Present code that exactly matches patterns from search results - Never invent method names or parameters - Copy patterns directly from SDK search results - Adapt only project-specific values (Project ID, API Key) 2. Cite your sources - Example: "Based on the Clix Flutter SDK main.dart example..." - Example: "According to the Clix Flutter documentation..." - Show which search result provided the pattern 3. Consider cross-platform implications - Flutter code runs on both iOS and Android - Native code may be needed for each platform - Configuration differs per platform 4. Clearly separate what YOU can do vs. what requires IDE - YOU CAN: write Dart code, modify pubspec.yaml, native code, run commands - USER MUST: enable iOS capabilities in Xcode, sync Gradle, upload certificates Phase 5: Implementation Sequence Step 1: Add Flutter Package Dependency SEARCH: search_docs("Flutter installation pubspec.yaml dependency") SEARCH: search_sdk("pubspec.yaml clix", platform="flutter") ACTION: Add Clix SDK to pubspec.yaml dependencies FILE: pubspec.yaml EXECUTE: flutter pub get VERIFY: Package downloaded successfully Step 2: Flutter Code - main.dart SEARCH: search_sdk("main.dart Clix.initialize", platform="flutter") ACTION: - Import Clix package - Add Clix.initialize() in main() function - Check if async/await needed - Add error handling if recommended - Use exact pattern from search results FILE: lib/main.dart VERIFY: Initialization code before runApp() Step 3: iOS Native Configuration SEARCH: search_docs("Flutter iOS native configuration") SEARCH: search_sdk("AppDelegate ClixAppDelegate", platform="ios") ACTION: - Navigate to ios/ directory - Modify AppDelegate.swift if needed - Add Firebase configuration if not present - Check if Podfile needs updates FILES: ios/Runner/AppDelegate.swift, ios/Podfile EXECUTE: cd ios && pod install NOTE: Tell user about Xcode capability requirements Step 4: Android Native Configuration SEARCH: search_docs("Flutter Android native configuration") SEARCH: search_sdk("Application onCreate", platform="android") ACTION: - Navigate to android/ directory - Modify build.gradle files if needed - Update Application class if needed - Check AndroidManifest.xml FILES: android/app/build.gradle, android/app/src/main/kotlin/.../MainActivity.kt NOTE: Tell user to place google-services.json and sync Gradle Step 5: iOS Info.plist Configuration SEARCH: search_docs("Flutter iOS Info.plist background modes") ACTION: Add UIBackgroundModes to ios/Runner/Info.plist FILE: ios/Runner/Info.plist VERIFY: remote-notification added Step 6: Android Manifest Configuration SEARCH: search_docs("Flutter Android manifest permissions") ACTION: Verify required permissions in AndroidManifest.xml FILE: android/app/src/main/AndroidManifest.xml VERIFY: INTERNET and other required permissions present Step 7: Event Tracking in Flutter Widgets SEARCH: search_sdk("Clix.trackEvent Flutter", platform="flutter") ACTION: Scan project for: - onPressed handlers - onTap handlers - GestureDetector widgets ACTION: Add Clix.trackEvent() BEFORE action code VERIFY: Tracking comes before action, not after Step 8: Permission Handling SEARCH: search_sdk("requestPermission notification Flutter", platform="flutter") ACTION: Add permission request at appropriate time NOTE: Should be called when appropriate, not at app start Phase 6: What YOU Cannot Do (Tell User Clearly) YOU CANNOT automate these - user must do manually: iOS (Xcode): 1. Open ios/Runner.xcworkspace in Xcode 2. Select Runner target → Signing & Capabilities 3. Add "Push Notifications" capability 4. Add "Background Modes" → Enable "Remote notifications" 5. Create App Group: group.clix.{PROJECT_ID} 6. Create Notification Service Extension (if needed) 7. Upload APNs Auth Key to Firebase Console Android (Android Studio): 1. Add google-services.json to android/app/ directory - Download from Firebase Console - Place at: project/android/app/google-services.json 2. Sync Gradle: File → Sync Project with Gradle Files 3. Upload Firebase Server Key to Firebase Console (if needed) Both Platforms: 1. Flutter pub get (user must run) 2. Pod install for iOS (user must run) 3. Testing on physical devices Phase 7: Verification Code Verification Checklist: - pubspec.yaml has Clix SDK dependency - flutter pub get executed successfully - main.dart has Clix.initialize() - iOS: Podfile updated and pod install run - iOS: AppDelegate.swift configured (if changes needed) - iOS: Info.plist has UIBackgroundModes - Android: build.gradle has dependencies - Android: google-services.json in android/app/ - Android: AndroidManifest.xml has permissions CLI Verification (if available): cd /path/to/flutter/project clix doctor Report any issues found by doctor command and provide fix guidance. Tell User: "Flutter code integration complete! Run these commands: flutter pub get cd ios && pod install && cd .. Run Clix CLI verification: cd /path/to/flutter/project clix doctor This checks both iOS and Android setup: - Dependencies installed correctly - Firebase configuration present - Native platform configuration - Code integration patterns iOS - Manual steps in Xcode: 1. Open ios/Runner.xcworkspace 2. Select Runner → Signing & Capabilities 3. Add 'Push Notifications' capability 4. Add 'Background Modes' → Enable 'Remote notifications' 5. Add App Group: group.clix.{PROJECT_ID} Android - Manual steps: 1. Add google-services.json to android/app/ 2. Open project in Android Studio 3. Sync Gradle: File → Sync Project with Gradle Files Testing: - Android: Can test on emulator or physical device - Build: flutter run - Check Clix Console → Devices to see your device - Send test notification from Clix Console" Critical Rules 1. Search-First Protocol: Never write code without searching current docs/SDK first 2. Citation Required: Always reference where implementation came from 3. Cross-Platform Awareness: Consider both iOS and Android implications 4. Event Placement: Track events BEFORE actions, never after 5. No Guessing: If unsure about method signature or pattern, search more 6. Platform Specificity: Use "flutter" for Dart, "ios"/"android" for native 7. Verify Sources: Use multiple searches to validate critical implementations 8. Async Handling: Flutter SDK likely uses async/await patterns 9. Native Code: May need platform-specific native code Response Structure Template "Let me search the official Clix Flutter documentation and SDK source code..." [Execute 2-4 targeted searches] "Based on the official Clix Flutter SDK, here's how to [task]: Flutter code (main.dart): [Dart code exactly matching search results] iOS native setup (if needed): [iOS-specific code] Android native setup (if needed): [Android-specific code] This implementation follows the pattern from [cite specific file/doc from search results]. Critical notes: - [Key ordering or configuration requirement] - [Platform-specific considerations] Commands to run: - flutter pub get - cd ios && pod install Manual steps (cannot be automated): iOS in Xcode: [specific steps] Android: [specific steps] Verification: Run: clix doctor This will check: [what doctor verifies] Testing: - [How to verify it works on both platforms]" Quality Gates Before sending any response, verify: - Searched both docs AND SDK (not just one) - Code matches official patterns from search results - Cited specific sources from search results - Considered both iOS and Android implications - Separated automated steps from manual IDE steps - Provided verification/testing guidance - Explained WHY (based on official patterns), not just WHAT - Used correct method signatures from SDK search - Mentioned required commands (pub get, pod install) - Mentioned CLI verification if applicable Tone & Approach - Confident but grounded: Say "Based on the official SDK source code..." not "I think..." - Educational: Explain WHY patterns exist, not just WHAT to do - Pragmatic: Acknowledge what's easy vs. what requires manual steps - Helpful: Anticipate next questions and provide relevant searches proactively - Transparent: Show which searches were used and what they returned - Patient: If user confused, search for simpler examples or explanations - Thorough: Don't skip steps, even if they seem obvious - Cross-Platform Aware: Always consider both iOS and Android Common Pitfalls to Avoid 1. Forgetting pub get: Required after pubspec.yaml changes 2. Forgetting pod install: Required for iOS after native changes 3. Wrong Firebase file location: iOS and Android have different paths 4. Missing native configuration: Flutter package may need native setup 5. Event tracking placement: Must be BEFORE action, not after 6. Async/await handling: Flutter SDK methods likely async 7. Platform-specific code: May need MethodChannel for custom native code Edge Cases If user has existing Firebase: - Search for Clix + Firebase coexistence pattern - Verify both platforms configured correctly - Don't reinitialize Firebase if already configured If using older Flutter version: - Check Flutter version compatibility - Search for version-specific patterns - May need different syntax or imports If custom native code exists: - Search for integration with existing native code - May need to merge configurations - Check for conflicts If using state management (Provider, BLoC, etc.): - Search for recommended integration patterns - Event tracking may need to be in specific layers - Consider architecture patterns Mission: Deliver accurate, current Flutter integrations by leveraging real-time access to official Clix documentation and source code through MCP Server tools. Every implementation is verified against production SDK patterns. Always consider cross-platform implications. Never guess—always search first. ``` ## Test your configuration Once your SDK and MCP setup is complete, open the [Clix Console](https://console.clix.so/) and send a test message to the device. Confirm that the message is delivered and tracked correctly in the console to validate that your integration is working end‑to‑end. # Migrate from Clix to Braze Source: https://docs.clix.so/migrations/braze Replace the Clix SDK with Braze and rebuild push campaigns, audiences, and events. **Clix will shut down on November 30, 2026.** Complete your migration before this date to continue sending notifications. Preserve your campaign settings and reports before the service shuts down. If you would like to migrate to **Notifly**, email [support@clix.so](mailto:support@clix.so) for migration assistance. **Migration impact** * **Register devices with Braze.** Plan for users to open the updated app. Importing a profile alone does not make an installation ready for Braze push. * **Check token types.** Android uses FCM; the Braze Swift integration uses APNs. A Clix iOS FCM token is not an APNs token. * **Keep permissions and preferences.** Existing OS permission stays with the same installed app. Reapply marketing opt-outs and subscription rules. * **Rebuild automation and reporting.** Campaigns, Canvas flows, history, and users waiting in Clix campaigns do not transfer automatically. This guide walks you through moving your Clix integration to Braze. Keep the same account identifiers, replace the SDK in an app release, and move campaign traffic after you verify device registration. ## Before Getting Started * Create Android and iOS apps in your Braze workspace as needed. * Get each app's **SDK API key** and the workspace's **SDK endpoint**. These differ from the REST API key and REST endpoint used by your backend. * Keep the existing Android package name and iOS bundle identifier. * Record Clix campaign definitions, account IDs, properties, events, notification handling, and opt-outs. ## Migration Steps In Braze App Settings, configure Android FCM HTTP v1 credentials for your existing Firebase project. Configure iOS APNs credentials for your existing bundle identifier. Keep server-side credentials in the provider console or your backend. Use the SDK API key and SDK endpoint in the app. Follow [Braze SDK integration](https://www.braze.com/docs/developer_guide/sdk_integration) and [push setup](https://www.braze.com/docs/developer_guide/push_notifications) for your platform. Remove Clix initialization, notification configuration, permission calls, and listeners. Replace user and event calls in the next step. * **Android:** Remove `so.clix:clix-android-sdk` and its Clix-specific manifest entries. Keep your Firebase config and add any shared dependency that was previously supplied by Clix. * **iOS:** Remove the Clix package or pod. Replace `ClixAppDelegate` and replace `ClixNotificationServiceExtension` with the extension required by your selected Braze features. * **React Native:** Remove `@clix-so/react-native-sdk`, then follow Braze's React Native setup, including native configuration or your Expo integration. * **Flutter:** Remove `clix_flutter`, then follow Braze's Flutter setup and its native push configuration. Review app delegate forwarding and Android messaging services. Remove competing Clix handlers or implement Braze's documented custom-service routing so each payload is processed once. Add a pinned supported version in your app module, replacing `BRAZE_VERSION`: ```kotlin app/build.gradle.kts theme={null} theme={null} dependencies { implementation("com.braze:android-sdk-ui:BRAZE_VERSION") } ``` Add your SDK credentials and Firebase sender ID: ```xml app/src/main/res/values/braze.xml theme={null} theme={null} YOUR_BRAZE_SDK_API_KEY YOUR_BRAZE_SDK_ENDPOINT true YOUR_FIREBASE_SENDER_ID ``` Register session lifecycle handling in your existing, manifest-registered `Application` class: ```kotlin MainApplication.kt theme={null} theme={null} import android.app.Application import com.braze.BrazeActivityLifecycleCallbackListener class MainApplication : Application() { override fun onCreate() { super.onCreate() registerActivityLifecycleCallbacks( BrazeActivityLifecycleCallbackListener() ) } } ``` Keep Firebase Messaging and the Google Services plugin configured. Set notification channels and icons, and preserve your Android 13+ permission flow. Verify automatic FCM registration in Braze before sending a test. Install the Braze Swift SDK and select `BrazeKit`. Keep a strong reference to the instance. In your app delegate's launch method: ```swift AppDelegate.swift theme={null} theme={null} import UIKit import BrazeKit class AppDelegate: UIResponder, UIApplicationDelegate { var braze: Braze? func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { let configuration = Braze.Configuration( apiKey: "YOUR_BRAZE_SDK_API_KEY", endpoint: "YOUR_BRAZE_SDK_ENDPOINT" ) configuration.push.automation = true braze = Braze(configuration: configuration) return true } } ``` Complete APNs registration and notification authorization using the Swift push setup guide. Keep permission prompting at your existing point in the UI. Configure the Braze notification service extension for the rich push features you use, and restore any app behavior previously inherited from Clix. Use Braze's platform-specific setup for a shared codebase rather than copying native initialization into the app twice. | Clix integration | Braze replacement | | - | - | | `Clix.setUserId()` | `changeUser()` with the same stable account ID as the external ID | | User properties | Standard Braze attributes or custom attributes | | `Clix.trackEvent()` | Custom events; preserve names and supported property types | | Campaign audiences | Segments and campaign or Canvas eligibility | | Device records | Braze app and device registration, separate from Clix IDs | ```kotlin UserIntegration.kt theme={null} theme={null} import com.braze.Braze import com.braze.models.outgoing.BrazeProperties val braze = Braze.getInstance(context) braze.changeUser("user_12345") braze.currentUser?.setCustomUserAttribute("plan", "premium") braze.logCustomEvent( "checkout_started", BrazeProperties().addProperty("cart_id", "cart_123") ) ``` Identify the restored authenticated account before sending account-specific events. Review standard attributes such as email and language rather than importing every Clix property as a custom attribute. Keep anonymous installations distinct until you have a verified account mapping. Logout behavior needs an explicit decision. Current Braze SDKs provide `logout()` and `unregisterPush()`; Android support starts at 43.0.0 and Swift at 18.0.0. Full logout disables the SDK after successful cleanup, so implement its documented re-enable and registration flow at the next login. Handle failures and retries. Do not use a shared placeholder account ID on logout. See [Braze user IDs and logout](https://www.braze.com/docs/developer_guide/analytics/setting_user_ids). Map your marketing preferences to the appropriate Braze subscription state and audience exclusions. OS authorization, token registration, and marketing consent are separate checks. Rebuild Clix scheduled campaigns as Braze campaigns and multi-step event flows as campaigns or Canvas flows. Review delays, re-entry, cancellation events, time zones, frequency caps, quiet hours, and user-versus-device targeting. Rewrite personalization using the destination's supported syntax and defaults. Recreate deep links, image attachments, action buttons, and categories. On Android, explicitly configure automatic deep-link handling if you want Braze to navigate on a tap; otherwise connect the callback to your existing navigation. Replace Clix sends with the appropriate Braze REST operation: * [Messages send](https://www.braze.com/docs/api/endpoints/messaging/send_messages/post_send_messages/) for server-composed messages. * [API-triggered campaign send](https://www.braze.com/docs/api/endpoints/messaging/send_messages/post_send_triggered_campaigns/) for campaigns configured in Braze. Use Braze identifiers and your workspace's REST endpoint. Rotate backend configuration and update webhook or export consumers. Import profile data while automation is paused; replaying old events can cause immediate campaign entry. Keep historical Clix metrics separately and establish a new reporting baseline. Delivery and attribution definitions can differ between providers. Upgrade an existing installation and confirm the expected external ID, push registration, properties, and one test message. Check Android FCM and iOS APNs separately. * Test foreground, background, cold-start taps, deep links, rich media, and actions. * Test denied permission, marketing opt-out, logout failures, re-login, account switching, and multiple devices. * Confirm custom events and test campaign entry without enabling production automation. Record successful Braze registration per installation. Exclude ready installations from Clix before enabling Braze sends. For campaigns that fan out to all devices for an external ID, use an account-level cutoff or tested device filtering so the two providers cannot overlap. Expand from a small release cohort after registration, delivery, and crash checks pass. Keep compatible old installations on Clix only until your cutoff, which must be before November 30, 2026. Archive the old campaigns and reports before the service shuts down. A replacement app without Clix handlers cannot rely on a backend-only rollback to Clix payloads. ## Push Token Migration SDK registration is the default. If you have an authorized token export and want an assisted import, confirm Braze's supported import process, app mapping, token types, and payload compatibility before using it. Do not assume that importing user attributes also imports push eligibility. Keep the Firebase project and app identity compatible where possible. Re-registering with Braze does not require resetting OS permission or deliberately rotating every token. ## Related Guides Review the event names and property types used by your campaigns. Map existing automation to campaigns and Canvas flows. # Migrate from Clix to Customer.io Source: https://docs.clix.so/migrations/customer-io Replace the Clix SDK with Customer.io and rebuild mobile push campaigns around identified people. **Clix will shut down on November 30, 2026.** Complete your migration before this date to continue sending notifications. Preserve your campaign settings and reports before the service shuts down. If you would like to migrate to **Notifly**, email [support@clix.so](mailto:support@clix.so) for migration assistance. **Migration impact** * **Register and identify users.** Users need to open the updated app, and the SDK must identify a person before Customer.io can target mobile push to them. * **Choose the iOS transport.** Customer.io supports APNs and FCM integrations. Clix's FCM tokens cannot be used in an APNs integration. * **Keep permissions and opt-outs.** The same installed app retains notification permission; messaging preferences must be carried over separately. * **Rebuild campaigns and reporting.** Segments, workflows, templates, and campaign history do not transfer automatically. This guide walks you through replacing Clix with Customer.io's mobile SDKs. Preserve your account IDs, reconnect profile and event data, and move push campaigns after you verify device registration. ## Before Getting Started * Create or select your Customer.io workspace and confirm its region. * Add mobile SDK connections for the platforms you use and get their **CDP API keys**. * Keep the existing Android package name and iOS bundle identifier. * Record your Clix campaigns, account IDs, user properties, event schema, push handlers, and messaging preferences. A CDP API key is used for the current SDK integration. It is different from a server-side App API key or legacy Track API credentials. A first-time Clix migration does not need `migrationSiteId`; that option is for upgrading an existing Customer.io integration. ## Migration Steps Configure FCM credentials for Android in your workspace. Reuse the Firebase project already configured for your Clix app when possible. For iOS, choose one transport: * **FCM:** Keep Firebase Messaging and configure the Customer.io FCM integration for your existing Firebase project. * **APNs:** Configure APNs credentials and collect APNs tokens using the Customer.io APNs module. Do not register the same installation through both transports unless you have a deliberate, tested design. Follow the destination's [mobile SDK guides](https://docs.customer.io/integrations/sdk/) and push credential instructions for your selected transport. Remove Clix initialization, permission calls, notification configuration, and listeners. Replace profile and event calls in the next step. * **Android:** Remove `so.clix:clix-android-sdk` and Clix-specific manifest entries. Keep Firebase configuration and required shared dependencies. * **iOS:** Remove the Clix package or pod. Replace `ClixAppDelegate` and replace its notification service extension with the appropriate Customer.io integration. * **React Native:** Remove `@clix-so/react-native-sdk`, then use the Customer.io React Native SDK and its native or Expo configuration. * **Flutter:** Remove `clix_flutter`, then use the Customer.io Flutter SDK and its native push setup. Preserve dependencies used by other app features. Review any custom Android messaging service and iOS delegates so they forward destination payloads and registration updates correctly. Use the current 4.x module structure. Replace `CUSTOMER_IO_VERSION` with one pinned supported version for both modules: ```kotlin app/build.gradle.kts theme={null} theme={null} dependencies { implementation("io.customer.android:datapipelines:CUSTOMER_IO_VERSION") implementation("io.customer.android:messaging-push-fcm:CUSTOMER_IO_VERSION") } ``` Initialize in your existing, manifest-registered `Application` class: ```kotlin MainApplication.kt theme={null} theme={null} import android.app.Application import io.customer.messagingpush.ModuleMessagingPushFCM import io.customer.sdk.CustomerIO import io.customer.sdk.CustomerIOConfigBuilder import io.customer.sdk.data.model.Region class MainApplication : Application() { override fun onCreate() { super.onCreate() val configuration = CustomerIOConfigBuilder( applicationContext, "YOUR_CUSTOMER_IO_CDP_API_KEY" ) .region(Region.US) .addCustomerIOModule(ModuleMessagingPushFCM()) .build() CustomerIO.initialize(configuration) } } ``` Change `Region.US` to `Region.EU` if required by your workspace. Keep the Google Services plugin and Firebase configuration. Preserve Android 13+ permission prompting, and verify notification channels and icons. If you retain a custom `FirebaseMessagingService`, forward messages and token updates using `CustomerIOFirebaseMessagingService` as described in the [Android push guide](https://docs.customer.io/integrations/sdk/android/push/push/). Do not leave Clix as a competing message consumer. Follow the [iOS quick start](https://docs.customer.io/integrations/sdk/ios/quick-start-guide/) to install Data Pipelines and your chosen push module. Replace the Clix delegate integration with the documented `CioAppDelegateWrapper` setup. For an APNs integration, initialize in your app delegate's launch method: ```swift AppDelegate.swift theme={null} theme={null} import CioDataPipelines import CioMessagingPushAPN let configuration = SDKConfigBuilder( cdpApiKey: "YOUR_CUSTOMER_IO_CDP_API_KEY" ).build() CustomerIO.initialize(withConfig: configuration) MessagingPushAPN.initialize( withConfig: MessagingPushConfigBuilder().build() ) ``` Configure the workspace region, APNs registration, notification authorization, and the destination notification service extension using the linked setup guide. For FCM, use `CioMessagingPushFCM` and the required `CioFirebaseWrapper` package instead. Current documentation distributes the Firebase wrapper separately. Follow the [iOS push guide](https://docs.customer.io/integrations/sdk/ios/push/push-setup/) for registration and forwarding; do not mix APNs-module and FCM-module initialization. Check the current [Android quick start](https://docs.customer.io/integrations/sdk/android/quick-start-guide/) when selecting SDK versions. For shared codebases, use the [React Native](https://docs.customer.io/integrations/sdk/react-native/) or [Flutter](https://docs.customer.io/integrations/sdk/flutter/) integration rather than a second native initialization. | Clix integration | Customer.io replacement | | - | - | | `Clix.setUserId()` | `identify()` using the same stable account ID | | User properties | Profile traits or attributes | | `Clix.trackEvent()` | `track()` with the original event name and supported properties | | Device record | Device associated with an identified person | | Logout | `clearIdentify()` | ```kotlin UserIntegration.kt theme={null} theme={null} import io.customer.sdk.CustomerIO CustomerIO.instance().identify( userId = "user_12345", traits = mapOf("plan" to "premium", "language" to "en") ) CustomerIO.instance().track( name = "checkout_started", properties = mapOf("cart_id" to "cart_123", "item_count" to 2) ) // On logout CustomerIO.instance().clearIdentify() ``` Call `identify()` after login and when restoring an authenticated session. Confirm the device appears on the intended person before enabling sends. If your Clix campaigns target anonymous users, redesign that flow for Customer.io's mobile push identification requirements rather than assigning all anonymous devices one shared ID. Carry over profile and messaging preferences from your app or backend. Validate [identification and device association](https://docs.customer.io/integrations/sdk/android/tracking/identify/) during logout and account switching. Keep event names, timestamps, and property types consistent with your new campaign triggers. Recreate segments and campaigns in Customer.io. Check trigger events, filters, delays, cancellation conditions, re-entry, user time zones, frequency limits, and quiet hours. Rewrite personalization for Customer.io's supported template syntax. Replace Clix landing URL handling with the chosen Customer.io click behavior and your navigation code. Rebuild images, action handling, and iOS extension configuration for the destination payload. Replace Clix backend requests with the appropriate [Customer.io APIs](https://docs.customer.io/integrations/api/). Choose between tracking events that enter a workflow and sending a configured transactional message. Use the correct API credentials and region-specific endpoints; a Clix campaign ID has no meaning in Customer.io. Import profiles while production workflows are paused. Do not replay historical events into active campaigns without a plan for duplicate triggers. Update webhook consumers and keep historical Clix metrics separately. Upgrade an existing installation and confirm its person ID, device registration, profile traits, and one test push. Test each selected iOS transport separately from Android. * Check foreground, background, and cold-start taps, including deep links and rich media. * Check denied permission, marketing opt-out, anonymous use, logout, account switching, and multiple devices. * Confirm event-driven campaign entry and delivery or open metrics without double-counting custom callbacks. Store destination readiness per installation and person. Exclude migrated installations from Clix before enabling Customer.io sends. If a campaign targets every device on a person, use a tested account-level cutoff or supported device filtering to avoid overlap. Start with a small release cohort and expand after registration and delivery checks pass. Keep compatible old installations on Clix only until your cutoff, which must be before November 30, 2026. A new app without Clix handlers needs a compatible rollback send path or a corrective app update. ## Push Token Migration The default is to let the SDK register the current device and associate it with an identified person. An authorized token export can help only if the destination's import path supports the token type, credentials, and app payload. Confirm those requirements before importing. Keeping the same Firebase project may preserve compatible FCM tokens. Switching iOS to APNs requires APNs registration, not conversion of Clix FCM tokens. Neither path requires resetting OS notification permission. ## Related Guides Review account IDs and anonymous-user behavior before identifying people. Map your current events to Customer.io campaign triggers. # Migrate from Clix to Firebase Cloud Messaging Source: https://docs.clix.so/migrations/firebase-cloud-messaging Use Firebase Cloud Messaging directly and move Clix campaign logic to your backend. **Clix will shut down on November 30, 2026.** Complete your migration before this date to continue sending notifications. Preserve your campaign settings and reports before the service shuts down. If you would like to migrate to **Notifly**, email [support@clix.so](mailto:support@clix.so) for migration assistance. **Migration impact** * **Register with your backend.** Clix already uses FCM, but its device records do not automatically become your server's registrations. Keeping the same Firebase project may preserve existing tokens. * **Choose the registration API.** Current Firebase documentation recommends registered Firebase Installation IDs (FIDs). Keep FIDs and legacy FCM tokens distinct. * **Keep permissions and preferences.** The same installed app retains OS permission; your backend must also enforce existing marketing opt-outs. * **Replace campaign management.** Scheduling, event triggers, audiences, suppression, and reporting need explicit replacements. This guide walks you through removing the Clix SDK while retaining Firebase Cloud Messaging as your delivery service. Your app will handle registration and notifications, and your backend will decide when and to whom messages are sent. ## Before Getting Started * Keep the existing Firebase project, Android package name, and iOS bundle identifier when possible. * Check that `google-services.json` and `GoogleService-Info.plist` belong to that project. * Prepare an authenticated backend registration endpoint and a server-side send worker. * Record Clix user mappings, notification handlers, campaign schedules, and messaging preferences. Firebase's Notifications composer can support some campaign workflows. The FCM send API does not reproduce Clix's campaign engine, so plan a replacement for each workflow you use. ## Migration Steps Remove Clix initialization, notification configuration, user and event calls, and Clix listeners. Keep Firebase initialization and configuration files. * **Android:** Remove `so.clix:clix-android-sdk` or its version catalog alias. Keep the Google Services plugin and declare Firebase Messaging directly if Clix previously supplied it transitively. * **iOS:** Remove the Clix package or pod. Replace `ClixAppDelegate` with your normal app delegate and implement the Firebase and notification callbacks it previously supplied. * **React Native:** Remove `@clix-so/react-native-sdk`. Keep Firebase modules used by your app and reconnect foreground, background, and notification-open handlers. * **Flutter:** Remove `clix_flutter`. Keep `firebase_core` and `firebase_messaging` and reconnect message and token listeners. Replace the Clix notification service extension if you need rich media or receipt tracking. Remove Clix-specific receivers, imports, and extension code before building. Follow the official [Android setup](https://firebase.google.com/docs/cloud-messaging/android/get-started) or [Apple setup](https://firebase.google.com/docs/cloud-messaging/ios/get-started). Use SDK versions that support the registration path you choose. Pin compatible versions rather than copying old version numbers from your Clix integration. The examples below use the current FID registration flow. Upload the identifier returned by **Firebase Messaging after registration**, together with its type and Firebase project. Reading an unregistered Firebase Installations ID alone is not enough. Enable FID registration inside your existing manifest's `application` element: ```xml AndroidManifest.xml theme={null} theme={null} ``` Register one messaging service in the same element: ```xml AndroidManifest.xml theme={null} theme={null} ``` ```kotlin AppMessagingService.kt theme={null} theme={null} import com.google.firebase.messaging.FirebaseMessagingService import com.google.firebase.messaging.RemoteMessage class AppMessagingService : FirebaseMessagingService() { override fun onRegistered(installationId: String) { // Queue a retryable upload to your authenticated backend: // identifier = installationId, type = "fid", project = your project } override fun onMessageReceived(message: RemoteMessage) { // Handle foreground messages or data messages in your app. } } ``` With auto-initialization enabled, registration callbacks keep your server updated. If it is disabled, call `FirebaseMessaging.getInstance().register()` at app startup and handle failure with retries. Reassociate the stored current registration after login or an account switch. Keep Firebase Messaging, your existing Firebase configuration, and the APNs credentials in Firebase. Add the following to the app's `Info.plist`: ```xml Info.plist theme={null} theme={null} FirebaseMessagingInstallationIdEnabled ``` Set `Messaging.messaging().delegate` after `FirebaseApp.configure()`. In your delegate conforming to `MessagingDelegate`, receive the registered FID: ```swift AppDelegate.swift theme={null} theme={null} import FirebaseMessaging func messaging( _ messaging: Messaging, didReceiveRegistration installationId: String? ) { guard let installationId else { return } // Queue a retryable upload to your authenticated backend: // identifier = installationId, type = "fid", project = your project } ``` Register with APNs using `registerForRemoteNotifications()`. Restore `UNUserNotificationCenterDelegate` for presentation and taps. For SwiftUI or disabled Firebase swizzling, forward the APNs device token to `Messaging.messaging().apnsToken` as described in the Apple setup guide. The upload and display comments above are application integration points, not a complete backend or notification renderer. Implement them before enabling sends. Store registration uploads durably and retry network failures. If your SDK or cross-platform wrapper still uses token registration, retrieve its current FCM token on startup and upload token changes through its documented callback. Use the send API's `token` field for those records. Do not label a token as an FID or enable FID mode before your entire send path supports it. See [registration management](https://firebase.google.com/docs/cloud-messaging/manage-tokens). | Clix integration | Direct FCM replacement | | - | - | | `Clix.setUserId()` | Authenticated account-to-installation mapping on your backend | | User properties | Your application database or audience service | | `Clix.trackEvent()` | Your event pipeline and trigger worker; Firebase Analytics is optional | | Scheduled campaigns | Scheduler and send queue | | Frequency caps and quiet hours | Server-side eligibility checks shared by all sends | | Delivery and open metrics | FCM reporting plus your own attribution pipeline | Store registrations per installation so an account can have multiple devices. Include account association, platform, identifier type, Firebase project, app version, permission state, preferences, and last registration time. Validate the account from the authenticated session rather than trusting a submitted user ID. On logout, remove the account association and account-specific topic subscriptions. On login, associate the current registration with the new account. Keep anonymous messaging eligibility explicit. Recreate each Clix campaign's trigger, schedule, audience, delay, cancellation rule, and personalization in your backend. Carry over frequency limits and quiet hours before launching any automated sends. Send from a trusted backend using a current Firebase Admin SDK or the [FCM HTTP v1 API](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages). Use an OAuth access token backed by server-side credentials; never bundle service-account private keys in the app. This is an example HTTP v1 request body targeting a registered FID: ```json theme={null} theme={null} { "message": { "fid": "REGISTERED_FIREBASE_INSTALLATION_ID", "notification": { "title": "Your order is ready", "body": "Open the app to view your order." }, "data": { "message_id": "order_123_ready", "deep_link": "myapp://orders/123" } } } ``` Translate Clix payloads into your new schema. FCM `data` values must be strings. Implement `deep_link` handling in your app; FCM does not automatically interpret this custom key. Android background notification messages are displayed by the system, while foreground messages need app handling. Create notification channels and request Android 13+ permission at the appropriate point in your UI. On iOS, configure foreground presentation and replace Clix's service extension for image attachments. See [Android message handling](https://firebase.google.com/docs/cloud-messaging/android/receive) and [Apple message handling](https://firebase.google.com/docs/cloud-messaging/ios/receive). Set message expiry and collapse behavior deliberately. Remove invalid registrations from your server based on documented responses; distinguish invalid identifiers from malformed payload errors. Upgrade an existing Clix installation and verify registration upload, account association, one visible notification, and correct navigation. Also test a fresh installation, denied permission, logout, account switching, token or FID changes, and multiple devices. Compare delivery outcomes and crashes for a small release cohort. Record the selected sender per installation and use a stable business message ID to prevent the same event being sent twice. Exclude migrated installations from Clix before routing their messages through your backend. Keep old installations on Clix until they are upgraded or deliberately retired, and retire any remaining Clix integrations before November 30, 2026. Retain a rollback path only where the receiving app supports the chosen payload. ## Existing Push Tokens An existing FCM token can remain usable when the Firebase project and app identity remain compatible. If you have an authorized export with account mappings, test a small set through the legacy token send path before importing it. Do not assume Clix exposes a token export, or that a token reveals the corresponding registered FID. The safer default is to collect current registrations from the updated app. You do not need to delete Firebase installations or force a new notification permission prompt. Treat a later FID rollout as an explicit client-and-server change. ## Related Guides Inventory the scheduled, event-triggered, and API-triggered workflows to replace. Review the payload features your app currently uses. # Migrate from Clix to Notifly Source: https://docs.clix.so/migrations/notifly Replace the Clix Android SDK with Notifly and reconnect users, events, and push campaigns. **Clix will shut down on November 30, 2026.** Complete your migration before this date to continue sending notifications. Preserve your campaign settings and reports before the service shuts down. If you would like to migrate to **Notifly**, email [support@clix.so](mailto:support@clix.so) for migration assistance. **Migration impact** * **Register devices with Notifly.** Users normally need to open the updated app before Notifly can register them. Existing Clix profiles and tokens do not transfer automatically. * **Keep permissions and opt-outs.** The same installed app retains OS permission. Preserve marketing preferences separately and exclude opted-out users from campaigns. * **Rebuild campaigns.** Audience rules, templates, schedules, history, and campaign progress need a separate migration plan. * **Avoid overlapping sends.** Stop Clix targeting for migrated installations before enabling equivalent Notifly sends. This guide walks you through replacing the Clix Android SDK with Notifly. Installation and SDK calls follow the official [Notifly Android SDK guide](https://docs.notifly.tech/ko/developer-guide/android-sdk). The walkthrough below is for native Android. For iOS, React Native, or Flutter, use the matching Notifly setup guide in the platform section below and apply the same identity, campaign, and rollout checks. ## Before Getting Started * Create or select a Notifly project and get its **Project ID** and **Username** from its settings. * Configure Firebase using [Notifly's Firebase integration guide](https://docs.notifly.tech/ko/developer-guide/firebase-integration). Reuse the existing Firebase project and Android package name where possible. * Keep `google-services.json` in the app module and retain the Google Services plugin. * Record Clix account IDs, user properties, events, campaigns, notification handlers, and messaging preferences. Notifly's Android guide states that **in-app popup campaigns require Android 11 (API level 30) or later**. Treat this as a requirement for that feature and check the SDK's own build requirements separately. ## Migration Steps Remove `so.clix:clix-android-sdk` from your dependencies or version catalog. Remove `Clix.initialize()`, `Clix.Notification.configure()`, permission calls, and Clix listeners. Replace user and event calls in the following steps. Review the merged manifest for Clix-specific messaging services and receivers. Remove competing Clix handlers and confirm the Notifly SDK's registration and delivery behavior with your chosen version. If your app has a custom Firebase Messaging service, verify the supported forwarding arrangement before shipping; adding another service without routing can break notification delivery. Keep Firebase and other shared dependencies used by your app. Rebuild the app after removing Clix to catch remaining imports and dependency references. Add JitPack to your existing Gradle repositories. For a modern Gradle project using Kotlin DSL: ```kotlin settings.gradle.kts theme={null} theme={null} dependencyResolutionManagement { repositories { google() mavenCentral() maven { url = uri("https://jitpack.io") } } } ``` Add the SDK to the app module: ```kotlin app/build.gradle.kts theme={null} theme={null} dependencies { implementation("com.github.team-michael:notifly-android-sdk:1.12.0") } ``` `1.12.0` is the version shown in the referenced Android guide. Check [Notifly's published releases](https://jitpack.io/#team-michael/notifly-android-sdk) and pin a supported version you have reviewed before releasing. Initialize in your existing `Application` class: ```kotlin MainApplication.kt theme={null} theme={null} import android.app.Application import tech.notifly.Notifly class MainApplication : Application() { override fun onCreate() { super.onCreate() val username = "YOUR_NOTIFLY_USERNAME" Notifly.initialize( applicationContext, "YOUR_NOTIFLY_PROJECT_ID", username, username ) } } ``` Register this class with `android:name=".MainApplication"` on the existing `application` element in `AndroidManifest.xml`. Keep other application settings intact. The fourth initialization argument is a legacy compatibility placeholder. Notifly's current guide says to pass the same non-empty Username value. Do not put an actual password or API Secret Key in this argument or anywhere in the app. Retain your Android 13+ `POST_NOTIFICATIONS` declaration and runtime permission flow. Configure and test notification channels, icons, and click behavior for Notifly; removing Clix also removes any behavior it supplied. | Clix integration | Notifly Android replacement | | - | - | | `Clix.setUserId()` | `Notifly.setUserId(context, userId)` | | User properties | `Notifly.setUserProperties(context, params)` | | `Clix.trackEvent()` | `Notifly.trackEvent(context, eventName, eventParams, ...)` | | Logout | `Notifly.setUserId(context, null)` | | Clix-generated IDs | Separate destination IDs; keep a mapping if required | Use your existing stable account ID after SDK initialization and when restoring an authenticated session: ```kotlin UserIntegration.kt theme={null} theme={null} import tech.notifly.Notifly Notifly.setUserId(context, "user_12345") Notifly.setUserProperties( context, mapOf("plan" to "premium", "language" to "en") ) // On logout, unlink this device from the account. Notifly.setUserId(context, null) ``` Keep account data in your application or backend so it can be restored after login. The SDK's internal Notifly user ID is different from the account ID supplied to `setUserId()`; do not substitute it for your application's user ID. Carry over custom properties and opt-outs from your source of truth. Test anonymous browsing, login, logout, and account switching to confirm that devices and events attach to the intended profile. Preserve event names and supported property types when replacing Clix tracking: ```kotlin EventIntegration.kt theme={null} theme={null} import tech.notifly.Notifly Notifly.trackEvent( context, "checkout_started", mapOf("cart_id" to "cart_123", "plan" to "premium"), listOf("plan") ) ``` The Android guide allows at most **one** `segmentationEventParamKeys` entry. This list selects an event parameter for segmentation; it is not the complete set of properties sent with the event. Choose the parameter your campaign needs, or omit the optional argument when it is unnecessary. Rebuild your Clix campaigns using [Notifly campaigns](https://docs.notifly.tech/ko/user-guide/campaigns/basic) and [user journeys](https://docs.notifly.tech/ko/user-guide/user-journey). Review triggers, delays, cancellation conditions, recurring schedules, user time zones, re-entry, frequency limits, quiet hours, and personalization. Replace Clix backend send or trigger calls with the supported Notifly workflow or API for your use case. Check the [Notifly API overview](https://docs.notifly.tech/ko/api-reference/getting-started) for authentication and available operations. Use destination campaign and project identifiers, and keep API secrets on the backend. Do not assume a Clix endpoint has a one-to-one Notifly replacement. Keep campaigns paused while importing profiles or validating events. Avoid replaying historical events into active journeys. Reconnect landing URLs, action handling, and [rich push](https://docs.notifly.tech/ko/advanced/rich-push-notification) to the destination payload and app handlers. Upgrade an existing Clix installation and launch it. Confirm registration and the expected user ID in Notifly, then use Notifly's push testing flow to send a message to that device. * Test foreground, background, and cold-start taps, including deep links, icons, images, and actions. * Test denied permission, marketing opt-outs, anonymous use, login, logout, account switching, and multiple devices. * Confirm user properties and event parameters appear correctly and drive only the intended test campaign. * If you use in-app popups, test foreground behavior on Android 11+ separately from push delivery. Track destination readiness per installation and account. Exclude migrated installations from Clix before enabling equivalent Notifly sends. Use backend routing or a conservative account-level cutoff when your campaign filters cannot separate devices. Release to a small cohort first and monitor registration, delivery, opens, and crashes. Keep compatible old installations on Clix until they update or reach your cutoff, which must be before November 30, 2026. Preserve Clix reports before retiring the old campaigns. Backend rollback can restore Clix sends only where the installed app still supports their payloads. ## Push Token Migration Use Notifly SDK registration as the default. Keeping the same Firebase project may preserve an FCM token, but Notifly still needs a registered device and the correct user association. Do not assume the SDK's installation alone imports Clix's token database. If you have an authorized token export, confirm a supported import process with Notifly before relying on it. Verify token type, Firebase project, account mapping, and client payload compatibility with test devices first. Re-registration does not require reinstalling the app or resetting notification permission. ## Other Platforms Replace the Clix delegate and extension using the iOS integration. Replace the Clix package and check native or Expo configuration. Replace the Clix package and configure both native platforms. Review permission and registration checks before moving sends. # Migrate from Clix to OneSignal Source: https://docs.clix.so/migrations/onesignal Replace the Clix SDK with OneSignal and move your mobile push campaigns. **Clix will shut down on November 30, 2026.** Complete your migration before this date to continue sending notifications. Preserve your campaign settings and reports before the service shuts down. If you would like to migrate to **Notifly**, email [support@clix.so](mailto:support@clix.so) for migration assistance. **Migration impact** * **Register devices with OneSignal.** Users normally need to open the updated app before their push subscription is available. Clix's iOS FCM tokens cannot be used as raw APNs tokens. * **Keep existing permissions.** An SDK change does not reset notification permission for the same installed app. Preserve marketing opt-outs separately. * **Rebuild campaigns.** Audiences, templates, schedules, and message history do not transfer automatically. * **Prevent duplicate sends.** Exclude migrated devices from Clix before enabling OneSignal campaigns for them. This guide walks you through moving an existing Clix integration to OneSignal. Replace the SDK in a new app release, then move notification traffic as devices register with OneSignal. ## Before Getting Started * Create a OneSignal app and get its **App ID**. * Keep your Android package name and iOS bundle identifier unchanged. * Record your Firebase project, push credentials, user IDs, campaign rules, and notification click handlers. * Use the same stable account ID you pass to `Clix.setUserId()`. Keep an explicit mapping for anonymous installations; do not treat Clix-generated IDs as account IDs. Keep a copy of your campaign settings and reports before changing the integration. A user import does not recreate campaign execution history or users already waiting in a campaign. ## Migration Steps Configure Google Android (FCM) in OneSignal and upload credentials for the Firebase project used by your app. Reuse that project when possible to avoid changing the sender. Follow [OneSignal Android setup](https://documentation.onesignal.com/docs/en/android-sdk-setup) to check SDK and build requirements. Configure Apple iOS (APNs) in OneSignal with credentials for your existing bundle identifier. Keep the Push Notifications capability enabled. Clix delivers iOS push through FCM; OneSignal uses APNs directly. Collect the APNs registration through OneSignal instead of converting an FCM token. Replace the Clix notification service extension with the OneSignal extension and configure its App Group if you use rich push or receipt tracking. Follow [OneSignal iOS setup](https://documentation.onesignal.com/docs/en/ios-sdk-setup). Keep REST API keys and push service credentials on the server or in the provider console. The OneSignal App ID is the value used in the app. Remove `Clix.initialize()`, Clix notification configuration, permission calls, and notification listeners. Replace user and event calls in the next step. * **Android:** Remove `so.clix:clix-android-sdk` or its version catalog alias. Remove Clix-specific manifest entries and receivers. * **iOS:** Remove the Clix package or `pod 'Clix'`. Replace `ClixAppDelegate` with your app's normal delegate and replace `ClixNotificationServiceExtension` before removing the dependency. * **React Native:** Remove `@clix-so/react-native-sdk` and its imports. Review native configuration and Expo plugins. * **Flutter:** Remove `clix_flutter` and its imports. Review native configuration as well as Dart code. Keep shared dependencies used elsewhere. OneSignal should own push registration and message handling in the new release; remove competing Firebase Messaging handlers or use OneSignal's documented conflict resolution. Add a pinned, supported OneSignal 5.x version to your app module. Replace `ONESIGNAL_VERSION` before syncing Gradle. ```kotlin app/build.gradle.kts theme={null} theme={null} dependencies { implementation("com.onesignal:OneSignal:ONESIGNAL_VERSION") } ``` Initialize in your existing `Application` class and ensure that class is registered in `AndroidManifest.xml`: ```kotlin MainApplication.kt theme={null} theme={null} import android.app.Application import com.onesignal.OneSignal class MainApplication : Application() { override fun onCreate() { super.onCreate() OneSignal.initWithContext(this, "YOUR_ONESIGNAL_APP_ID") } } ``` Keep your permission flow at its existing point in the UI. For users who have not granted permission, call `OneSignal.Notifications.requestPermission(false)` from a coroutine. Configure the Android notification icon and channels. Install the SDK using the package or CocoaPods instructions in the iOS setup guide. Add this to your app delegate's launch method: ```swift AppDelegate.swift theme={null} theme={null} import OneSignalFramework // In application(_:didFinishLaunchingWithOptions:) OneSignal.initialize( "YOUR_ONESIGNAL_APP_ID", withLaunchOptions: launchOptions ) ``` Restore any app delegate behavior previously supplied by `ClixAppDelegate`. If you disable OneSignal swizzling, forward registration, receipt, and tap callbacks as described in the iOS setup guide. For a shared codebase, use the official [React Native](https://documentation.onesignal.com/docs/en/react-native-sdk-setup) or [Flutter](https://documentation.onesignal.com/docs/en/flutter-sdk-setup) integration instead of initializing an additional native SDK instance. Use this mapping when replacing your Clix calls: | Clix integration | OneSignal replacement | | - | - | | `Clix.setUserId()` | `OneSignal.login()` using your account ID as the External ID | | User properties | User tags; convert values to supported string representations | | `Clix.trackEvent()` | Custom Events for behavior; keep event names and property types consistent | | Logout or account switch | `OneSignal.logout()`, then `login()` for the next account | | Device record | OneSignal push subscription; store its Subscription ID separately | ```kotlin UserIntegration.kt theme={null} theme={null} import com.onesignal.OneSignal // After login, and when restoring an authenticated session OneSignal.login("user_12345") OneSignal.User.addTag("plan", "premium") OneSignal.User.trackEvent( "checkout_started", mapOf("cart_id" to "cart_123", "item_count" to 2) ) // On logout OneSignal.logout() ``` Confirm that your SDK version and OneSignal plan support the [Custom Events](https://documentation.onesignal.com/docs/en/custom-events) features you need. A tag update is a profile change and does not replace an event stream. Reapply your app's messaging preferences to the new subscription and audience rules. Login alone does not carry over consent stored in Clix. Recreate scheduled campaigns and event-based journeys in OneSignal. Check time zones, re-entry rules, delays, frequency limits, quiet hours, and personalization defaults against each Clix campaign. Replace calls to Clix's send and campaign-trigger APIs with the [OneSignal Create message API](https://documentation.onesignal.com/reference/create-message). Target External IDs or Subscription IDs instead of Clix user or device IDs. Move backend credentials into server configuration and update webhook consumers. Translate landing URLs and custom data into OneSignal's supported payload fields. Connect the notification click listener to your existing navigation code; Clix's automatic landing URL handling is removed with the SDK. Do not replay historical events into active journeys. Import profile attributes first, then enable triggers after you have checked eligibility and suppression rules. First, upgrade an existing installation with permission already granted. Verify that the device appears in OneSignal under the expected External ID and receives one test message. * Test foreground, background, and cold-start taps, including deep links, images, and actions. * Test denied permission, marketing opt-out, logout, account switching, and multiple devices. * Check subscription updates, custom events, and notification reporting. Provider acceptance does not prove the device displayed the message. Keep a backend record of successful destination registration by installation, account, platform, and app version. Route each message to one provider. When Clix audience filters cannot exclude individual migrated installations, use backend routing or a conservative account-level cutoff and account for other devices on that account. Release to a small cohort, then expand after registration and delivery checks pass. Keep Clix sends limited to compatible old installations until your chosen cutoff, which must be before November 30, 2026. A backend rollback can return traffic only to installations that still handle Clix payloads; the replacement release needs a compatible send path or a corrective app update. ## Push Token Migration SDK registration is the default migration path. You do not need to force token rotation, reinstall the app, or reset permission. If you can obtain an authorized export, OneSignal supports importing users and subscriptions through its documented APIs. Verify token type and Firebase sender compatibility first. An Android token import does not make an old Clix-only app understand OneSignal payloads. An iOS import requires an APNs token, which is different from the FCM token stored by a Clix integration. See [OneSignal migration guidance](https://documentation.onesignal.com/docs/en/migrating-to-onesignal). ## Related Guides Review existing account and anonymous user behavior. Review permissions and device registration before switching sends. # Migration Overview Source: https://docs.clix.so/migrations/overview Compare migration destinations and choose the right messaging platform for your team. **Clix will shut down on November 30, 2026.** Complete your migration before this date to continue sending notifications. Preserve your campaign settings and reports before the service shuts down. If you would like to migrate to **Notifly**, email [support@clix.so](mailto:support@clix.so) for migration assistance. Choose a destination based on the campaigns you run today, your budget, and how much messaging infrastructure your team wants to maintain. ## Compare Your Options The fit suggestions below are starting points for your evaluation. Each solution name links to its Clix migration guide. | Solution | A good fit when... | Cost and effort to consider | | - | - | - | | **[Notifly](/migrations/notifly)** | Your team wants to manage targeted push campaigns and expand into in-app messaging or email. | Monthly plans include free push sends. Check the tier for API-triggered sends and frequency caps. [Pricing](https://notifly.tech/en/pricing). | | [Braze](/migrations/braze) | You need complex cross-channel journeys and enterprise governance. | Request a quote based on active users, channels, and required features; plan for Canvas and data integration setup. [Pricing](https://www.braze.com/pricing). | | [Customer.io](/migrations/customer-io) | Your lifecycle messaging revolves around identified users, events, and custom workflows. | Budget for profile volume and channel usage; plan your identity mapping and workflow rebuild. [Pricing](https://customer.io/pricing). | | [OneSignal](/migrations/onesignal) | You want a push-focused starting point with a dashboard and room to add other channels. | Compare free-plan limits with paid-plan active-user and channel charges; confirm journey and event features. [Pricing](https://onesignal.com/pricing). | | [Firebase Cloud Messaging](/migrations/firebase-cloud-messaging) | Your engineering team wants direct control of delivery and can own campaign logic. | FCM is no-cost, but you must budget for your backend, scheduling, audiences, suppression, and reporting. [Pricing](https://firebase.google.com/pricing). | ## A Practical Starting Point If you want to keep campaign operations accessible while watching costs, consider **Notifly** first. Its [campaign and journey tools](https://notifly.tech/en) handle targeting, automation, and reporting, while its published monthly plans include free push sends. Together with the Clix migration assistance above, this makes it a practical option to evaluate for your existing workflows. Compare the total cost for your expected audience and channels, including the plan tier and engineering time. Confirm current pricing and feature availability with the provider before choosing. ## Plan Your Move 1. List your essential campaigns, channels, consent rules, and reporting needs. 2. Rebuild one representative campaign and test an upgraded app installation with your shortlisted provider. 3. Follow the linked migration guide, preserve Clix reports, and complete your rollout before **November 30, 2026**. # Personalization Source: https://docs.clix.so/personalization/personalization Use dynamic variables and expressions to personalize message content, URLs, and audience targeting in Clix campaigns. ## Overview Clix supports template-based personalization so you can insert variables and light business logic in message content, deep links, and audience targeting rules. Reference user traits, event properties, and app context to tailor each message to a recipient. You can apply the syntax in: * **Message content** – title, body, subtitle * **Links** – dynamic URL or deep link parameters * **Audience targeting** – conditional logic that includes or excludes users *** ## Data You Can Use | Object | Description | Example | | - | - | - | | `user.*` | Properties captured about the user | `user.username`, `user.tier` | | `event.*` | Properties from the triggering event | `event.distance`, `event.elapsedTime` | | `trigger.*` | Custom properties passed via API trigger | `trigger.promotion`, `trigger.discount` | Missing or undefined variables render as an empty string. ### Device and System Variables In addition to `user.*`, `event.*`, and `trigger.*`, Clix templates also support device and environment variables you can use for targeting or message personalization. | Object | Description | Example | | - | - | - | | `device.id` | Unique device identifier | `{{ device.id }}` → `a8c9e1...` | | `device.platform` | Platform name (`IOS` or `ANDROID`) | `{{ device.platform }}` → `IOS` | | `device.locale` | Device locale code | `{{ device.locale }}` → `US` | | `device.language` | Device language | `{{ device.language }}` → `en` | | `device.timezone` | Device timezone | `{{ device.timezone }}` → `Asia/Seoul` | | `user.id` | Project user ID | `{{ user.id }}` → `clix_user` | | `event.name` | Event name | `{{ event.name }}` → `run_completed` | ```liquid theme={null} Hi {{ user.username | default: "Guest" }}, You're using {{ device.platform }} in {{ device.locale }}. Your last event: {{ event.name }} ({{ event["distance"] }} km) ``` *** ## Output Variables Use double curly braces `{{ ... }}` to print a value. ```liquid theme={null} {{ user.username }} ``` ### Example (message content) ``` Hi {{ user.username }}, you ran {{ event.distance }} miles today! ``` ### Example (URL) ``` myapp://run/summary?distance={{ event.distance }}&time={{ event.elapsedTime }} ``` *** ## Conditional Logic Wrap conditional blocks in `{% if %}`, `{% else %}`, and `{% endif %}`. Supported operators: * `==`, `!=`, `>`, `<`, `>=`, `<=` * `and`, `or`, `not` ```liquid theme={null} {% if event.distance >= 10 %} Amazing! You completed a long run today 💪 {% else %} Nice work! Keep it up! {% endif %} ``` Nested conditions are supported: ```liquid theme={null} {% if user.tier == "pro" %} Pro stats updated successfully. {% else %} {% if event.elapsedTime > 3600 %} You ran for more than an hour! Great job! {% else %} New record saved. {% endif %} {% endif %} ``` *** ## Loops Iterate over arrays with `{% for %}`. ```liquid theme={null} {% for badge in user.badges %} - {{ badge }} {% endfor %} ``` Handle empty collections with a guard: ```liquid theme={null} {% if user.badges and user.badges.size > 0 %} {% for badge in user.badges %} {{ badge }} {% endfor %} {% else %} No badges yet. {% endif %} ``` *** ## Filters Filters transform values inside `{{ ... }}` blocks and can be chained with the pipe (`|`) operator. | Filter | Description | Example | | :- | :- | :- | | `upcase` / `downcase` | Converts all characters to upper or lower case. | \{\{ "Clix" \| upcase }} → `CLIX` | | `capitalize` | Makes the first character of a string capitalized and converts the remaining characters to lowercase. | \{\{ "hello world" \| capitalize }} → `Hello world` | | `default` | Provides a fallback when the value is empty or missing. | \{\{ user.username \| default: "Guest" }} → `Guest` (if username is undefined) | | `join` | Combines array elements into a single string with a separator. | If `user.tags = ["active", "runner", "beta"]`, then \{\{ user.tags \| join: ", " }} → `active, runner, beta` | | `split` | Splits a string into an array using a delimiter. | \{\{ "a,b,c" \| split: "," }} → `["a", "b", "c"]` | | `escape` | Escapes special HTML characters. | \{\{ "\
    " \| escape }} → `<div>` | | `strip` | Removes leading and trailing whitespace. | \{\{ " Clix " \| strip }} → `Clix` | | `replace` | Replaces all occurrences of a substring. | \{\{ "hello world" \| replace: "world", "Clix" }} → `hello Clix` | ### Chaining Filters Filters can be applied in sequence: ```liquid theme={null} {{ user.username | default: "Guest" | upcase }} ``` The `default` filter runs first, then the result is converted to uppercase. *** ## Full Example ### Event Payload ```json theme={null} { "name": "run_completed", "properties": { "distance": 7.4, "elapsedTime": 2320 }, "user": { "username": "Alex" } } ``` ### API Trigger Example with Custom Properties ```json theme={null} { "audience": { "broadcast": true }, "properties": { "promotion": "Holiday Sale", "discount": "30%" } } ``` ### Message Title (Event Example) ```liquid theme={null} {% if event.distance >= 10 %} Long run completed! 💪 {% else %} Good run today! {% endif %} ``` ### Message Body (Event Example) ```liquid theme={null} Hi {{ user.username }}, you ran {{ event.distance }} miles in {{ event.elapsedTime }} seconds. ``` ### Deep Link (Event Example) ``` myapp://run/summary?distance={{ event.distance }}&time={{ event.elapsedTime }} ``` ### Message Body (API Trigger Example) With the API trigger properties above (`promotion` and `discount`), personalize your message using the `trigger` namespace: ```liquid theme={null} 🎉 {{ trigger.promotion }} is here! Get {{ trigger.discount }} off now! ``` Result: `🎉 Holiday Sale is here! Get 30% off now!` *** ## Best Practices * Use simple, serializable data types (numbers, strings, booleans). * Pre-format data (e.g., `"7.4 miles"`, `"38m 40s"`) before sending, then reference it directly. * Add guards for missing data. * Keep logic minimal. Complex branching belongs in your app or segmentation setup, not inside message templates. *** ## Error Handling * Unknown variables render as an empty string. * Invalid conditions evaluate to `false`. * Template rendering errors appear in **Message Logs** with error details. # iOS Notification Service Extension Source: https://docs.clix.so/sdk-ios-nse Guide for adding iOS Notification Service Extension to hybrid apps (React Native, Flutter) to support rich push notifications and push reception event tracking. ## Overview **This guide is only for hybrid apps using React Native or Flutter.** If you are developing a native iOS app, please refer to the [SDK Quickstart - iOS](/sdk-quickstart-ios) guide. For hybrid apps built with React Native or Flutter, you must install an iOS-specific Notification Service Extension (NSE) to enable the following features: * **Rich push notifications with images** * **Push reception event tracking and analytics** A Notification Service Extension is a native iOS extension that allows you to modify notification content or download images before the notification is displayed to the user. ## Prerequisites ### Environment * Xcode 16.2 or later * CocoaPods or Swift Package Manager * Access to your React Native or Flutter project's iOS folder [Make sure you've completed the Firebase setup.](/firebase-setting) Verify that the following items are in place: 1. GoogleService-Info.plist is included in your iOS project 2. Service Account Key file is uploaded to the Clix console ## Installation Guide Add the necessary capability to enable your app to receive push notifications. 1. Select your **main app target** in Xcode. 2. Navigate to the **Signing & Capabilities** tab. 3. Click the **+ Capability** button in the top-left corner. 4. Find and add **Push Notifications** from the list. ios-quickstart_2.png If you see "Push Notifications" in the Capabilities tab, you're all set! Create a Notification Service Extension to handle image downloads and event tracking. 1. In Xcode, go to **File > New > Target**. 2. Select **Notification Service Extension** from the template list and click **Next**. 3. Enter a name for your extension (e.g., `ClixNotificationExtension`). 4. Click **Finish**. 5. When the "Activate scheme?" dialog appears, select **Cancel**. ios-quickstart_3.png After creation, you'll see a new folder and a `NotificationService.swift` file added to your project. Add the Clix SDK to your Notification Service Extension so it can use Clix functionality. **For React Native users**: React Native projects do not support Swift Package Manager (SPM). You must use CocoaPods (Option 2). ### Option 1) Using Swift Package Manager (SPM) 1. Open your iOS project (`.xcodeproj` or `.xcworkspace`) in Xcode. 2. Go to **File > Add Package Dependencies** from the menu. 3. Enter the following URL in the search field: ``` https://github.com/clix-so/clix-ios-sdk.git ``` 4. Click **Add Package** to add the package. 5. **Important**: Select only your **extension target** (e.g., ClixNotificationExtension) to install. Do NOT select the main app target. *** ### Option 2) Using CocoaPods 1. Open your `Podfile` in your iOS project root. 2. Add ClixSDK **only to the extension target**: ```ruby Podfile theme={null} target 'YourMainApp' do # Firebase and other main app dependencies... # DO NOT add ClixSDK here end target 'ClixNotificationExtension' do pod 'Clix' end ``` 3. Run the following command in your terminal: If you encounter any build errors, please refer to the [Troubleshooting](#troubleshooting) section below for common issues and solutions. We recommend to go through all solutions before you build the project. ```bash theme={null} cd ios pod install ``` If you're using CocoaPods, make sure to open the `.xcworkspace` file for all subsequent steps. Configure App Groups to enable data sharing between your main app and the extension. ### Add App Groups to Main App Target 1. Select your **main app target**. 2. Go to the **Signing & Capabilities** tab. 3. Click the **+ Capability** button. 4. Find and add **App Groups**. 5. Click the **+** button in the App Groups section. 6. Create an App Group ID using the following format: **The App Group ID must follow this exact format:** ``` group.clix.YOUR_APP_BUNDLE_ID ``` Replace `YOUR_APP_BUNDLE_ID` with your actual Clix project ID, which can be found in the Clix Console **Settings** page. ### Add Same App Groups to Extension Target 1. Select your **extension target** (e.g., ClixNotificationExtension). 2. Navigate to the **Signing & Capabilities** tab. 3. Click **+ Capability** and add **App Groups**. 4. Check the same App Group ID that you created for the main app. Both your main app and extension targets must share the same App Group ID. Modify the `NotificationService.swift` file in your extension with the following code: Replace `YOUR_APP_BUNDLE_ID` with your actual app identifier. ```swift NotificationService.swift theme={null} import Clix import UserNotifications /// NotificationService inherits all logic from ClixNotificationServiceExtension /// No additional logic is needed unless you want to customize notification handling. class NotificationService: ClixNotificationServiceExtension { // Initialize with your Clix project ID override init() { super.init() // Register your Clix project ID register(projectId: YOUR_PROJECT_ID) } override func didReceive( _ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void ) { // Call super to handle image downloading and send push received event super.didReceive(request, withContentHandler: contentHandler) } override func serviceExtensionTimeWillExpire() { super.serviceExtensionTimeWillExpire() } } ``` `ClixNotificationServiceExtension` automatically handles: * Downloading images from push notification payloads * Sending push reception events to the Clix server * Modifying and displaying notification content Now that setup is complete, let's test your implementation. ### 1. Build Your Project If you encounter any build errors, please refer to the [Troubleshooting](#troubleshooting) section below for common issues and solutions. 1. Select your main app scheme in Xcode. 2. Run **Product > Build** (⌘+B) to ensure there are no build errors. 3. Install the app on a real iOS device (simulators cannot receive push notifications). ### 2. Test Push Notifications 1. Launch the app and grant push notification permissions. 2. Navigate to the **Test Console** page in the Clix Console. 3. Find and select your registered device. 4. Send a test push message with an image. 5. Verify that the notification with the image is received on your device. ### 3. Verify Event Tracking 1. Open the real-time events panel in the Clix Console. 2. Check that "Push Received" events are being recorded in real-time when you receive push notifications. If you see rich push notifications with images and push reception events are logged in the console, your installation is complete! ## Troubleshooting When you add a Notification Service Extension (regardless of Clix installation), you may encounter build conflicts with RN-Firebase. **Error symptom:** * Build fails during the Embed Foundation Extensions phase * Conflicts with \[RNFB] Core Configuration **Solution:** 1. In Xcode, select your main app target. 2. Go to the **Build Phases** tab. 3. Find the **Embed Foundation Extensions** phase. 4. Drag it **above** the **\[RNFB] Core Configuration** phase. This ensures that the extension is embedded before RN-Firebase's configuration runs. **Reference:** [OneSignal Issue #1569](https://github.com/OneSignal/react-native-onesignal/issues/1569) When you add a Notification Service Extension, Xcode automatically modifies the `project.pbxproj` file. If the `objectVersion` changes, you may encounter errors during `pod install` depending on your CocoaPods version and Xcode version. **Error symptom:** * `pod install` fails with version-related errors * Error messages about incompatible project format **Solution:** 1. Open your project in Xcode. 2. Select the project (root level) in the project navigator. 3. In the **File Inspector** (right panel), find **Project Format**. 4. Change the Xcode version to match your current Xcode installation. 5. Save and run `pod install` again. **Reference:** [CocoaPods Issue #12840](https://github.com/CocoaPods/CocoaPods/issues/12840) After installing Clix, you may see an error during the **\[CP] Embed Pods Frameworks** build phase. This occurs because CocoaPods tries to copy dependencies to the NSE target but lacks file write permissions. **Error symptom:** * Build fails at \[CP] Embed Pods Frameworks phase * Permission denied errors when copying frameworks to the extension **Root cause:** In Xcode 15 and later, when you create a Notification Service Extension, the `ENABLE_USER_SCRIPT_SANDBOXING` build setting defaults to `YES`, which restricts script permissions. **Solution:** 1. Select your **NSE target** (e.g., ClixNotificationExtension) in Xcode. 2. Go to **Build Settings**. 3. Search for `ENABLE_USER_SCRIPT_SANDBOXING`. 4. Set it to **No**. 5. Clean and rebuild your project. **Reference:** [CocoaPods Issue #11946](https://github.com/CocoaPods/CocoaPods/issues/11946) * Verify that the Clix SDK is properly added to the extension target. - Check that the App Group ID is identical in both the main app and extension targets. * Ensure that you're calling `super.didReceive` in `NotificationService.swift`. - Verify that the push payload contains a valid image URL. * Verify that you've entered the correct project ID in the `register(projectId:)` method. - Check that the device is connected to the internet. - Review the Xcode console for any error logs. * Try restarting Xcode and running Clean Build Folder (⌘+Shift+K). * If using CocoaPods, run `pod install` again. * If using Swift Package Manager, go to **File > Packages > Reset Package Caches**. ## Additional Resources If you need to set up Firebase initially, refer to this guide. Check out the SDK source code and sample projects. Complete setup guide for React Native projects. Complete setup guide for Flutter projects. # SDK Quickstart - Android Source: https://docs.clix.so/sdk-quickstart-android Start sending your first notification in 10 minutes. ## Before Getting Started ### Overview Clix leverages Firebase Cloud Messaging (FCM) to deliver notifications efficiently. The goal is to ensure a smooth integration process and reliable delivery of push notifications to your app users. ### Environment * Android API level 26 (Android 8.0) or later * Firebase account [**Make sure you've completed the Firebase setup.**](/firebase-setting) If the setup is complete, the following items should be in place: * Make sure google-services.json is in your project directory. * Upload the Service Account Key file to the Clix console. ## Setup Clix - Using CLI (Recommended) Clix CLI is an AI-powered assistant for quick and easy SDK setup. Use the install and doctor commands to automatically configure the required code and settings. #### Install Clix CLI ```bash npm theme={null} npm install -g @clix-so/clix-cli ``` ```bash shell theme={null} curl -fsSL https://cli.clix.so/install.sh | bash ``` ```bash homebrew theme={null} brew tap clix-so/clix-cli && brew install clix ``` #### Run Install Command The install command checks for required files and configurations, then guides you through the installation process with interactive prompts. ```bash theme={null} clix install ``` ### Doctor Command The clix doctor command verifies that your Clix SDK setup is correct and provides guidance on fixing any issues. ```bash theme={null} clix doctor ``` ## Setup Clix - Manual Installation Integrate Firebase and Clix to manage and send notifications effectively from Clix console. Sonatype Central release (latest by date) Clix Android SDK supports installation only via **Gradle (Kotlin DSL).** #### (Option 1) Using Version Catalog (Recommended) If you're using the Gradle Version Catalog (`libs.versions.toml`), follow the steps below for more consistent dependency management. 1. Add the version and library alias to `gradle/libs.versions.toml` (create the file if it doesn't exist): ```toml theme={null} [versions] clix-android-sdk = "1.X.X" # Replace with the latest SDK version [libraries] clix-android-sdk = { module = "so.clix:clix-android-sdk", version.ref = "clix-android-sdk" } ``` 2. (Optional) If you use a custom catalog file name, adjust the accessor accordingly. If you're using the default (`libs`), no extra configuration is required. 3. In your app module's `build.gradle.kts`: ```kotlin theme={null} dependencies { // TOML alias: clix-android-sdk -> Gradle accessor: libs.clix.android.sdk implementation(libs.clix.android.sdk) } ``` > When Gradle generates accessors, hyphens (-) in the alias are converted to dots (.) resulting in `libs.clix.android.sdk`. *** #### (Option 2) Without Version Catalog (Direct Declaration) Add the following to your project's `settings.gradle.kts` or `build.gradle.kts`: ```kotlin theme={null} repositories { mavenCentral() } ``` Add the dependency to your app's `build.gradle.kts`: ```kotlin theme={null} dependencies { implementation("so.clix:clix-android-sdk:1.X.X") // Replace with the latest SDK version } ``` Lastly, add the plugin to your app's `build.gradle.kts`: ```kotlin theme={null} plugins { id("com.google.gms.google-services") version "4.X.X" // Replace with the latest version } ``` Add this code to your `Application` class. The endpoint and logLevel parameters are optional. If your project doesn't have an `Application` class, refer to [this link](https://pushalert.co/documentation/android-app-push-notification/create-application-class-android-app) to add one. ```kotlin Application.kt lines highlight={9-15} theme={null} import so.clix.core.Clix import so.clix.core.ClixConfig import so.clix.utils.logging.ClixLogLevel class MyApplication : Application() { override fun onCreate() { super.onCreate() Clix.initialize( this, ClixConfig( projectId = "YOUR_PROJECT_ID", apiKey = "YOUR_API_KEY", ), ) } } ``` Add this code to your `Application` class, right after the `Clix.initialize` code. ```kotlin Application.kt lines highlight={18-23} theme={null} import so.clix.core.Clix import so.clix.core.ClixConfig import so.clix.utils.logging.ClixLogLevel class MyApplication : Application() { override fun onCreate() { super.onCreate() Clix.initialize( this, ClixConfig( projectId = "YOUR_PROJECT_ID", apiKey = "YOUR_API_KEY", ), ) // STEP 2: Configure notification handling after initialization // Note: autoRequestPermission defaults to false Clix.Notification.configure( autoRequestPermission = false, // Set to true to automatically request permission autoHandleLandingURL = false // Set to true to automatically open landing URLs ) } } ``` By default, `autoRequestPermission` is set to `false`, which means the app will not automatically request push notification permission. There are two options to implement the push notification permission flow: #### (Option 1) Automatically request permission right after app launch Simply set `autoRequestPermission` to `true`. ```kotlin Application.kt highlight={4} theme={null} // STEP 2: Configure notification handling after initialization // Note: autoRequestPermission defaults to false Clix.Notification.configure( autoRequestPermission = true, // Set to true to automatically request permission autoHandleLandingURL = false // Set to true to automatically open landing URLs ) ``` #### (Option 2) Manually control when to show the permission prompt If you want to request permission at a specific point in your app, leave it as `false` and call the following code when you're ready to request permission. ```kotlin MainActivity.kt lines highlight={8-12} theme={null} import androidx.lifecycle.lifecycleScope import kotlinx.coroutines.launch class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) // Call this code wherever you want to request permission from the user lifecycleScope.launch { val granted = Clix.Notification.requestPermission() Clix.Notification.setPermissionGranted(granted) } } } ``` Run your project to verify that the setup works correctly. Go to Clix console > Test Console, find the registered device, send a test push notification, and confirm that the message is received on the device. Also, make sure the push events are being tracked in real time. If you're using an emulator, make sure it is started with **Cold Boot** to properly test push notification delivery. For more details, see [this guide](https://docs.clix.so/trouble-shooting/not-getting-push-notification#emulator-not-started-with-cold-boot). You need to set up Firebase before you start integrating it into your project. If you’d like to see a working example, check out our sample project. # SDK Quickstart - Flutter Source: https://docs.clix.so/sdk-quickstart-flutter Start sending your first notification in 10 minutes. ## Before Getting Started ### Overview Clix leverages Firebase Cloud Messaging (FCM) to deliver notifications efficiently. The goal is to ensure a smooth integration process and reliable delivery of push notifications to your app users. ### Environment * Flutter 3.0.0 or later * Dart 2.17.0 or later * iOS 14.0+ / Android API 21+ * Firebase configured in your Flutter app ([Firebase setup guide](https://firebase.google.com/docs/flutter/setup?platform=android)). * We recommend using `flutterfire` for the installation. [******Make sure you’ve completed the Firebase setup.******](/firebase-setting) If the setup is complete, the following items should be in place. 1. Make sure GoogleService-Info.plist is in your project's ios > Runner directory and google-services.json is in your project's android > app > src directory. 2. Upload the Service Account Key file to the Clix console. ## Setup Clix - Manual Installation Clix Flutter SDK only supports manual installation. Add the Clix Flutter SDK dependency to your project's `pubspec.yaml`: ```yaml theme={null} dependencies: clix_flutter: ^0.0.1 firebase_core: ^3.6.0 firebase_messaging: ^15.1.3 ``` Install dependencies: ```bash theme={null} flutter pub get ``` Initialize Firebase and Clix in your app's entry point (`main.dart`): ```dart main.dart theme={null} import 'package:flutter/material.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:clix_flutter/clix_flutter.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); await Clix.initialize(const ClixConfig( projectId: 'YOUR_PROJECT_ID', apiKey: 'YOUR_PUBLIC_API_KEY', )); runApp(MyApp()); } ``` Replace `YOUR_PROJECT_ID` and `YOUR_PUBLIC_API_KEY` accordingly. To add Push Notification Capability, 1. Select your app target. 2. Go to the **Signing & Capabilities** tab. 3. Click the **+** button and choose **Push Notification** from the list. 4. Click the **+** button and choose **Background Modes** from the list. 5. Then check **'Remote notifications'**. ```bash theme={null} flutter run ``` **Known Issue: iOS 26.0 Simulator** Push notification token generation may fail on iOS 26.0 Simulator. If you encounter this issue, update to iOS 26.1 or later. See [Apple Developer Forums](https://developer.apple.com/forums/thread/797507) for details. For more details, please refer to the README file on the clix-flutter-sdk GitHub repository. ## Next Steps Complete the iOS setup by adding a Notification Service Extension to enable rich notifications with images and track delivery events. Check out the latest guides and API for the Clix Flutter SDK. You need to set up Firebase before you start integrating it into your project. If you'd like to see a working example, check out our sample project. # SDK Quickstart - iOS Source: https://docs.clix.so/sdk-quickstart-ios Start sending your first notification in 10 minutes. ## Before Getting Started ### Overview Clix leverages Firebase Cloud Messaging (FCM) to deliver notifications efficiently. The goal is to ensure a smooth integration process and reliable delivery of push notifications to your app users. ### Environment * iOS 15.0 or later * Swift 5.5 or later * Xcode 16.2 or later * Cocoapods or Swift Package Manager [******Make sure you’ve completed the Firebase setup.******](/firebase-setting) If the setup is complete, the following items should be in place. 1. Make sure GoogleService-Info.plist is in your project directory. 2. Upload the Service Account Key file to the Clix console. ## Setup Clix - Using CLI (Recommended) Clix CLI is an AI-powered assistant for quick and easy SDK setup. Use the install and doctor commands to automatically configure the required code and settings. For iOS projects, follow the CLI prompts to add the necessary files and configurations. #### Install Clix CLI ```bash npm theme={null} npm install -g @clix-so/clix-cli ``` ```bash shell theme={null} curl -fsSL https://cli.clix.so/install.sh | bash ``` ```bash homebrew theme={null} brew tap clix-so/clix-cli && brew install clix ``` #### Run Install Command The install command in the Clix CLI checks for required files and configurations, and provides appropriate installation guidance through prompts. ```bash theme={null} clix install ``` ### Doctor Command The clix doctor command checks whether the necessary code and configuration for using the Clix SDK are properly set up, and provides guidance on how to fix any issues. ```bash theme={null} clix doctor ``` ## Setup Clix - Manual Installation Integrate Firebase and Clix to manage and send notifications effectively from Clix console. GitHub release (latest by date) Option1) Using Swift Package Manager (SPM): * Go to 'File' > 'Add Package Dependencies' * Search and add **'**[**https://github.com/clix-so/clix-ios-sdk.git**](https://github.com/clix-so/clix-ios-sdk.git)**'** * Install the package and select your main app as a target. ios-quickstart_1.png *** Option2) Using Pod: * Add these lines to your `Podfile`: ```bash {2} theme={null} # Podfile pod 'Clix' ``` * Then run: ```bash theme={null} pod install ``` To add Push Notification Capability, 1. Select your app target. 2. Go to the **Signing & Capabilities** tab. 3. Click the **+** button and choose **Push Notification** from the list. ios-quickstart_2.png Add this code to `AppDelegate.swift` inside the `didFinishLaunchingWithOptions` method: Ensure that your AppDelegate inherits from ClixAppDelegate. ```swift AppDelegate.swift {5,8,13,16-24,30} theme={null} import UIKit import Clix import FirebaseCore class AppDelegate: ClixAppDelegate { // Set to true to auto-request push permissions on launch. // Default is false - you must manually request permissions. override var autoRequestPermission: Bool { true } override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { FirebaseApp.configure() Task { await Clix.initialize( config: ClixConfig( projectId: YOUR_PROJECT_ID, apiKey: YOUR_PUBLIC_API_KEY, // Optional parameters: // endpoint: "https://api.clix.so", // logLevel: .debug, // extraHeaders: [:] ) ) } return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } ``` Run your project to verify the setup works correctly. Notifications should appear on your device as expected. **Known Issue: iOS 26.0 Simulator** Push notification token generation may fail on iOS 26.0 Simulator. If you encounter this issue, update to iOS 26.1 or later. See [Apple Developer Forums](https://developer.apple.com/forums/thread/797507) for details. 1. Create a Notification Service Extension to enhance your notification content. 2. In Xcode, choose **File > New > Target > Notification Service Extension**. 3. Name the extension **'ClixNotificationExtension'**. ios-quickstart_3.png 1. Select your app target. 2. Go to the **Signing & Capabilities** tab. 3. Click the **+** button and choose App Groups from the list. 4. Click **+** under App Groups and create the App Group ID **The App Group ID must follow this exact format:** ```bash {1} theme={null} group.clix.YOUR_BUNDLE_ID ``` Replace `YOUR_BUNDLE_ID` with your actual app bundle identifier (e.g., `group.clix.com.yourcompany.yourapp`). This ensures MMKV can share data between your app and extensions. 5. Add the same App Group Id to the Extension target. 6. At the Extension target > 'General' > 'Frameworks, Libraries ...' , click '+' button and search and add 'Clix' to your extension target. Add the following to your extension's `NotificationService.swift`: Note that you have to replace YOUR\_PROJECT\_ID to your own project id. (Check out Clix Console > Setting) ```swift NotificationService.swift {6,11} theme={null} import Clix import UserNotifications /// NotificationService inherits all logic from ClixNotificationServiceExtension /// No additional logic is needed unless you want to customize notification handling. class NotificationService: ClixNotificationServiceExtension { // Initialize with your Clix project ID override init() { super.init() // Register your Clix project ID register(projectId: YOUR_PROJECT_ID) } override func didReceive( _ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void ) { // Call super to handle image downloading and send push received event super.didReceive(request, withContentHandler: contentHandler) } override func serviceExtensionTimeWillExpire() { super.serviceExtensionTimeWillExpire() } } ``` Run your project to verify the setup works correctly. Go to Clix console > Test Console, find the registered device, send a push message, and check if the message is received properly on the device. Also, make sure the push events are being tracked in real time. By default, `autoRequestPermission` is set to `false`, meaning the SDK will NOT automatically request push notification permissions. **Option 1: Enable Auto-Request** Override `autoRequestPermission` in your AppDelegate to automatically request permissions on launch: ```swift {2} theme={null} class AppDelegate: ClixAppDelegate { override var autoRequestPermission: Bool { true } // ... rest of your code } ``` **Option 2: Manual Permission Request** If you want to control when the permission prompt appears (e.g., after onboarding), keep the default and call: ```swift {1} theme={null} Clix.Notification.requestPermission() ``` **Option 3: Native Permission Handling** If you handle permissions natively, you must notify Clix of the permission status: ```swift {8} theme={null} UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in if let error = error { print("Permission request error: \(error)") return } // Notify Clix SDK about permission status Clix.Notification.setPermissionGranted(granted) if granted { DispatchQueue.main.async { UIApplication.shared.registerForRemoteNotifications() } } } ``` If `autoRequestPermission` is `false` and you don't call `Clix.Notification.setPermissionGranted(_:)` after handling permissions natively, the Clix server won't know the user's permission status, which may affect campaign targeting. ## Post-installation Checklist After installing and wiring the SDK, review the following critical points to avoid subtle runtime issues and ensure Clix can manage push notifications correctly. ```swift AppDelegate.swift (Correct Order) {5,7,13,16-26,30} theme={null} import UIKit import Clix import FirebaseCore class AppDelegate: ClixAppDelegate { // Set to true to auto-request push permissions on launch (default: false) override var autoRequestPermission: Bool { true } override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // 1. Always configure Firebase first FirebaseApp.configure() // 2. Then initialize Clix (async-safe) Task { await Clix.initialize( config: ClixConfig( projectId: YOUR_PROJECT_ID, apiKey: YOUR_PUBLIC_API_KEY, // Optional parameters: // endpoint: "https://api.clix.so", // logLevel: .debug, // extraHeaders: [:] ) ) } // 3. Return super at the very end (lets Clix finalize delegates & observers) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } } ``` ```swift AppDelegate.swift (Incorrect - Clix before Firebase) {1-2} theme={null} FirebaseApp.configure() // ❌ Missing (or comes after Clix) Task { await Clix.initialize(config: /* ... */) } // Will fail if Firebase not ready ``` ```swift AppDelegate.swift (Incorrect - super called first) {2} theme={null} override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: ...) -> Bool { let ok = super.application(application, didFinishLaunchingWithOptions: launchOptions) // ❌ super too early FirebaseApp.configure() Task { await Clix.initialize(config: /* ... */) } return ok } ``` ```swift AppDelegate.swift (Incorrect - manual delegate assignments) {7-8} theme={null} import FirebaseMessaging import UserNotifications override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: ...) -> Bool { FirebaseApp.configure() // ❌ Remove these. ClixAppDelegate manages them internally. UNUserNotificationCenter.current().delegate = self Messaging.messaging().delegate = self return super.application(application, didFinishLaunchingWithOptions: launchOptions) } ``` **Initialize Clix after FirebaseApp.configure()** Reason: Clix relies on Firebase Messaging. If Firebase isn't configured first, FCM token retrieval and registration can fail. **Call super at the very end of each overridden lifecycle method inherited from ClixAppDelegate / ClixNotificationServiceExtension** Reason: Clix's super implementation finalizes delegate setup, event tracking, and background handling. Calling it early can overwrite or miss your custom logic; omitting it breaks internal hooks. **Remove manual assignments to Messaging.messaging().delegate and UNUserNotificationCenter.current().delegate** Reason: Clix sets these delegates internally. Reassigning them can prevent delivery receipts, media attachment handling, or token sync. If you must implement your own delegate methods (e.g., for foreground presentation), do it in your AppDelegate subclass but still avoid reassigning the delegates. Clix forwards relevant delegate callbacks so your overrides continue to work. Need to confirm things are correct? Run `clix doctor` again — it re-validates configuration and highlights missing steps. ### Quick Self-Test 1. Launch the app cold start: verify no console errors about FCM or missing projectId. 2. Send a test push: confirm receipt and event tracking in the Clix Console (real-time events panel). 3. Foreground push: ensure notification presentation logic still works without manual delegate assignments. If any step fails, re-check the checklist above before deeper debugging. You need to set up Firebase before you start integrating it into your project. If you'd like to see a working example, check out our sample project. # SDK Quickstart - React Native Source: https://docs.clix.so/sdk-quickstart-react-native Start sending your first notification in 10 minutes. ## Before Getting Started ### Overview This guide walks you through setting up the Clix SDK in a React Native project. It covers all required steps including installing dependencies, configuring Firebase, and initializing the SDK. By following this quickstart, you can send your first notification in just a few minutes. This guide supports both Expo and standard React Native CLI projects. **Prerequisites** 1. Have a React Native project (Expo or React Native CLI) 2. Create or use an existing Firebase project in the Firebase Console 3. Note your Android package name and iOS bundle identifier 4. For Expo projects: Ensure you're using `expo-dev-client` with local development builds (not Expo Go) ## Install React Native Firebase You can skip this step if you already integrate [React Native Firebase](https://rnfirebase.io/). **Make sure your React Native Expo project is using expo-dev-client with a local development build (not the standard Expo Go app).** This is required to enable platform-native features such as push notifications. If your project isn't using expo-dev-client yet, run the following script to install it: ```bash theme={null} npx expo install expo-dev-client ``` Add the core Firebase module: ```bash theme={null} npx expo install @react-native-firebase/app @react-native-firebase/messaging expo-build-properties ``` From the Firebase console download: * google-services.json (for Android) * GoogleService-Info.plist (for iOS) Place them in your project root, then add to app.json: ```json theme={null} { "expo": { "plugins": [ "@react-native-firebase/app", "@react-native-firebase/messaging", [ "expo-build-properties", { "ios": { "useFrameworks": "static" }, "android": { "extraMavenRepos": [ "../../node_modules/@notifee/react-native/android/libs" ] } } ] ], "android": { "package": "com.your.app", "googleServicesFile": "./google-services.json" }, "ios": { "bundleIdentifier": "com.your.app", "googleServicesFile": "./GoogleService-Info.plist", "entitlements": { "aps-environment": "production" }, "infoPlist": { "UIBackgroundModes": ["remote-notification"] } } } } ``` Apply native configuration: ```bash theme={null} npx expo prebuild --clean ``` Install the core Firebase modules: ```bash theme={null} npm install @react-native-firebase/app @react-native-firebase/messaging # or yarn add @react-native-firebase/app @react-native-firebase/messaging ``` **Add Firebase Configuration File** Download `GoogleService-Info.plist` from Firebase Console and add it to your Xcode project. **Update Podfile** Ensure your `ios/Podfile` has the following configuration: ```ruby ios/Podfile theme={null} platform :ios, '14.0' # Add this line before the target block use_frameworks! :linkage => :static $RNFirebaseAsStaticFramework = true target 'YourAppName' do # ... rest of your configuration end ``` The `use_frameworks! :linkage => :static` configuration is required for proper integration with Firebase and Clix SDK dependencies. **Install Pods** ```bash theme={null} cd ios && pod install && cd .. ``` **Configure AppDelegate** Add Firebase initialization code to your AppDelegate: ```swift ios/YourApp/AppDelegate.swift theme={null} import UIKit import Firebase // Add this import @main class AppDelegate: UIResponder, UIApplicationDelegate { func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { FirebaseApp.configure() // Add this line // ... rest of your code return true } } ``` ```objc ios/YourApp/AppDelegate.mm theme={null} #import "AppDelegate.h" #import // Add this import @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [FIRApp configure]; // Add this line // ... rest of your code return YES; } @end ``` **Enable Capabilities in Xcode** 1. Open your project in Xcode 2. Select your target → Signing & Capabilities 3. Add "Push Notifications" capability 4. Add "Background Modes" capability and enable "Remote notifications" 5. Add "App Groups" capability 6. Click the "+" button under App Groups and create a new App Group with identifier: `group.clix.YOUR_BUNDLE_ID` The App Group identifier must follow the format `group.clix.{bundle_id}` (e.g., `group.clix.com.yourcompany.yourapp`). This ensures MMKV can share data between your app and extensions. **Add Firebase Configuration File** Download `google-services.json` from Firebase Console and place it in `android/app/`. **Update build.gradle Files** Add Google Services plugin to `android/build.gradle`: ```gradle theme={null} buildscript { dependencies { classpath 'com.google.gms:google-services:4.3.15' } } ``` Apply the plugin in `android/app/build.gradle`: ```gradle theme={null} apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' ``` ## Install Clix SDK Add the Clix SDK and required dependencies: ```bash theme={null} npx expo install @clix-so/react-native-sdk @notifee/react-native react-native-device-info react-native-get-random-values react-native-mmkv react-native-nitro-modules uuid@11.1.0 ``` **Version Compatibility** * React Native 0.70-0.73: Use `react-native-get-random-values` v1.11.0 and `react-native-mmkv` v2.12.2 * React Native 0.74+: Use `react-native-get-random-values` v1.12.0+ and `react-native-mmkv` v3.0.1+ * `react-native-nitro-modules` is required when using `react-native-mmkv` v3.0.1+ Add the Clix initialization code at the top of your `index.js` file: ```typescript theme={null} import { AppRegistry } from 'react-native'; import { name as appName } from './app.json'; import App from './App'; import Clix, { ClixLogLevel } from '@clix-so/react-native-sdk'; import 'react-native-get-random-values'; // Initialize Clix SDK Clix.initialize({ projectId: 'YOUR_PROJECT_ID', apiKey: 'YOUR_API_KEY', logLevel: ClixLogLevel.DEBUG, // Optional }).then(() => { // If you don't manually request push permission elsewhere, // enable auto-request to prompt users automatically Clix.Notification.configure({ autoRequestPermission: true }); }); AppRegistry.registerComponent(appName, () => App); ``` Apply native code and configuration: **We recommend rebooting the simulator and reinstalling the app before running it again.** ```bash theme={null} npx expo prebuild --clean npx expo run:android npx expo run:ios ``` **Known Issue: iOS 26.0 Simulator** Push notification token generation may fail on iOS 26.0 Simulator. If you encounter this issue, update to iOS 26.1 or later. See [Apple Developer Forums](https://developer.apple.com/forums/thread/797507) for details. Install the Clix SDK and required dependencies: ```bash theme={null} npm install @clix-so/react-native-sdk @notifee/react-native react-native-device-info react-native-get-random-values@^1.11.0 react-native-mmkv react-native-nitro-modules uuid@11.1.0 # or yarn add @clix-so/react-native-sdk @notifee/react-native react-native-device-info react-native-get-random-values@^1.11.0 react-native-mmkv react-native-nitro-modules uuid@11.1.0 ``` **Version Compatibility** * React Native 0.70-0.73: Use `react-native-get-random-values` v1.11.0 and `react-native-mmkv` v2.12.2 * React Native 0.74+: Use `react-native-get-random-values` v1.12.0+ and `react-native-mmkv` v3.0.1+ * `react-native-nitro-modules` is required when using `react-native-mmkv` v3.0.1+ Install the iOS dependencies: ```bash theme={null} cd ios && pod install && cd .. ``` Add the Clix initialization code at the top of your `index.js` file: ```typescript theme={null} import { AppRegistry } from 'react-native'; import { name as appName } from './app.json'; import App from './App'; import Clix, { ClixLogLevel } from '@clix-so/react-native-sdk'; import 'react-native-get-random-values'; // Initialize Clix SDK Clix.initialize({ projectId: 'YOUR_PROJECT_ID', apiKey: 'YOUR_API_KEY', logLevel: ClixLogLevel.DEBUG, // Optional }).then(() => { // If you don't manually request push permission elsewhere, // enable auto-request to prompt users automatically Clix.Notification.configure({ autoRequestPermission: true }); }); AppRegistry.registerComponent(appName, () => App); ``` Run your application: **iOS** ```bash theme={null} npx react-native run-ios ``` **Android** ```bash theme={null} npx react-native run-android ``` **We recommend cleaning and rebuilding if you encounter any issues:** * iOS: Product → Clean Build Folder in Xcode * Android: `cd android && ./gradlew clean && cd ..` **Known Issue: iOS 26.0 Simulator** Push notification token generation may fail on iOS 26.0 Simulator. If you encounter this issue, update to iOS 26.1 or later. See [Apple Developer Forums](https://developer.apple.com/forums/thread/797507) for details. ## Next Steps Complete the iOS setup by adding a Notification Service Extension to enable rich notifications with images and track delivery events. # Security and Ops Source: https://docs.clix.so/security/index Overview of our security and operations docs. Use these links for details: * [RPO and RTO](/security/rpo-rto) * [Resiliency testing](/security/resiliency-testing) * [Customer responsibilities](/legal/customer-responsibilities) * [Incident communication](/ops/incident-communication) * [S3 access review](/ops/s3-access-review) * [Data classification](/security/data-classification) * [Compliance](/security/compliance) # Errors Source: https://docs.clix.so/troubleshooting/clix-server-errors Troubleshooting errors you may face in Clix console. **Cause:** There’s a mismatch between the Service Account and the client-side GoogleService-Info.plist (or google-services.json) configuration. **Solution:** Make sure the service account file and the Google service files are from the same Firebase project. **Cause:** The Clix server encountered an unexpected internal error. **Solution:** Please try again, and if the issue persists, contact Clix support. Make sure your App signing and Apple push keys (.p8 file) is correctly registered on the Firebase console. This error often happens because of an invalid token. Here are the steps to check and fix the issue: 1. **Verify the Token** Make sure the token used in the request is valid and not expired or malformed. 2. **Check Signing Process** If you are generating a token manually, confirm that the signing process is correct. The algorithm, headers, and payload must follow the required format. 3. **Confirm p8 File or Certificate** If you are using APNs with Firebase Cloud Messaging, ensure that the .p8 file or certificate is correctly uploaded in the Firebase console and matches the key ID and team ID used in your code. 4. **APNs Key and Bundle ID** Make sure the APNs key is linked to the correct app, and the bundle ID used matches what is registered in Firebase and Apple Developer Console. 5. **Review Firebase Console Settings** Double-check all related settings in the Firebase project. Any mismatch between Firebase and Apple credentials can cause this error. By reviewing these points, you can usually identify the problem and adjust your request to fix the error. **Cause:** The .p8 file is not uploaded to the Firebase console, or the uploaded file is invalid. **Solution:** Upload a valid APNs authentication key (.p8 file) to your Firebase project. See [Firebase Setting Guide](https://docs.clix.so/firebase-setting#things-to-prepare) for detailed instructions. # Notification Not Delivered to Device Source: https://docs.clix.so/troubleshooting/not-getting-push-notification Refer to the checklist below to troubleshoot issues with push notifications not being delivered. The push notification was sent successfully but did not appear on the user’s device. This issue may be caused by missing notification permissions, network restrictions, token expiration, or incorrect SDK integration. ## iOS **Cause:** The Push Notification capability is not enabled in your Xcode project. **Solution:** 1. Open your project in Xcode. 2. Navigate to your target's **Signing & Capabilities** tab. 3. Click the **+** button and add **Push Notifications** capability. 4. Rebuild and rerun your application. **Cause:** The Xcode or simulator version you are using is outdated. **Solution:** 1. Check your Xcode and Simulator versions. 2. Update Xcode and Simulator to the latest versions via the App Store or Xcode preferences. 3. Restart Xcode and Simulator after updating. **Cause:** The user has not granted push notification permissions. **Solution:** 1. On your device, navigate to **Settings** > **Notifications** > Your App. 2. Ensure **Allow Notifications** is enabled. 3. You can also confirm notification permission status in the Clix device list dashboard. **Cause:** Your device has a poor or unstable network connection. **Solution:** 1. Ensure your device has a stable internet connection. 2. Try switching between Wi-Fi and cellular data to improve connectivity. 3. Verify connectivity by visiting a webpage or using other network-dependent apps. ## Android **Cause:** Your emulator device did not start with a cold boot. **Solution:** 1. Open Android Studio Device Manager. 2. Select your emulator device, click on **Edit**. 3. Go to the **Additional Settings** section. 4. Set the **Boot option** to **Cold boot**. 5. Save changes and restart your emulator. **Cause:** The user has not granted push notification permissions. **Solution:** 1. Navigate to **Settings** > **Apps** > Your App > **Notifications**. 2. Ensure notification permissions are enabled. 3. Confirm permission status in the Clix device list dashboard. **Cause:** Your device is experiencing poor or unstable network connectivity. **Solution:** 1. Check your internet connection by opening a browser or another app. 2. Switch between Wi-Fi and mobile data to resolve connectivity issues. 3. Restart the device or emulator and try again. # User Management Source: https://docs.clix.so/user-management/user-management User management in the Clix SDK allows you to distinguish between anonymous users and identified users within your app. This ensures that push notifications, in-app messaging, and analytics can be personalized and consistent across devices and sessions. You can check how to use the API in the Clix SDK GitHub repositories for each platform: * [iOS](https://github.com/clix-so/clix-ios-sdk#user-management) * [Android](https://github.com/clix-so/clix-android-sdk#user-management) * [React Native](https://github.com/clix-so/clix-react-native-sdk#user-management) * [Flutter](https://github.com/clix-so/clix-flutter-sdk#user-management) For additional conceptual details, see the [Clix Documentation on User](https://docs.clix.so/essentials/user). If no user ID is set, Clix will automatically treat the user as **anonymous** with only a device ID and an auto-generated `project-user-id`. If a user ID is set, the anonymous user will be **converted** into an **Identified User**, linking all their previous activity with their account. ## When to Use User Management By default, when your app starts without setting a user ID, Clix assigns an **anonymous profile**. This is useful when users are browsing your app without logging in. Once a user logs in or creates an account, you can call the **User Management API** to assign a permanent `userId`. This converts the anonymous user to an **Identified User**, ensuring continuity of notifications, preferences, and analytics across devices. When a user logs out, you don't need to take any action. Events after logout are attributed to the last known user. Call `reset()` only if you need to fully anonymize the user (e.g., shared devices). *** ## User Logout / Reset By default, you don't need to handle logout explicitly. Events sent after logout are attributed to the last known user, which is sufficient for most use cases. If you need to explicitly log users out or track events under an anonymous user (e.g., shared devices where multiple people sign in), call `reset()`. This anonymizes the user by: * Setting the user ID to null * Clearing the device ID so a new one is generated on next initialization With an empty user ID and a completely new device ID, the current user appears as a brand new anonymous user in the dashboard. After calling `reset()`, you must call `initialize()` again before using the SDK. ```swift iOS theme={null} // On logout Clix.reset() // On next login Clix.initialize(config: config) Clix.setUserId("user_12345") ``` ```kotlin Android theme={null} // On logout Clix.reset() // On next login Clix.initialize(context, config) Clix.setUserId("user_12345") ``` ```typescript React Native theme={null} // On logout await Clix.reset(); // On next login await Clix.initialize({ projectId: "...", apiKey: "..." }); await Clix.setUserId("user_12345"); ``` ```dart Flutter theme={null} // On logout await Clix.reset(); // On next login await Clix.initialize(ClixConfig(projectId: "...", apiKey: "...")); await Clix.setUserId("user_12345"); ``` `removeUserId()` is deprecated. Use `reset()` instead. *** ## Example Usage ```swift theme={null} // 1. Anonymous user (default) // No userId is set, Clix generates a project-user-id internally // 2. Identified user // After login, set a unique userId Clix.setUserId("clix_user") ``` ## Setting User Properties You can attach custom properties to a user profile for personalization and analytics. Properties can be strings, numbers, or booleans. **Set a single property (async):** ```swift theme={null} try await Clix.setUserProperty("subscription", value: "premium") ``` **Set multiple properties (async):** ```swift theme={null} try await Clix.setUserProperties([ "age": 25, "city": "Seoul", "premium": true ]) ``` **Set a single property (sync):** ```swift theme={null} Clix.setUserProperty("subscription", value: "premium") ``` **Set multiple properties (sync):** ```swift theme={null} Clix.setUserProperties([ "age": 25, "city": "Seoul", "premium": true ]) ``` *** ## Removing User Properties You can remove one or more properties from a user profile. **Remove a single property (async):** ```swift theme={null} try await Clix.removeUserProperty("subscription") ``` **Remove multiple properties (async):** ```swift theme={null} try await Clix.removeUserProperties(["age", "premium"]) ``` **Remove a single property (sync):** ```swift theme={null} Clix.removeUserProperty("subscription") ``` **Remove multiple properties (sync):** ```swift theme={null} Clix.removeUserProperties(["age", "premium"]) ``` *** ## Error Handling All user management operations can throw errors. Always handle errors for robust apps: **Error handling example:** ```swift theme={null} do { try await Clix.setUserId("user123") } catch { print("Failed to set user ID: \(error)") } ```