Embedding UI & API
Snapline Hub ships as separate npm packages so you can embed the dashboard in an existing app or mount the API under a path prefix.
npm packages (v0.2.4)
@vaagatech/snapline-hub-core— RBAC engine@vaagatech/snapline-hub-api— Express API (createApp)@vaagatech/snapline-hub-ui— ReactHubAppcomponentsnapline-hub(Python) — HTTP client with RBAC headers
Embed React UI
import { HubApp } from '@vaagatech/snapline-hub-ui';
import '@vaagatech/snapline-hub-ui/style.css';
export function QualityDashboard() {
return (
<HubApp
apiBase="https://hub.example.com/api"
basename="/quality"
user="alice@company.com"
/>
);
}
Mount API in Express
import express from 'express';
import { createApp } from '@vaagatech/snapline-hub-api';
const main = express();
const hub = createApp({ webDist: undefined });
main.use('/test-hub', hub.app);
main.listen(3000);
Python client
pip install snapline-hub
from snapline_hub import HubClient
client = HubClient.from_env()
client.ingest_report(report, project="my-app")