Skip to main content

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.

Open in sdk-example

External references