@flow-state-dev/devtool/react
Type Aliases
DevToolConfig
type DevToolConfig = object;
Properties
bearerToken?
bearerToken?: string;
Bearer token sent as Authorization: Bearer on every flow request. Set
from the app's fsdev.config.ts devtool.bearerToken (injected by
fsdev dev) or the Settings sheet. Undefined means no auth header.
userId
userId: string;
DevToolPanelProps
type DevToolPanelProps = object;
Public entry for @flow-state-dev/devtool/react — the embeddable
<DevToolPanel /> component plus the helpers a host needs to construct
its own initial config (e.g. read the standalone shell's persisted userId
from localStorage).
Properties
autoRecoverInterrupted?
autoRecoverInterrupted?: boolean;
Run an interrupted-request sweep on mount. Defaults to false so embedded panels don't cause side effects in the host app — opt in (e.g. the standalone shell) when the panel is the primary surface.
baseUrl?
baseUrl?: string;
Optional API base URL; defaults to same-origin.
bearerToken?
bearerToken?: string;
Bearer token sent as Authorization: Bearer on flow requests, for
debugging bearer-gated flows. Under fsdev dev this comes from the app's
fsdev.config.ts devtool.bearerToken; embedded hosts usually omit it.
className?
className?: string;
Optional outer class on the panel root.
openSessionId?
openSessionId?: string;
A session to open on mount, with the instance that owns it — a link to one
run. The standalone shell passes the page's ?session=<id> (see
readSessionAddress). The server's ownership check still decides.
userId
userId: string;
Identity used for all DevTool client traffic. The host owns it.
userIdControl?
userIdControl?: UserIdControl;
"host" hides the SettingsSheet's userId editor (recommended for
embedded mounts). Defaults to "internal" for standalone use.
FlowStateMarkProps
type FlowStateMarkProps = Omit<SVGAttributes<SVGSVGElement>, "viewBox"> & object;
Type Declaration
title?
title?: string;
Accessible name. Omit for a decorative mark (the default).
UserIdControl
type UserIdControl = "host" | "internal";
Whether the SettingsSheet exposes the userId editor.
Variables
SESSION_ADDRESS_PARAM
const SESSION_ADDRESS_PARAM: "session" = "session";
The query parameter a link to one run carries: ?session=<id>.
Functions
DevToolPanel()
function DevToolPanel(__namedParameters): Element;
Public entry for @flow-state-dev/devtool/react — the embeddable
<DevToolPanel /> component plus the helpers a host needs to construct
its own initial config (e.g. read the standalone shell's persisted userId
from localStorage).
Parameters
__namedParameters
Returns
Element
FlowStateMark()
function FlowStateMark(__namedParameters): Element;
flow-state.dev brand mark — three overlapping loops knocked out of an ink
tile. Paints from the panel's --fs-ink / --fs-paper tokens, so it
follows the active theme; outside the panel it falls back to Paper ink.
Parameters
__namedParameters
Returns
Element
hasInjectedUserId()
function hasInjectedUserId(): boolean;
True when fsdev dev injected a non-blank userId into the page global.
Returns
boolean
readBasePath()
function readBasePath(): string;
The path prefix the page is served under, from its <base href>: "" at the
root of its origin, "/teammates" when a proxy serves it at /teammates/.
Prefix the API's baseUrl and the page's own addresses with it. "" with no
window or no <base> element.
Returns
string
readBearerToken()
function readBearerToken(): string | undefined;
Bearer token injected from fsdev.config.ts, if any. Never persisted.
Returns
string | undefined
readDevtoolUrl()
function readDevtoolUrl(): string | undefined;
The DevTool served beside this page, read from the fsdev-devtool-url meta
fsdev dev --app writes into every page it serves. undefined when no
DevTool is served (the meta is absent), during a prerender, or when the meta
holds anything but an http(s) address. Hide a trace link when it is undefined.
Returns
string | undefined
readSessionAddress()
function readSessionAddress(): string | undefined;
The session id the page's address names (?session=<id>), or undefined.
The standalone shell hands it to DevToolPanel's openSessionId, so a link
such as Shift Manager's Open trace opens that run without a paste.
Returns
string | undefined
readUserId()
function readUserId(): string;
Returns
string
traceHref()
function traceHref(devtoolUrl, sessionId?): string;
The DevTool address that opens one session: devtoolUrl with
?session=<id> (SESSION_ADDRESS_PARAM), which the DevTool follows to
the session and the flow copy that owns it. With no session, the DevTool
itself. devtoolUrl must parse as a URL; readDevtoolUrl only returns
one that does.
Parameters
devtoolUrl
string
sessionId?
string
Returns
string
withBearerToken()
function withBearerToken(bearerToken): ClientFetch | undefined;
A fetch that adds Authorization: Bearer <token> to every request, for a
client's fetcher. undefined when no token is set, so the client uses
the plain fetch. Shared with Shift Manager, which reads the Lab the same
way.
Parameters
bearerToken
string | undefined
Returns
ClientFetch | undefined
writeUserId()
function writeUserId(userId): void;
Parameters
userId
string
Returns
void