For the complete documentation index, see llms.txt. This page is also available as Markdown.

getAppsInTossGlobals

功能说明

获取 Apps in Toss 的全局值。包含部署 ID 和品牌信息(名称、图标、主色)。

由于是常量值,无论何时调用都会同步返回相同的值。

类型

getAppsInTossGlobals(): AppsInTossGlobals;

参数

返回值

type AppsInTossGlobals = {
  deploymentId: string;
  brandDisplayName: string;
  brandIcon: string;
  brandPrimaryColor: string;
};

示例代码

import { getAppsInTossGlobals } from "@apps-in-toss/web-framework";

const { brandDisplayName, brandPrimaryColor } = getAppsInTossGlobals();

document.querySelector("#brand-name").textContent = brandDisplayName;
document.querySelector("#header").style.backgroundColor = brandPrimaryColor;

这有帮助吗?