TypeScript SDK
What this lets you do
Create durable local image turns from TypeScript or JavaScript.What you need
- Node.js and pnpm
- A DreamLayer clone
- A running local runtime
Steps
1. Install from the clone
2. Create a local conversation
openSession with the one-time bootstrap token from the complete URL printed by ./dreamlayer; they must never embed the local token or a DreamLayer key in a browser bundle.
Confirm it worked
The callback prints durable job stages and ends withcompleted, failed, or cancelled. A completed turn contains one image asset.
Common errors
401: read the current local token after starting./dreamlayer; do not reuse a token from another machine or state directory.- Connection refused: start
./dreamlayerand use its loopback origin. - Invalid request: keep
operationwithin the supported V1 operations. - Browser key exposure: move managed API calls to trusted server code.