{"schemaVersion":1,"title":"Customer identity and client credentials","url":"https://appgram.dev/docs/guides/client-identity","markdownUrl":"https://appgram.dev/docs/format-md/guides/client-identity.md","jsonUrl":"https://appgram.dev/docs/agent/pages/guides/client-identity.json","version":"current","locale":"en","markdown":"# Customer identity and client credentials\n\nConfigure public project context, anonymous identification, and account changes.\n\nYour project identifier selects the AppGram project. Customer identity associates activity with a person. A management API key authorizes server operations. Keep those responsibilities separate when configuring an integration.\n\n## Public client configuration\n\nUse a public project ID in React, React Native, Flutter, and Swift. The embed accepts a public project ID or an `organization/project` key. Organization and project slugs help route public pages and releases; they do not act as passwords.\n\nKeep management keys on your backend. Do not place them in provider props, frontend environment variables, mobile bundles, HTML attributes, or customer identity fields. The [authentication guide](/guides/api-authentication) explains server requests.\n\n## Anonymous identification\n\nThe React, React Native, and Flutter providers enable fingerprinting by default for anonymous identification. Set `enableFingerprinting: false` in their configuration to avoid initializing it:\n\n```tsx\n<AppgramProvider config={{\n  projectId: 'YOUR_PROJECT_ID',\n  enableFingerprinting: false,\n}}>\n  <YourApp />\n</AppgramProvider>\n```\n\nThe Flutter setting uses the same name in `AppgramConfig`. This option controls the SDK's fingerprint initialization; it does not remove identity your application explicitly supplies in a request. Decide which identification behavior your product needs before initializing the SDK.\n\n## Signed-in customers\n\nThe platforms expose different APIs. Do not assume every SDK has an `identify` or `setUser` method.\n\n| Platform | Customer context |\n| --- | --- |\n| Swift | `AppGramSDK.shared.setUser(...)`; call `clearUser()` on sign-out |\n| JavaScript embed | Initial `user` settings or the documented `setUser` method; reset the widget lifecycle on account changes |\n| React and React Native | Use the documented identity fields for the particular submission, vote, or support workflow |\n| Flutter | Use the documented input models for the particular workflow |\n\nOnly send the customer fields needed by that workflow. Customer context is not proof of management access. Support conversations can require their own ticket token or verification step; a display name or email field does not replace that credential.\n\n## Sign-out and account changes\n\nClear Swift customer context when the account signs out. For embeds, do not assume `setUser({})` clears all previous fields; remove the old widget and initialize a fresh customer session, or reload the owning page. Remove account-specific data from your own state and cached screens too.\n\nIf two projects share an application, supply the correct project configuration for the active surface. Avoid keeping a previous account's private support content on screen after changing users.\n\nContinue with the [platform setup guides](/guides/getting-started) or [troubleshooting](/guides/troubleshooting).\n\n","contentLocale":"en","isFallback":false,"authorship":{"authors":[],"contributors":[],"reviewedBy":[]}}