window. These globals are your gateway to AI inference, collaboration, identity, encryption, and navigation. This page covers how to access them safely and reliably.
The access pattern
Every shell API follows the same pattern: checkwindow first, then fall back to window.parent. This handles both direct injection and cases where your app is nested in an iframe hierarchy.
The integration module
Rather than scatteringwindow.OasisHost ?? window.parent?.OasisHost throughout your codebase, create a single webai.js module as your integration layer:
Available APIs
OasisHost — On-device AI inference
OasisHost — On-device AI inference
Run AI models locally. Acquire the runtime, stream completions token-by-token, and check model status — all without network requests.
Full OasisHost reference →
| Method | Description |
|---|---|
acquire(options) | Lock the AI runtime for exclusive use. Returns a release function |
request(prompt, options) | Send a prompt and receive a streamed completion |
release() | Release the runtime lock |
getStatus() | Get current model and runtime state |
CollaborationManager — P2P spaces and state sync
CollaborationManager — P2P spaces and state sync
Host or join peer-to-peer collaboration spaces. Broadcast state changes, receive updates from other users, and let the platform handle networking and conflict resolution.
Full CollaborationManager reference →
| Method | Description |
|---|---|
hostRoom(options) | Create a new collaboration space |
joinRoom(code, password) | Join an existing space by code |
disconnect() | Leave the current space and disconnect |
getRoomSettings() | Get current space settings (name, public/private, etc.) |
getUsers() | Get the map of connected users |
sendChatMessage(text) | Send a message to the space chat |
requestLock(fieldKey) | Lock a field for editing |
releaseLock(fieldKey) | Release an edit lock |
UserIdentityManager — Identity and authentication
UserIdentityManager — Identity and authentication
Access the current user’s device identity (), display name, and authentication headers for communication.
Full identity reference →
| Method | Description |
|---|---|
getOrCreateIdentity() | Returns the user’s ODID and display name |
getAuthHeaders() | Returns authentication headers for P2P requests |
ApogeeShell — Navigation and view routing
ApogeeShell — Navigation and view routing
E2ECrypto — End-to-end encryption
E2ECrypto — End-to-end encryption
Encrypt and decrypt data for secure peer-to-peer communication. Used internally by the collaboration system and available for your own encrypted data flows.Full encryption reference →
Handling the dev environment
When running locally (outside the webAI shell), all APIs returnnull. Here’s a clean way to handle this across frameworks:
- React
- Vue