@aiprovenance/sentry
v0.1.33
Published
Sentry integration for AI code attribution
Maintainers
Readme
@aiprovenance/sentry
Sentry integration for AI code attribution.
Install
npm install @aiprovenance/sentry
# or
yarn add @aiprovenance/sentryQuick Start
import * as Sentry from "@sentry/node";
import { createDevMemoryBeforeSend } from "@aiprovenance/sentry";
Sentry.init({
dsn: process.env.SENTRY_DSN,
beforeSend(event, hint) {
return createDevMemoryBeforeSend()(event, hint);
},
});That's it! Auto-detects:
repoIdfromDEVMEMORY_REPO_IDenv or git remotesqlitePathfromDEVMEMORY_SQLITE_PATHenv or.devmemory/config.jsonmodefromDEVMEMORY_MODEenv (default: local)
Options
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| repoId | string | auto-detect | Repository ID |
| mode | "local" | "cloud" | local | Local (SQLite) or Cloud (AMS) |
| apiUrl | string | env | AMS API URL (cloud mode) |
| sqlitePath | string | .devmemory/attributions.db | SQLite path |
| timeout | number | 2000 | Request timeout (ms) |
What You Get
Every Sentry error includes:
Tags:
ai_tool: cursor
ai_model: gpt-4o
ai_origin: ai
Contexts:
ai_attribution:
author: ai
tool: cursor
model: gpt-4o
filepath: src/auth/login.ts
lineno: 42Local vs Cloud
| Mode | Storage | Use Case |
|------|---------|----------|
| local | SQLite file | Development, no external services |
| cloud | AMS API | Production, team shared data |
Setup
1. Install DevMemory CLI
pip install devmemory
devmemory install --mode local2. Add Sentry Integration
// sentry.client.config.ts
import * as Sentry from "@sentry/nextjs";
import { createDevMemoryBeforeSend } from "@devmemory/sentry";
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
beforeSend(event, hint) {
return createDevMemoryBeforeSend({
repoId: "my-nextjs-app",
mode: "local", // works offline!
sqlitePath: ".devmemory/attributions.db",
})(event, hint);
},
});License
MIT
