Installing @sentrinel/plugin in your apps
The plugin lives in the public repo Zaga-ltd/sentinel_packages, so any JavaScript app โ Elysia, Express, Next.js, Bun โ can install it straight from GitHub, no npm publish needed:
bun add "@sentrinel/plugin@github:Zaga-ltd/sentinel_packages"
npm install "github:Zaga-ltd/sentinel_packages" # npm / pnpm / yarn work too
The repo carries built JavaScript (dist/: ESM, CommonJS, types) next to the
TypeScript sources, so plain Node can import or require() it and no build
step runs on install. Bun runs the sources directly. Elysia is an optional peer โ
an Express or Next app does not need it.
Pin to a specific commit or tag for reproducible builds:
bun add "@sentrinel/plugin@github:Zaga-ltd/sentinel_packages#v0.1.0" # tag
bun add "@sentrinel/plugin@github:Zaga-ltd/sentinel_packages#abc1234" # commit
Or in package.json:
{
"dependencies": {
"@sentrinel/plugin": "github:Zaga-ltd/sentinel_packages"
}
}
Wire it up
import { Elysia } from "elysia";
import { sentrinelPlugin } from "@sentrinel/plugin";
const app = new Elysia()
.use(
sentrinelPlugin({
serverUrl: process.env.SENTRINEL_URL ?? "http://localhost:3001",
appName: "my-api",
env: process.env.NODE_ENV ?? "dev",
apiKey: process.env.SENTRINEL_API_KEY, // required when the server enforces keys
requestLogging: {
enabled: true,
sampleRate: 0.25, // errors + slow requests are always kept
slowRequestThresholdMs: 200,
// Authorization, cookies, API keys, tokens and passwords are masked
// with no configuration; maskHeaders/maskBodyFields add to that list.
},
logCapture: { enabled: true }, // Logs tab in the request modal
})
)
.get("/", () => "hello")
.listen(3000);
Express, Next.js and Bun import their own entry โ @sentrinel/plugin/express,
@sentrinel/plugin/next, @sentrinel/plugin/bun โ see PLUGIN.md.
Full option reference is in the plugin's own README: https://github.com/Zaga-ltd/sentinel_packages#readme.
Updating the public repo after plugin changes
The plugin source of truth is packages/plugin in this (private) monorepo. To publish changes:
bash scripts/publish-plugin.sh # builds dist/, checks it loads in plain Node, copies
cd sentinel_packages
git add src dist scripts tests mcp examples sentrinel_django sentrinel_fastapi \
sentrinel_flutter sentrinel_flutter_integration \
package.json README.md LICENSE tsconfig.json .gitignore
git commit -m "sync plugin" && git push
dist/ is committed to the public repo on purpose: a git dependency gets no
build step we can rely on. Stage the synced paths explicitly โ the script lists
them โ rather than git add -A in a public repo.
Consumers pick up the update with bun update @sentrinel/plugin (or by bumping the pinned tag/commit).