Skip to main content

environment

A collection of functions for querying the runtime environment of a mini-app: device identifier, network status, platform OS, app version, locale, and more. Most functions are synchronous; only getNetworkStatus and getServerTime return a Promise.

Methods

MethodReturn typePurpose
env.getDeploymentIdstringMember of the env namespace. Returns the current deployment ID.
getAppsInTossGlobalsAppsInTossGlobalsReturns deployment ID, brand name, icon, and primary color.
getDeviceIdstringReturns the device's unique identifier.
getGroupIdstringReturns the group ID assigned by Apps in Toss.
getLocalestringReturns the user's locale. Defaults to 'ko-KR'.
getNetworkStatusPromise<NetworkStatus>Asynchronously returns the current network connection state.
getOperationalEnvironment'toss' | 'sandbox'Returns the current execution environment (toss or sandbox).
getPlatformOS'ios' | 'android'Returns the current platform OS.
getSafeAreaInsetsnumberDeprecated. Returns the safe area inset value.
getSchemeUristringReturns the scheme URI used at initial entry.
getServerTimePromise<number | undefined>Asynchronously returns the server-side Unix timestamp (ms).
getTossAppVersionstringReturns the Toss app version string.
isMinVersionSupportedbooleanChecks whether the current app version meets the specified minimum.

Permission

No permission required. None of the functions in the environment namespace are bound to a PermissionName, and none expose getPermission() / openPermissionDialog() helpers — for the typical permission flow used by other namespaces, see Guides — Permissions pattern.

Sync vs async

FunctionSync / Async
env.getDeploymentIdSync
getAppsInTossGlobalsSync
getDeviceIdSync
getGroupIdSync
getLocaleSync
getNetworkStatusAsync (Promise)
getOperationalEnvironmentSync
getPlatformOSSync
getSafeAreaInsetsSync (Deprecated)
getSchemeUriSync
getServerTimeAsync (Promise)
getTossAppVersionSync
isMinVersionSupportedSync

UX guidance

  • Use isMinVersionSupported for version gating. If a feature only works on newer app versions, check first with isMinVersionSupported and prompt the user to update if not met.
  • Use getServerTime for reward and expiry logic. Device time can be manipulated by users — always use getServerTime for deadline and reward eligibility decisions.
  • Don't use getSafeAreaInsets. This function is deprecated — migrate to SafeAreaInsets.get().
  • Don't use getDeviceId as a security key. Device IDs can change after a factory reset or OS upgrade. Use a server-side user ID for anything security-sensitive.

Try it live

Try all methods on the Environment page in sdk-example.

Open in sdk-example

External references