@tuxx/orbit-bridge
v0.1.4
Published
Orbit Bridge SDK for client-app chat, events, and command transport.
Maintainers
Readme
@tuxx/orbit-bridge
Client SDK for Orbit Bridge. It lets isolated client apps talk to Orbit without sharing databases or hosting.
import { createOrbitBridgeClient } from "@tuxx/orbit-bridge";
const orbit = createOrbitBridgeClient({
endpoint: "https://<orbit-project>.supabase.co/functions/v1/orbit-bridge",
anonKey: import.meta.env.VITE_ORBIT_ANON_KEY,
token: () => fetch("/api/orbit-token").then((res) => res.text()),
});
await orbit.track("booking_made", { booking_id: "bk_123" });
await orbit.messages.post({ body: "Can you check this invoice?" });
await orbit.requests.create({
type: "change_request",
title: "Update the homepage CTA",
body: "Please use Book a Call instead of Free Audit.",
});
const listener = orbit.commands.listen(async (command) => {
if (command.command_type === "orbit.ping") return { pong: true };
});The host app backend still mints short-lived tenant JWTs. Secrets stay on the host backend.
