PlanewardPlaneward Docs
PlanewardPlaneward Docs
Welcome

Developers

REST APIAuthenticationWebhooksMCPMCP journeyEmbedded projectsTask description contentDeveloper hub
Planeward appsQuickstartIdentity tokenApp permissionsThemeAPI accessApp webhooksTesting your appList your app in the directorypostMessage protocol

API

Planeward apps

Theme

Match the look of the community or dashboard your app runs in.

The host tells your app whether it is in light or dark mode, and what it looks like, so your app can match it.

What the host sends

  • context.theme — "light" or "dark".
  • context.appearance (since @planeward/sdk 0.2.6) — the host's look in the current mode:
    • colors — shadcn token names without the --: background, foreground, card, popover, primary, secondary, muted, accent, destructive, each with its -foreground, plus border, input, ring, chart-1 to chart-5 and the sidebar tokens.
    • radius — the corner radius, such as 0.625rem.
    • font — { family, stylesheets }: a CSS font-family value and the stylesheets that load it.

Where the values come from:

  • In a community channel, they are what the member sees, including the community's Custom CSS.
  • On the dashboard, they are Planeward's own colours and the Geist font.

When the viewer switches between light and dark, the host sends the other mode's colours.

Fonts

The community's font and its Google Fonts stylesheet are sent. Fonts uploaded to the community are not, so family falls back to the rest of its stack. Stylesheets are only ever https://fonts.googleapis.com/ URLs.

Apply it

import { applyAppearance, createPlanewardApp } from "@planeward/sdk";

const app = createPlanewardApp();
await app.ready;

applyAppearance(app.context?.appearance);
app.onThemeChange((theme, appearance) => applyAppearance(appearance));

applyAppearance sets CSS variables on <html> (--primary, --background, --radius, --font-sans, …) and adds a <link> for each font stylesheet. Calling it again replaces the previous values. It returns a cleanup that removes what it set.

The SDK sanitises the values; anything unknown or unsafe is dropped. If your app has its own look, don't call it.

The app template does this already, in PlanewardThemeSync.

Test it

The planeward dev emulator (CLI 0.1.9 and later) has a Host appearance picker. Choose Planeward default or Sample brand to check that your app re-skins, and switch light and dark to check both modes. See Testing your app.

App permissions

Declare your app's own permissions, let workspaces grant them, and check them from the viewer token.

API access

Call Planeward from your app's backend with the app secret.

On this page

What the host sendsFontsApply itTest it