@spectrum-ts/hono
v9.3.1
Published
Hono webhook adapter for spectrum-ts.
Readme
@spectrum-ts/hono
Hono webhook adapter for spectrum-ts.
Install
bun add spectrum-ts @spectrum-ts/hono honoUse
import { Spectrum } from "spectrum-ts";
import { spectrum } from "@spectrum-ts/hono";
import { Hono } from "hono";
const app = await Spectrum({
webhookSecret: process.env.SPECTRUM_WEBHOOK_SECRET,
});
const server = new Hono().route(
"/",
spectrum({
app,
onMessage: async (space, message) => {
if (message.content.type === "text") {
await space.send(`echo: ${message.content.text}`);
}
},
})
);See the spectrum-ts documentation for the full guide.
