Three ways to integrate Chawso JSON into your app: iframe widget, postMessage API, or the React component.
For React applications, use the jsoncrack-react package for a native integration with full control over props and callbacks. See the npm page for the full API reference and latest documentation.
The simplest way to embed Chawso JSON. Add an iframe pointing to /widget and it will render an interactive graph viewer.
Pass a json query parameter with a URL to automatically fetch and display remote data. This works on both the widget and the editor page.
For dynamic updates, use the postMessage API to send JSON data and display options to the widget at any time.
Important: The iframe must be defined before the script tag. The widget posts a { type: "chawso-json:ready", id } message to the parent when ready — listen for this message before sending data. id is the iframe's id attribute on same-origin embeds and null on cross-origin embeds; the type field is the reliable signal in both cases. The widget accepts postMessage data from any origin so any site can embed it; only embed it in pages you control.