Spacecraft Bridge
Usage
Validate if in spacecraft
isEmbeddedInSpacecraft: () => Promise<boolean>
Call function isEmbeddedInSpacecraft, which returns true if currently in spacecraft
import { isEmbeddedInSpacecraft } from "@seibert/spacecraft-bridge";
(async () => {
const isEmbedded = await isEmbeddedInSpacecraft();
console.log("Is embedded in spacecraft?", isEmbedded);
})()
Check if spacecraft handles navigation
onNavigationToConfluenceContent: ({ contentId, spaceKey }: { contentId: string; spaceKey?: string }) => Promise<{ isResponsible: boolean }>
Call function onNavigationToConfluenceContent with contentId and spaceKey of the Space to navigate to.
import { onNavigationToConfluenceContent } from "@seibert/spacecraft-bridge";
onNavigationToConfluenceContent({
contentId: "1933581",
spaceKey: "Duck",
}).then((res) => console.log("RESULT NAV: ", res.isResponsible));