Public API v1 • SDK • Walkthrough

Ship an Integration

A step-by-step walkthrough that turns an API key into a production-grade integration (without leaking secrets).

What you’re building

The Confera Public API is designed for "read data" (website + schedule) and "write check-ins / registrations". The SDK is just a safe, typed-ish wrapper around those endpoints.

The golden rule: keys never go to the browser. Your app server calls Confera, then your browser calls your server.

Install

Install
bash
pnpm add @confera/sdk

Environment variables

Put these in your server environment (Vercel/Render/Fly/EC2/etc). For local dev, use .env.local.

.env.local (server only)
bash
CONFERA_API_BASE=https://your-domain
CONFERA_API_KEY=cat_...

Server-only rule (non-negotiable)

  • Do: call the SDK from your server (API routes, server actions, cron jobs).
  • Don’t: call the SDK from React client components or any browser JS bundle.

If you need data in the browser, create a server endpoint in your app that returns safe JSON.

Next.js App Router walkthrough (recommended)

This pattern keeps secrets server-only and gives your UI a clean endpoint to call.

1) Create a server-only client helper
ts
// lib/confera.ts (server-only file)
import { createConferaPublicClient } from "@confera/sdk";

export const confera = createConferaPublicClient({
  baseUrl: process.env.CONFERA_API_BASE!,
  apiKey: process.env.CONFERA_API_KEY!,
});
2) Create a route your frontend can call
ts
// app/api/public-data/schedule/route.ts
import { confera } from "@/lib/confera";

export async function GET() {
  const data = await confera.events.list({ limit: 100, offset: 0 });
  return Response.json(data);
}
3) Fetch from the browser
ts
// Any client component
const res = await fetch("/api/public-data/schedule");
const json = await res.json();
console.log(json.data);
Pro tip: split keys by integration

Create one key for “Website + schedule reads” and a separate key for “Kiosk check-ins”. That way, a leaked kiosk key can’t read registrations.

Node/Express walkthrough

Express route
ts
import express from "express";
import { createConferaPublicClient } from "@confera/sdk";

const confera = createConferaPublicClient({
  baseUrl: process.env.CONFERA_API_BASE!,
  apiKey: process.env.CONFERA_API_KEY!,
});

const app = express();

app.get("/schedule", async (_req, res) => {
  const data = await confera.events.list({ limit: 100, offset: 0 });
  res.json(data);
});

app.listen(3000);

Errors & retries

The SDK throws ConferaApiError on non-2xx responses. Handle it once in your server layer.

Recommended error handling
ts
import { ConferaApiError } from "@confera/sdk";

try {
  const data = await confera.events.list({ limit: 50 });
  return Response.json(data);
} catch (e) {
  if (e instanceof ConferaApiError) {
    return Response.json({ error: { code: e.code, message: e.message } }, { status: e.status });
  }
  return Response.json({ error: { message: "Unexpected error" } }, { status: 500 });
}

Production checklist

Security
  • Keys live only on the server (never in browser code).
  • Use the smallest scopes you need.
  • Use one key per integration.
  • Rotate keys periodically.
Operational
  • Log errors with status + code (helps support).
  • Keep timeouts reasonable for kiosks (fast fail, retry).
  • Expect keys to stop working when the conference is not live or the plan ends.