React SDK
plazbot/react Playground
Explora los componentes React del SDK. Selecciona un ejemplo, mira el codigo y el resultado en vivo.
Componente <Chat /> todo-en-uno con sugerencias y callbacks.
ChatBasico.tsx
import { Plazbot } from "plazbot";
import { PlazbotProvider, Chat } from "plazbot/react";
const sdk = new Plazbot({
apiKey: "pk_live_xxxx",
workspaceId: "ws_xxxx",
zone: "LA",
});
export function App() {
return (
<PlazbotProvider sdk={sdk} agentId="ag_xxxx">
<Chat
suggestedQuestions={[
"Buscar un contacto",
"Agendar una cita",
"Ver disponibilidad",
]}
showPoweredBy={true}
onMessage={(msg) => console.log("Mensaje:", msg)}
onActionExecuted={(action) => console.log("Accion:", action)}
/>
</PlazbotProvider>
);
}Preview
Cargando preview...
