> ISPO SDK documentation. [HTML](https://ispo.ai/docs/documents/Quickstart.html) · [Documentation index](https://ispo.ai/docs/llms.txt)

# <a id="connect-your-app"></a>Connect your app

Create a project in ISPO, then use the `@ispo/sdk` dependency supplied by its scaffold. Keep the project's existing build setup. Read the local `ispo-sdk` skill for the capabilities available in your installed host.

## <a id="connect-once"></a>Connect once

The host-generated bootstrap calls `connectToHost()` before loading your app. Scaffolded and imported apps must not call it again. Only a custom direct entry that bypasses that bootstrap calls it once. It installs the host bridge, theme delivery, and focus handling. Do not install a second bridge or a global Tab trap. A custom entry that owns the connection releases its handle with `disconnect()` on disposal.

## <a id="publish-a-file"></a>Publish a file

The following code defines an action for an Export button. It publishes text to the user's Files library and returns the host's receipt.

```
import { files } from '@ispo/sdk'export async function exportNotes(text: string) {  return files.publish({    name: 'notes.md',    mimeType: 'text/markdown',    content: text,  })}
```

Before using this action, the project must request `files: ["publish"]` in its `requests` declaration and the user must grant access. Adding a declaration to an already admitted project does not change its reviewed access automatically. See [Permissions and errors](Permissions_and_errors.md).

Use `files.pick()` when the user should choose an existing file, or `files.save()` when the user should choose where new bytes go. A picker returning `null` means the user cancelled.

## <a id="check-the-result"></a>Check the result

Run the project's typecheck, wait for a fresh ISPO build, and exercise the action inside the app. Display the returned Files path after successful publication. Handle denial and cancellation as ordinary states.

For a standalone browser tab, the SDK's `enableBrowserMock()` can support development. Mocks do not grant host access or prove that a protected operation works in ISPO.
