@riposte.co/server
Overview
Section titled “Overview”@riposte.co/server packages the entire Riposte runtime so you can run the
unified email and calendar API anywhere: the Fastify server, admin portal, CLI
commands, and helpers for embedding the router inside another Node.js
application.【F:product/README.md†L5-L37】
Installation
Section titled “Installation”Pick the runtime mode that fits your environment:
npm install @riposte.co/serverInstall Riposte as a project dependency, then provide your existing HTTP server
to hostServer when Riposte should mount under another router instead of
opening its own port.
import express from 'express';import { createRiposteServer } from '@riposte.co/server';
const app = express();
async function start() { await createRiposteServer({ hostServer: { instance: app, mountPath: '/riposte' }, initializeWorkspace: false, }); await riposte.start(); await app.listen(3000); console.log('Express + Riposte listening on http://localhost:3000/riposte');}
start();npm install @riposte.co/serverAfter installing Riposte locally, use createRiposteServer to embed it inside
another Node.js process while still letting it manage its HTTP listener.
import { createRiposteServer } from '@riposte.co/server';
async function start() { const riposte = await createRiposteServer({ port: 8080, runMigrations: true, adminPortal: { port: 3001 }, }); await riposte.start();}
start();Install the CLI globally, then run Riposte as a self-contained daemon that exposes the Fastify API and bundled admin portal. Perfect for local development or deploying Riposte as its own service.
npm install -g @riposte.co/serverriposte-init # optional: scaffold config + environment filesriposte-run # starts Fastify on port 8080 and the admin portalCustomize listener ports with --port, --host, or --admin-port flags when needed.
CLI utilities
Section titled “CLI utilities”The npm package exposes several operational commands through npx or your
package manager’s bin shim.【F:product/package.json†L8-L15】
| Command | Purpose |
|---|---|
riposte-init | Scaffold a workspace with config templates and environment files. |
riposte-run | Start the Fastify API server and optional admin portal. |
riposte-migrate | Apply pending Drizzle migrations to the configured database. |
riposte-provider-test | Exercise live provider smoke tests end-to-end. |
riposte-admin | Launch the embedded admin portal as a standalone service. |
riposte-config | Validate, diff, and lint your sync.config.json. |
Next steps
Section titled “Next steps”- Review the configuration file reference to understand every
runtime knob exposed via
sync.config.json. - Use the generated SDK client to call the API directly—see the
@riposte.co/sdkreference for the available helpers. - Browse the API reference to wire endpoints returned by the server, starting with Accounts and Messages.