Skip to main content
An interactive artifact is a Project whose HTML runs its own scripts. A poll, a checklist or a small task board can read and change shared data collections. The data is kept with the artifact, so it is still there after a reload, and everyone who opens the artifact sees the same state. The scripts never run on the Crewship site and never receive a Crewship credential. They run in a sandboxed frame on the separate application domain that Page applications use. The only way they can reach data is a small runtime, window.crewship. The viewer’s browser passes each call on to the server, and the server applies the same permissions as for the viewer’s own requests.
Interactive artifacts are off by default. All of the following must be on:A workspace owner or admin turns on the flags with crewship feature-flag enable artifact_projects, crewship feature-flag enable artifact_dashboard_data and crewship feature-flag enable artifact_interactive (see feature-flag). An operator can turn the last one on for every workspace with CREWSHIP_ARTIFACT_INTERACTIVE_ENABLED=true.With artifact_interactive off, nothing changes: a Project that contains interactive.json opens as an ordinary, script-free preview.

How an interactive artifact is put together

An interactive artifact is a Project with two extra JSON files: The HTML screens hold the markup, inline <style> and inline <script> elements. Scripts run in document order; type="module" is supported. CSS files of the Project apply to every screen. Links to other screens do nothing inside a running screen; switch screens with the bar above the preview, or build the page as one screen that changes its own content.

Create one

Ask an agent for a Project as described in Projects, and say that it should be interactive, include interactive.json and dashboard.json, and keep its state in the declared collections. From the command line, put all files in one manifest and create the Project:
To check that the server treats it as interactive, run crewship page artifact get lunch-poll. With every switch on, the output has an interactive object with runtime_url (the separate application domain; empty when none is configured) and the declared collections. Without it the Project opens as an ordinary preview.

Open it

1

Open the artifact

Open Artifacts, select the Project and click Open. The address is /artifacts/<id>.
2

Use it

Preview shows Loading interactive artifact… until the page’s scripts have started, then the page itself. Clicks and typing go to the page.
3

Comment on it

Press Select to comment on an element. While Select is on, the preview shows the screen without running its scripts, so comments anchor to stable markup. Turn Select off to use the page again.
A second person sees the same data when they open the artifact. A page that wants to show other people’s changes calls crewship.data.get again, for example on a button or a timer; the runtime does not push changes.

The runtime: window.crewship

Every call returns a promise. A refused call rejects with an Error whose code is one of invalid, forbidden, conflict, limit or unavailable. The current interactive Dashboard can use preferences for view state such as a filter. Other previews do not expose a storage backend. Preferences stay in the viewer’s browser (local storage, keyed by person, workspace and artifact): they are never sent to the server, other Crewship accounts never get them, and anyone, including a reader without edit access, can save their own. They stay in this browser after you sign out (anyone using the same browser profile could read them there); clearing the browser’s site data forgets them, and a private window forgets them when it closes. There is no delete; write a value such as {"done": true} instead. A conflict means someone wrote the document after you read it. Nothing was overwritten. Read again, decide, and write with the new version. Do not retry the same write.

Who can do what

Each call is made with the viewer’s own session. The server decides with the same rules as for Dashboard data: A workspace owner or admin can also read the data of any version of the artifact; each such read is recorded in the audit log. Writing still needs ownership or edit access. Interactive data is not stricter than Dashboard data: an editor’s script can change the shared collections just as the editor can from the CLI. Give edit access only to people you trust to change that data. When the viewer has no edit access, or is looking at an older version, the browser refuses crewship.data.batch itself with forbidden before anything is sent. People without access to the artifact cannot open it at all.

What the page can and cannot do

The page runs in a frame with sandbox="allow-scripts" on a separate site, under a policy that blocks network access. If the page navigates its frame away, the viewer stops it with The artifact navigated away from its verified document and was stopped.
Treat an interactive artifact like code you run. It can read every collection it declares that you can read, and it shows you whatever it wants. A script can still send data out by navigating its own frame to another address (the viewer then stops it), so open interactive artifacts only from authors you trust, as you would a Page application.

Limits

Messages you may see