auth
Namespace for authentication-related functions: Toss login flow, Toss Cert (electronic signature), anonymous key retrieval, and Toss login integration checks. All functions return a Promise.
Methods
| Method | Return type | Purpose |
|---|---|---|
appLogin | Promise<{ authorizationCode: string; referrer: 'DEFAULT' | 'SANDBOX' }> | Start the Toss login flow and receive an authorization code. |
appsInTossSignTossCert | Promise<void> | Sign with the Toss Cert certificate. Must be called after appLogin. |
getAnonymousKey | Promise<{ type: 'HASH'; hash: string } | 'ERROR' | undefined> | Retrieve an anonymous identifier without requiring login. |
getIsTossLoginIntegratedService | Promise<boolean | undefined> | Check whether the user has integrated Toss login. |
getUserKeyForGame | Promise<{ key: string } | 'INVALID_CATEGORY' | 'ERROR' | undefined> | Deprecated. Game-session anonymous key. Use getAnonymousKey instead. |
Permission
No PermissionName is bound to any function in the auth namespace — none expose .getPermission() / .openPermissionDialog() helpers. The appLogin call automatically surfaces the user consent screen. For how other namespaces handle permissions, see Guides — Permissions pattern.
UX guidance
- Call
appLoginonly in response to an explicit user action. A login button tap, the start of a payment flow, etc. Auto-calling on page load is not recommended. - Forward the authorization code to your server immediately. The
authorizationCodereturned byappLoginis a short-lived token — do not store it on the client. - Complete
appLoginbefore callingappsInTossSignTossCert. Invoking the cert-signing call without an active login session may fail. - Handle all three
getAnonymousKeyoutcomes.undefinedmeans the app version is too old;'ERROR'means an unknown error occurred; only the success object contains a usablehash. getIsTossLoginIntegratedServiceis for migration scenarios. Use it when migrating existing Toss login users to a game identifier or another identity system.
Try it live
Methods are available on the Auth page in sdk-example.
Open in sdk-exampleExternal references
@apps-in-toss/web-framework— SDK package. The actual exports are re-exported from@apps-in-toss/web-bridge.