AI agent instructions
AI agent instructions
Set up
Create a val in Val Town, copy the example’smain.ts into a file, and add an HTTP trigger.
In the val’s Environment Variables sidebar, set NOTTE_API_KEY from Notte. Set NOTTE_VALTOWN_TOKEN to a private invocation token you choose.
Send a POST request to the trigger URL with Authorization: Bearer <NOTTE_VALTOWN_TOKEN>. The response contains title and the closed browser’s session_id. Unauthenticated requests cannot create browser sessions.
How it connects
The handler uses Deno’s built-infetch with Notte’s session and page-execution APIs. The browser runs in Notte, so Val Town needs no browser binary or filesystem access. Cleanup runs on success and failure. The sample visits https://example.com; edit its task to browse another page.
The example’s README includes offline and live verification commands. See Val Town’s environment variables guide for managing your keys.
Verified locally with Deno 2.9.6 and real Notte browsers. Hosted Val Town execution has not been verified.