Guides
Privacy & consent
Choose which SDK events your app can send. The SDK checks each event's purpose at collection. This guide covers consent, routing requests, identity data, and retention.
Consent on every event
Every event Pharen sends carries an explicit consent context — the set of purposes granted, and when. It's present even when nothing is granted (an empty set is still explicit). An event is only queued if the purpose it needs is currently granted; otherwise it's dropped at the boundary, before it's ever stored or sent.
The five purposes
Purposes map to why data is processed, not to product features. Each event type resolves to exactly one:
| Purpose | Covers |
|---|---|
telemetry | Crashes, handled errors, performance. |
behavioral | Sessions, screen views, your track() events. |
identity | Associating activity with a known user (identify()). |
content | User-submitted content, such as feedback. |
health | Special-category / sensitive data. Explicit, runtime-only (see below). |
SDK events are opt-in
The SDK drops an event before storing or sending it unless the event's purpose has been granted. Behavioral consent gates the link-open event. The SDK can still send a routing lookup.
Granting consent
Grant purposes at build time only where applicable law permits the collection and device storage or access to begin without prior consent. List them in Info.plist:
<key>PharenConsentGrantedAtBuild</key>
<array>
<string>telemetry</string>
<string>behavioral</string>
</array>Or grant them at runtime — for example, after your consent banner returns. Grants and revocations take effect immediately:
// Replace the whole granted set (e.g. from a consent banner result):
Pharen.shared?.consent.setConsent(granted: [.telemetry, .behavioral])
// Or change one purpose at a time:
Pharen.shared?.consent.grant(.behavioral)
Pharen.shared?.consent.revoke(.behavioral)Keep identifying data out of events
When you identify a user, you pass a pseudonymous id and, optionally, traits:
Pharen.shared?.identify("cus_482", traits: ["plan": "pro"])The platform replaces the app's pseudonymous user ID with its own reference before storing events. User traits from identify() and device attributes fromidentifyDevice() go to the restricted identity store, separate from events and the special-category store. Keep direct identifiers out of event properties. The SDK drops a list of identifying key names from track(), and the server rejects fields it classifies as identifying.
How Pharen scopes app data
The SDK never sends your organization's id (org_id). Your environment is stamped by the server too — a test build may name one of your other registered test environments for the server to use instead of the key's own default, but it can never create one or reach your live data, and a name the server doesn't recognize falls back to that default. Both — along with your app id, when you use a per-app key — derive from the ingest key the request authenticates with. The key is public by design (it ships in your binary and carries no read access). Use a test key in development builds to keep their events out of the live environment. See Environments & release tracks.
How long data is kept
These are the windows the Service applies, whatever your plan, unless a row says otherwise. Where a row says for the life of your organization, nothing deletes that data on a schedule: it stays until you instruct its deletion or your agreement ends, and then the deletion windows in the Data Processing Agreement apply. Where a row gives a minimum, the Service does not delete that data on a schedule before then, unless you instruct its deletion or your organization ends sooner; it may keep it longer, never beyond the life of your organization. We may set or shorten a window with the notice the Terms describe for usage limits. You can set the link-open capture window below yourself. Every other window is set by the Service as listed, and you can instruct deletion at any time under the Data Processing Agreement.
| Data | Kept |
|---|---|
| Events, sessions and crash reports | At least 15 months, and no longer than the life of your organization |
| Issues, uploaded symbol files | For the life of your organization |
Users and installs: their records, the links between them, their identity traits, and results kept under the health purpose | Until 15 months after that user's or install's last activity, then deleted, including while your organization is suspended |
| Builds you distribute, their install pages, and testers' enrollment and device records | For the life of your organization |
| App-store data retrieved with a store credential you connect | For the life of your organization |
| Diagnostic bundles, including a report's attached pictures and captured network activity | 30 days |
| Feedback reports, and a reporter's contact address kept beside a report | 365 days, or the longer period your Enterprise Order states |
| Session network addresses, where you enable their capture | 90 days |
| A link open's network address, user agent and referrer, where you enable their capture | 90 days, or the window you configure; the open itself stays counted |
| Push delivery records, and a push provider's refusal of a misconfigured send | 90 days |
| A push provider's report that a push address is no longer valid | Until its install is deleted and the report is 15 months old |
| Push registrations | Until the push provider reports the address invalid, or you delete it |
| Usage counts: how many events the Service received and how many sessions it billed, for each app and environment, each month | Kept after your organization ends, as the record of what the Service handled; they name no user or install |
| The ingestion log | Deleted once processed and at least 7 days old |
| Events refused for carrying data the Service does not accept, kept with that data removed | 30 days |
On the device. Until the Service accepts it, the current SDK keeps what it records on the device within one budget: 30 MB and 15,000 items across the event queue, crash reports and identity updates. Past either bound, the oldest detail goes first, and the newest three crash reports are never dropped to make room. On iOS, diagnostic bundles and a reporter's contact address waiting to send keep their own limits and are deleted after 30 days. While your organization is suspended, the SDK keeps recording within that budget, sends none of it, and sends what it kept once service is restored. When your agreement ends, or your organization has no plan, the SDK stops recording and deletes what it held on the device the next time the device reaches the Service; until then, what it held stays on the device. The limits, and what happens during a limit hold, are set out in Service limits & data freshness.
Remembered for the reporter. On iOS, the address a reporter last sent with a report is kept on the device to offer it back next time, until a report is sent with the field emptied or the app stops asking for an address. It is also forgotten when the permission that allowed it is withdrawn, when, while the app is running, a different person is identified, or when the Service stops the install, as it does when your agreement ends. On the hosted report page, remembering is a separate choice: only “Send and remember my email” saves a valid email after an accepted report, in a cookie on that browser for up to 365 days, scoped to that report page. “Forget saved email” clears it without sending a report. Sending without remembering or with the email field cleared also clears it, even if the parsed report needs a correction. A page that stops asking for email clears it on a visit. Cookies saved without that explicit choice are not used to prefill the form and are cleared when the page is visited. Forgetting browser storage does not delete an address already sent with a report.
Data that exists only on a device is lost if the app is removed or its data is cleared, with one exception on iOS: with telemetry granted when it starts, the SDK keeps one Keychain item on the device, never synchronized, which can outlive the app's deletion. It holds a random marker, a random salt and, once someone has signed in, the install they last used and a hash of their id under that salt; it is what lets a reinstall say it was installed before. It exists only while telemetry is granted: it is removed whentelemetry is withdrawn, and at every launch without it, whether the user declined or the app never granted it, until the removal takes. One exception: a reinstall that starts without telemetry leaves an earlier install's item in place for up to seven days, so an app that asks after it starts can still use it; if the user declines, or the seven days pass, the next launch removes it. It forgets who last signed in on a sign-out or when identity is withdrawn. Only builds signed by the Apple developer team that kept the item can reach it: if the app is transferred to another team, the new team's builds neither read nor remove the earlier item, which stays on the device unread, and withdrawing telemetry removes only the item kept after the move.
Forwarding a data-subject request
To forward a request about Customer Data under DPA Section 8, write to [email protected]. Include any known applicable statutory deadline and, for a covered consumer-health deletion request, the date you authenticated it. Missing those details does not extend a deadline or remove the rights and assistance obligations in the DPA or applicable law.