Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(embed): make the floating agent readable on light websites and stop its reads failing CORS on every host site

nirholas8ee538949263
diff --git a/data/changelog.json b/data/changelog.json
index b00e1bc1c..4738273c8 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,16 @@
{
"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-09-18",
+ "title": "The embedded 3D agent is readable on light websites and quiet in the console",
+ "summary": "Two fixes for anyone who has put a three.ws agent on their own site with the two-line embed. The floating widget had no background of its own, so on a light page its white button labels and name vanished into the page; it now has its own dark panel, and the suggestion buttons carry a solid ground, so it reads the same on any site. You can still ask for a transparent or light panel with the background attribute. The embed also made two background requests that browsers blocked on every site but ours, logging errors in the host page's console; those requests now succeed, and only the public, signed-out answer is ever shared across sites.",
+ "tags": [
+ "fix",
+ "sdk"
+ ],
+ "link": "/tutorials/embed-in-30-seconds"
+ },
{
"date": "2026-09-18",
"title": "Choose your chart everywhere a coin is charted, now including DEXTools",
diff --git a/tests/embed-read-cors.test.js b/tests/embed-read-cors.test.js
new file mode 100644
index 000000000..ba30406d1
--- /dev/null
+++ b/tests/embed-read-cors.test.js
@@ -0,0 +1,41 @@
+import { describe, it, expect } from 'vitest';
+import { embedReadCors } from '../api/_lib/http.js';
+
+// The <agent-3d> embed runs on websites we have never heard of and reads two
+// endpoints from there. Only the anonymous read may be opened to any origin.
+function call(method, headers, options) {
+ const sent = {};
+ const res = { setHeader: (k, v) => { sent[k] = v; }, getHeader: (k) => sent[k], end() {}, statusCode: 200 };
+ const ended = embedReadCors({ method, headers }, res, options);
+ return { origin: sent['access-control-allow-origin'] ?? null, credentials: sent['access-control-allow-credentials'] ?? null, methods: sent['access-control-allow-methods'], ended };
+}
+
+describe('embedReadCors', () => {
+ const stranger = 'https://bookshop.example';
+
+ it('opens an anonymous GET to any origin, without credentials', () => {
+ const got = call('GET', { origin: stranger });
+ expect(got.origin).toBe('*');
+ expect(got.credentials).toBeNull();
+ expect(got.ended).toBe(false);
+ });
+
+ it('gives a stranger nothing once the request carries a cookie or a token', () => {
+ expect(call('GET', { origin: stranger, cookie: 'sid=1' }).origin).toBeNull();
+ expect(call('GET', { origin: stranger, authorization: 'Bearer x' }).origin).toBeNull();
+ });
+
+ it('refuses a stranger\'s preflight for a write, and for a read that wants to send a token', () => {
+ const write = call('OPTIONS', { origin: stranger, 'access-control-request-method': 'PUT' }, { authedMethods: 'GET,PUT,DELETE,OPTIONS' });
+ expect(write.origin).toBeNull();
+ expect(write.ended).toBe(true);
+ const authed = call('OPTIONS', { origin: stranger, 'access-control-request-method': 'GET', 'access-control-request-headers': 'authorization' });
+ expect(authed.origin).toBeNull();
+ });
+
+ it('answers a plain GET preflight from a stranger', () => {
+ const got = call('OPTIONS', { origin: stranger, 'access-control-request-method': 'GET' });
+ expect(got.origin).toBe('*');
+ expect(got.ended).toBe(true);
+ });
+});