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.

503 B
Raw Blame
// The signed-in caller for /api/duels/*: a session cookie or a bearer token.
// Returns { userId, viaSession } or null. Never throws.

import { getSessionUser, authenticateBearer, extractBearer } from '../_lib/auth.js';

export async function duelCaller(req) {
	const session = await getSessionUser(req);
	if (session) return { userId: session.id, viaSession: true };
	const bearer = await authenticateBearer(extractBearer(req));
	return bearer ? { userId: bearer.userId, viaSession: false } : null;
}