env.getDeploymentId
Returns the unique identifier for the current mini-app deployment. The deployment ID is assigned per build and is useful for logging, debugging, and A/B test context tracking. Returns the same value as getAppsInTossGlobals().deploymentId.
Signature
getDeploymentId is exposed as a member of the env namespace object — it is not imported on its own.
import { env } from '@apps-in-toss/web-framework';
declare const env: {
getDeploymentId(): string;
};
Parameters
None.
Returns
string— the current deployment's unique identifier.
Permission
No permission required — env.getDeploymentId is not bound to a PermissionName. For the typical permission flow used by other namespaces, see Guides — Permissions pattern.
Examples
Minimal
import { env } from '@apps-in-toss/web-framework';
const deploymentId = env.getDeploymentId();
console.log('Deployment ID:', deploymentId);
Realistic — include deployment ID in error reports
import { env } from '@apps-in-toss/web-framework';
import { useEffect } from 'react';
function App() {
useEffect(() => {
const deploymentId = env.getDeploymentId();
window.addEventListener('unhandledrejection', (event) => {
// Include the deployment ID so you know which build triggered the error.
console.error('[error]', {
deploymentId,
reason: event.reason,
});
});
}, []);
return <main>{/* app content */}</main>;
}
Try it live
Open the Environment page in sdk-example and run the env.getDeploymentId card to inspect the result.
Related APIs
getAppsInTossGlobals— returns brand globals includingdeploymentId.getOperationalEnvironment— returns the current execution environment (toss/sandbox).getTossAppVersion— returns the Toss app version.
Related guides
- Guides — Permissions pattern — permission flow used by other namespaces (reference only;
env.getDeploymentIddoesn't require a permission). - Recipes — Deployment-ID-based error tracking
External references
@apps-in-toss/web-framework— SDK package. The actual exports are re-exported from@apps-in-toss/web-bridge.- Web standard counterpart: none — deployment ID is a mini-app platform concept with no direct Web standard equivalent.