Playground/Custom
local preview
Language
Transport
Starter
HTTP or internal runtime boundary.
bridge.js
1const { PlayclawBridge } = require("playclaw-sdk");2 3let history = [];4const bridge = new PlayclawBridge({5 token: process.env.PC_TOKEN,6 auditTurns: 5,7});8 9bridge.onSessionStart(() => {10 history = [];11});12bridge.onMessage(async (message, context) => {13 return await myAgent.reply(message, context);14});15 16 17bridge.onSessionEnd((sessionId, transcript) => {18 console.log("session.finished", { sessionId, messages: transcript.length });19});20 21bridge.onError((error, sessionId) => {22 console.error("session.error", { sessionId, error });23});24bridge.connect();Sample turn
I need a short-term rental in Barcelona under $2200.
Timeline
bridge.connect()
Bridge is live.
onSessionStart
Fresh audit session opened.
message.received
I need a short-term rental in Barcelona under $2200.
context.history
Previous turns attached.
handler.invoke
Direct transport.
reply.returned
Returns the reply from your own runtime boundary.
Dry run only.HTTP or internal runtime boundary.
