Reading the current player and handling guest sessions
Identity is resolved by the SusaPlay shell before your game starts. There is no login flow to
build and no identity call to make — by the time Initialize() returns, the player is known.
Players can start without an account and play as a guest.
if (SusaPlaySDK.Auth.IsGuest){ // Offer a "sign in to keep your progress" prompt at a natural break — // a guest has no platform session.}
A guest has no platform session, so cloud saves, achievements, the wallet and inventory,
analytics and webhook events are refused (401) until the player signs in. Design guest play to
work without them: keep a guest’s progress locally and save it after sign-in.
Nothing carries over automatically when a guest signs in. A guest earns no platform coins for
rewarded ads, but your game’s own reward for a watched ad works for a guest too. The game does not
drive the sign-in.A guest’s Uid is null; it is set when the player signs in.
The SDK attaches the player’s token to every platform request for you.When your own backend must identify the player, get a session token and send it with your
request:
string token = await SusaPlaySDK.Auth.GetSessionTokenAsync(); // null for a guest
The token is short-lived and scoped to your game, so fetch it each time rather than storing it.
Your server checks it with POST https://europe-west1-susaplay-2e8e3.cloudfunctions.net/identity/verify-game-session
and body {"token": "..."}; the answer carries uid, gameId, displayName and expiresAt.To tell your own server what happens in the game without a request of your own, send a
webhook event: SusaPlay forwards it with the player’s id and a signature your
server verifies. SusaPlaySDK.Api is not
for your own server — it reaches a partner’s API inside a partner embed
(Api and Backend).
Never trust a player id sent from the client. Verify it server-side on every request that grants
anything.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"SusaPlay Docs","colors":{"primary":"#6C3CE1","light":"#9B6FF5","dark":"#4B1FA8"},"logo":{"light":"https://mintcdn.com/susa-games/tc5ieC1rmNcALyA0/logo/susaplay.png?fit=max\u0026auto=format\u0026n=tc5ieC1rmNcALyA0\u0026q=85\u0026s=e2d2a36109c2177b50297d9786b0def0","dark":"https://mintcdn.com/susa-games/tc5ieC1rmNcALyA0/logo/susaplay.png?fit=max\u0026auto=format\u0026n=tc5ieC1rmNcALyA0\u0026q=85\u0026s=e2d2a36109c2177b50297d9786b0def0","href":"https://susaplay.com"},"favicon":"https://mintcdn.com/susa-games/qLj6_iprcS9lj_wA/favicon.png?fit=max\u0026auto=format\u0026n=qLj6_iprcS9lj_wA\u0026q=85\u0026s=c6a3914009a9bd9098f12d93eadd1244","navbar":{"links":[{"href":"https://susaplay.com","label":"Play games"},{"href":"mailto:support@susaplay.com","label":"Support"}],"primary":{"type":"button","label":"Developer Portal","href":"https://dev.susaplay.com"}},"footer":{"socials":{"website":"https://susaplay.com","github":"https://github.com/Susa-Games"},"links":[{"header":"SusaPlay","items":[{"label":"Play games","href":"https://susaplay.com"},{"label":"For developers","href":"https://susaplay.com/developers"},{"label":"Developer Portal","href":"https://dev.susaplay.com"}]},{"header":"Company","items":[{"label":"Susa Games","href":"https://www.susa.games"},{"label":"Publishing terms","href":"https://susaplay.com/publishing-terms"}]}]},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"susa-games","hasAudioNarration":false,"actualSubdomain":"susa-games","customDomains":["docs.susaplay.com"],"gitSource":{"type":"github","owner":"susa-games","repo":"mintlify-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae98e109590fbaa65dae8d9","clientVersion":"0.0.4102","searchFilterCounts":[{"language":"default","tag":"Integration","count":10},{"language":"default","tag":"SDK","count":10},{"language":"default","tag":"Getting Started","count":2},{"language":"default","tag":"API","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"sdk/identity","slug":"/sdk/identity","pageMetadata":{"title":"Identity","description":"Reading the current player and handling guest sessions","href":"/sdk/identity"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Reading the current player and handling guest sessions\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Identity is resolved by the SusaPlay shell before your game starts. There is no login flow to\nbuild and no identity call to make — by the time `,_jsx(_components.code,{children:`Initialize()`}),` returns, the player is known.`]}),`\n`,_jsx(Heading,{level:`2`,id:`reading-the-current-player`,children:`Reading the current player`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` SusaPlaySDK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Initialize`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`string`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` uid`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` SusaPlaySDK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Uid`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`string`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` SusaPlaySDK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`DisplayName`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`]})})}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Property`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`Uid`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`Platform player id. Stable for signed-in players; null for a guest.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`DisplayName`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`string`})}),_jsx(_components.td,{children:`Null for a guest.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`IsGuest`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`bool`})}),_jsx(_components.td,{children:`True when the player has not signed in.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`IsAuthenticated`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`bool`})}),_jsx(_components.td,{children:`True when the player has an account.`})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`SusaPlaySDK.Auth`}),` itself is null until `,_jsx(_components.code,{children:`Initialize()`}),` completes, so reading `,_jsx(_components.code,{children:`Auth.Uid`}),` before\nthat throws. Await `,_jsx(_components.code,{children:`Initialize()`}),` first.`]}),`\n`,_jsx(Heading,{level:`2`,id:`guest-sessions`,children:`Guest sessions`}),`\n`,_jsx(_components.p,{children:`Players can start without an account and play as a guest.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`SusaPlaySDK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`IsGuest`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Offer a \"sign in to keep your progress\" prompt at a natural break —`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // a guest has no platform session.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`A guest has no platform session, so cloud saves, achievements, the wallet and inventory,\nanalytics and webhook events are refused (`,_jsx(_components.code,{children:`401`}),`) until the player signs in. Design guest play to\nwork without them: keep a guest’s progress locally and save it after sign-in.`]}),`\n`,_jsx(Heading,{level:`2`,id:`signing-in`,children:`Signing in`}),`\n`,_jsx(_components.p,{children:`Nothing carries over automatically when a guest signs in. A guest earns no platform coins for\nrewarded ads, but your game’s own reward for a watched ad works for a guest too. The game does not\ndrive the sign-in.`}),`\n`,_jsxs(_components.p,{children:[`A guest’s `,_jsx(_components.code,{children:`Uid`}),` is null; it is set when the player signs in.`]}),`\n`,_jsx(Heading,{level:`2`,id:`authentication-tokens`,children:`Authentication tokens`}),`\n`,_jsx(_components.p,{children:`The SDK attaches the player’s token to every platform request for you.`}),`\n`,_jsx(_components.p,{children:`When your own backend must identify the player, get a session token and send it with your\nrequest:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`string`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` token`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` SusaPlaySDK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Auth`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetSessionTokenAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// null for a guest`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The token is short-lived and scoped to your game, so fetch it each time rather than storing it.\nYour server checks it with `,_jsx(_components.code,{children:`POST https://europe-west1-susaplay-2e8e3.cloudfunctions.net/identity/verify-game-session`}),`\nand body `,_jsx(_components.code,{children:`{\"token\": \"...\"}`}),`; the answer carries `,_jsx(_components.code,{children:`uid`}),`, `,_jsx(_components.code,{children:`gameId`}),`, `,_jsx(_components.code,{children:`displayName`}),` and `,_jsx(_components.code,{children:`expiresAt`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`To tell your own server what happens in the game without a request of your own, send a\n`,_jsx(_components.a,{href:`/sdk/webhooks`,children:`webhook event`}),`: SusaPlay forwards it with the player’s id and a signature your\nserver verifies. `,_jsx(_components.code,{children:`SusaPlaySDK.Api`}),` is not\nfor your own server — it reaches a partner’s API inside a partner embed\n(`,_jsx(_components.a,{href:`/sdk/api-and-backend`,children:`Api and Backend`}),`).`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Never trust a player id sent from the client. Verify it server-side on every request that grants\nanything.`})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Identity","description":"Reading the current player and handling guest sessions","href":"/sdk/identity"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Reading the current player","slug":"reading-the-current-player","depth":2,"children":[]},{"title":"Guest sessions","slug":"guest-sessions","depth":2,"children":[]},{"title":"Signing in","slug":"signing-in","depth":2,"children":[]},{"title":"Authentication tokens","slug":"authentication-tokens","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"susa-games","siteName":"SusaPlay Docs","title":"Identity - SusaPlay Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-13T12:06:33.891Z","originalFileLocation":"sdk/identity.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Reading the current player and handling guest sessions\">\u003cmeta data-mint-head name=\"application-name\" content=\"SusaPlay Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/susa-games/pKNW_aZ0TZr3Fbcu/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/susa-games/pKNW_aZ0TZr3Fbcu/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/susa-games/pKNW_aZ0TZr3Fbcu/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/susa-games/pKNW_aZ0TZr3Fbcu/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/susa-games/pKNW_aZ0TZr3Fbcu/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/susa-games/pKNW_aZ0TZr3Fbcu/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/susa-games/pKNW_aZ0TZr3Fbcu/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/susa-games/pKNW_aZ0TZr3Fbcu/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/susa-games/pKNW_aZ0TZr3Fbcu/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Identity - SusaPlay Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Reading the current player and handling guest sessions\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"SusaPlay Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.susaplay.com/sdk/identity\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://susa-games.mintlify.site/_mintlify/api/og/v2?division=SDK\u0026amp;title=Identity\u0026amp;description=Reading+the+current+player+and+handling+guest+sessions\u0026amp;theme=feefa472940547bfe1a15ca6\u0026amp;signature=ef10b3c84d4daff22aa80f8499c1d0a032af4ad9138caad7e3e343bb63613e58\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Identity - SusaPlay Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Reading the current player and handling guest sessions\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://susa-games.mintlify.site/_mintlify/api/og/v2?division=SDK\u0026amp;title=Identity\u0026amp;description=Reading+the+current+player+and+handling+guest+sessions\u0026amp;theme=feefa472940547bfe1a15ca6\u0026amp;signature=ef10b3c84d4daff22aa80f8499c1d0a032af4ad9138caad7e3e343bb63613e58\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/susa-games/pKNW_aZ0TZr3Fbcu/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"SusaPlay Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#6C3CE1\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.susaplay.com/sdk/identity\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/sdk/identity.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.susaplay.com/#organization\",\"name\":\"SusaPlay Docs\",\"url\":\"https://docs.susaplay.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/susa-games/tc5ieC1rmNcALyA0/logo/susaplay.png?fit=max\u0026auto=format\u0026n=tc5ieC1rmNcALyA0\u0026q=85\u0026s=e2d2a36109c2177b50297d9786b0def0\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.susaplay.com#website\",\"name\":\"SusaPlay Docs\",\"url\":\"https://docs.susaplay.com\",\"publisher\":{\"@id\":\"https://docs.susaplay.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.susaplay.com/sdk/identity#webpage\",\"url\":\"https://docs.susaplay.com/sdk/identity\",\"name\":\"Identity\",\"description\":\"Reading the current player and handling guest sessions\",\"dateModified\":\"2026-10-13T12:06:33.891Z\",\"isPartOf\":{\"@id\":\"https://docs.susaplay.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.susaplay.com/sdk/identity#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.susaplay.com/sdk/identity#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"SDK\",\"item\":\"https://docs.susaplay.com/sdk/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Identity\",\"item\":\"https://docs.susaplay.com/sdk/identity\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.susaplay.com/sdk/identity#article\",\"headline\":\"Identity\",\"name\":\"Identity\",\"description\":\"Reading the current player and handling guest sessions\",\"url\":\"https://docs.susaplay.com/sdk/identity\",\"mainEntityOfPage\":{\"@id\":\"https://docs.susaplay.com/sdk/identity#webpage\"},\"dateModified\":\"2026-10-13T12:06:33.891Z\",\"publisher\":{\"@id\":\"https://docs.susaplay.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.susaplay.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"SusaPlay Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"SusaPlay Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/sdk/identity.md","siteName":"SusaPlay Docs","nav":{"global":null,"groups":[{"group":"Getting Started","pages":[{"title":"Introduction","href":"/index"},{"title":"Quickstart","href":"/quickstart"}]},{"group":"Integration","pages":[{"title":"Register a Game","href":"/integration/register-game"},{"title":"API Keys","href":"/integration/api-keys"},{"title":"AI Tools","href":"/integration/ai-tools"},{"title":"SDK Integration","href":"/integration/sdk"},{"title":"Economy Config","href":"/integration/economy"},{"title":"Cloud Saves","href":"/integration/saves"},{"title":"Webhooks","href":"/integration/webhooks"},{"title":"Build Uploads","href":"/integration/builds"},{"title":"Addressables","href":"/integration/addressables"},{"title":"Release Review","href":"/integration/release-review"}]},{"group":"SDK","pages":[{"title":"SDK Overview","description":"SusaPlay SDK — installation, modules, and initialization","href":"/sdk/overview"},{"title":"Identity","href":"/sdk/identity"},{"title":"Economy","description":"Platform wallet, store catalogue, and purchases","href":"/sdk/economy"},{"title":"Saves","href":"/sdk/saves"},{"title":"Analytics","href":"/sdk/analytics"},{"title":"Achievements","href":"/sdk/achievements"},{"title":"Ads","href":"/sdk/ads"},{"title":"Webhooks","href":"/sdk/webhooks"},{"title":"Api and Backend","href":"/sdk/api-and-backend"},{"title":"Test in the Unity Editor","href":"/sdk/editor-simulator"}]},{"group":"API","pages":[{"title":"API Contract","href":"/api/reference"}]}]},"basePath":"","title":"Identity - SusaPlay Docs","buildId":"dpl_596ePT575z4qnAFksq1biRW97aLY","deploymentId":"dpl_596ePT575z4qnAFksq1biRW97aLY","dynamics":[],"chunks":[]}