Skip to main content

getIsTossLoginIntegratedService

Checks whether the current user has linked their Toss login to this mini-app. Primarily used when migrating existing Toss login users to a different identity system (e.g., a game identifier). Returns undefined when the app version is below the minimum supported version. Throws when called from a mini-app that has not configured oauth2ClientId.

Signature

import { getIsTossLoginIntegratedService } from '@apps-in-toss/web-framework';

declare function getIsTossLoginIntegratedService(): Promise<boolean | undefined>;

Parameters

None.

Returns

Promise<boolean | undefined>

ValueMeaning
trueThe user has integrated Toss login.
falseThe user has not integrated Toss login.
undefinedThe app version is below the minimum supported version.
Throws on misconfiguration

If the mini-app has not configured oauth2ClientId, calling this function throws { message: "oauth2ClientId 설정이 필요합니다." }. Always wrap in try/catch.

Permission

No permission required — getIsTossLoginIntegratedService is not bound to any PermissionName. For how other namespaces handle permissions, see Guides — Permissions pattern.

Examples

Minimal

import { getIsTossLoginIntegratedService } from '@apps-in-toss/web-framework';

async function checkTossLogin() {
try {
const result = await getIsTossLoginIntegratedService();

if (result === undefined) {
console.warn('App version is too old — update required.');
return;
}

if (result) {
console.log('User has integrated Toss login.');
} else {
console.log('User has not integrated Toss login.');
}
} catch (error) {
console.error(error);
}
}

Realistic — migration branch logic

import { getIsTossLoginIntegratedService } from '@apps-in-toss/web-framework';
import { useEffect, useState } from 'react';

type MigrationState = 'checking' | 'integrated' | 'not-integrated' | 'unsupported' | 'error';

function MigrationManager() {
const [state, setState] = useState<MigrationState>('checking');

useEffect(() => {
(async () => {
try {
const result = await getIsTossLoginIntegratedService();
if (result === undefined) {
setState('unsupported');
} else {
setState(result ? 'integrated' : 'not-integrated');
}
} catch {
setState('error');
}
})();
}, []);

if (state === 'checking') return <p>Checking…</p>;
if (state === 'integrated') return <p>Toss login linked — migration available.</p>;
if (state === 'not-integrated') return <p>Toss login not linked — prompt new registration.</p>;
if (state === 'unsupported') return <p>Please update the app.</p>;
return <p>An error occurred — please try again.</p>;
}

Try it live

Run the getIsTossLoginIntegratedService card on the Auth page in sdk-example.

Open in sdk-example
  • appLogin — Start the Toss login flow.
  • getAnonymousKey — Retrieve an anonymous identifier without requiring login.

External references