Context
platform.context.self
Answers the question about who you are.
Type
{ widgetId; version;}
Example
import { platformProps } from "@1fe/shell";
function MySimpleComponent(props: WidgetProps) { return ( <div> <h1>Who am I?</h1> <pre>widgetId: {platformProps.context.self.widgetId}</pre> <pre>widgetVersion: {platformProps.context.self.version}</pre> </div> );}
platform.context.getHost
Answers the question about who is hosting you.
This is only offered for insights and logging purposes.
Type
function getHost(): { id: widgetId;};
Example
import { platformProps } from "@1fe/shell";
function MySimpleComponent(props: WidgetProps) { return ( <div> <h1>Who is hosting me?</h1> <pre>widgetId: {platformProps.context.getHost().id}</pre> </div> );}