Server SDK (Node)
Coming soon —
@cobuntu/sdkwill be a typed Node/TS wrapper around the REST API + averifyWebhookSignaturehelper. Until it ships, calling the REST API directly viafetchworks identically and is whatorbis-entry+dddimo-entrydo in production today.
Preview
import { Cobuntu } from "@cobuntu/sdk";
const cobuntu = new Cobuntu({
apiKey: process.env.COBUNTU_SECRET_KEY!,
communityTag: "my-community",
});
// List events
const events = await cobuntu.events.list({ upcomingOnly: true, limit: 10 });
// Verify a webhook
import { verifyWebhookSignature } from "@cobuntu/sdk";
app.post("/webhook", (req, res) => {
const ok = verifyWebhookSignature({
header: req.get("Cobuntu-Signature"),
body: req.rawBody,
secret: process.env.COBUNTU_WEBHOOK_SECRET!,
});
if (!ok) return res.status(401).end();
// …
});What's available today
The @cobuntu/sdk typed client is the next package to land.