{"_id":"@arcari/open-audit","_rev":"7-7298bb7b89498b0788599045ad47f616","name":"@arcari/open-audit","dist-tags":{"latest":"1.0.7"},"versions":{"1.0.0":{"name":"@arcari/open-audit","version":"1.0.0","keywords":[],"author":{"name":"Tomas Lachmann"},"license":"MIT","_id":"@arcari/open-audit@1.0.0","maintainers":[{"name":"arcari","email":"tomaslachmann@gmail.com"}],"homepage":"https://github.com/tomaslachmann/open-audit#readme","bugs":{"url":"https://github.com/tomaslachmann/open-audit/issues"},"dist":{"shasum":"5f071e6c59543c42367fa50bf77101934984896f","tarball":"https://registry.npmjs.org/@arcari/open-audit/-/open-audit-1.0.0.tgz","fileCount":9,"integrity":"sha512-V4s6VbjGlvg+5l5GhG/6XRCCr/s5z0UzmpzGFmTdAlCkUIbcNqSoXcHC+Q5/qJS0uvhHHzZXWRyhai1rkgMawA==","signatures":[{"sig":"MEQCIFbkxgcvcWPe8Qg5t8dOAMZ5XUf7+pRDfxsXwmkZZE9RAiByfrBwmSK2vkos/nm2e8tVmNetkBR32TE5JgFfN3Q85Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":59803},"main":"dist/index.js","type":"commonjs","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"abecbcb4cb92adb1b91059cb3e798913808e4a6a","scripts":{"dev":"ts-node-dev --respawn src/index.ts","test":"vitest --disable-console-intercept","build":"tsup","start":"node dist/index.js"},"_npmUser":{"name":"arcari","actor":{"name":"arcari","type":"user","email":"tomaslachmann@gmail.com"},"email":"tomaslachmann@gmail.com"},"repository":{"url":"git+https://github.com/tomaslachmann/open-audit.git","type":"git"},"_npmVersion":"11.3.0","description":"> A lightweight, pluggable audit log library for Node.js — log user actions to Postgres, MySQL, MongoDB, SQLite, or files.","directories":{"test":"test","example":"examples"},"_nodeVersion":"24.1.0","dependencies":{"pg":"^8.16.3","chalk":"^5.4.1","mysql2":"^3.14.1","mongodb":"^6.17.0","better-sqlite3":"^12.2.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^3.2.4","@types/pg":"^8.15.4","typescript":"^5.8.3","@types/node":"^24.0.12","ts-node-dev":"^2.0.0","@types/better-sqlite3":"^7.6.13"},"_npmOperationalInternal":{"tmp":"tmp/open-audit_1.0.0_1752080110787_0.5502929585076826","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@arcari/open-audit","version":"1.0.1","keywords":[],"author":{"name":"Tomas Lachmann"},"license":"MIT","_id":"@arcari/open-audit@1.0.1","maintainers":[{"name":"arcari","email":"tomaslachmann@gmail.com"}],"homepage":"https://github.com/tomaslachmann/open-audit#readme","bugs":{"url":"https://github.com/tomaslachmann/open-audit/issues"},"dist":{"shasum":"7d718efeca3a06e735cff2b6312ae1c1fdf8fb99","tarball":"https://registry.npmjs.org/@arcari/open-audit/-/open-audit-1.0.1.tgz","fileCount":9,"integrity":"sha512-vOPEGnwhfPKmCMyYuX3PYUFrhwR8n1P410TTIPaIgQvKsUPzbppH6/zun1Riu6umN5AEFlrtHdmYxG+2nP5ZAw==","signatures":[{"sig":"MEYCIQDLDl1Jsmykwk5y8ysnN8fuwvFLBeJB53nHDk9eiURaMwIhANzJmWOsGLCa32gaSeSmYizIoAssinbLuV7SKVU5G4Sp","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":63171},"main":"dist/index.js","type":"commonjs","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"0a593782892b22a282cdf088988b03cba5e3f84e","scripts":{"dev":"ts-node-dev --respawn src/index.ts","test":"vitest --disable-console-intercept","build":"tsup","start":"node dist/index.js"},"_npmUser":{"name":"arcari","actor":{"name":"arcari","type":"user","email":"tomaslachmann@gmail.com"},"email":"tomaslachmann@gmail.com"},"repository":{"url":"git+https://github.com/tomaslachmann/open-audit.git","type":"git"},"_npmVersion":"11.3.0","description":"> A lightweight, pluggable audit log library for Node.js — log user actions to Postgres, MySQL, MongoDB, SQLite, or files.","directories":{"test":"test","example":"examples"},"_nodeVersion":"24.1.0","dependencies":{"pg":"^8.16.3","chalk":"^5.4.1","mysql2":"^3.14.1","mongodb":"^6.17.0","better-sqlite3":"^12.2.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^3.2.4","@types/pg":"^8.15.4","typescript":"^5.8.3","@types/node":"^24.0.12","ts-node-dev":"^2.0.0","@types/better-sqlite3":"^7.6.13"},"_npmOperationalInternal":{"tmp":"tmp/open-audit_1.0.1_1752080842639_0.09156717499047962","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@arcari/open-audit","version":"1.0.2","keywords":[],"author":{"name":"Tomas Lachmann"},"license":"MIT","_id":"@arcari/open-audit@1.0.2","maintainers":[{"name":"arcari","email":"tomaslachmann@gmail.com"}],"homepage":"https://github.com/tomaslachmann/open-audit#readme","bugs":{"url":"https://github.com/tomaslachmann/open-audit/issues"},"dist":{"shasum":"a4ffa02d291538f049e6720ac17f2ecc589cf03b","tarball":"https://registry.npmjs.org/@arcari/open-audit/-/open-audit-1.0.2.tgz","fileCount":9,"integrity":"sha512-YaBxBamKkrlNETyjvwSsok2cqoELEzBZEvg7unNT1Hj4yIxuHB81REAAltjNwp1rhfha+Gh9+R8ZeQ2/ftxCaw==","signatures":[{"sig":"MEQCIDrSVMSMQ1pB41rQSXMDZtwGO8Z7cdRkmLiCFLrHyYBfAiBmccryTIp4jJVwtU5W5vBrlxBGqHwKLDAMw5qPjhNR0w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62582},"main":"dist/index.js","type":"commonjs","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"406c795a04e17448ca6ec5b51f39e558088c1f9f","scripts":{"dev":"ts-node-dev --respawn src/index.ts","test":"vitest --disable-console-intercept","build":"tsup","start":"node dist/index.js"},"_npmUser":{"name":"arcari","actor":{"name":"arcari","type":"user","email":"tomaslachmann@gmail.com"},"email":"tomaslachmann@gmail.com"},"repository":{"url":"git+https://github.com/tomaslachmann/open-audit.git","type":"git"},"_npmVersion":"11.3.0","description":"> A lightweight, pluggable audit log library for Node.js — log user actions to Postgres, MySQL, MongoDB, SQLite, or files.","directories":{"test":"test","example":"examples"},"_nodeVersion":"24.1.0","dependencies":{"chalk":"^5.4.1","mongodb":"^6.17.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^3.2.4","@types/pg":"^8.15.4","typescript":"^5.8.3","@types/node":"^24.0.12","ts-node-dev":"^2.0.0","@types/mysql2":"github:types/mysql2","@types/better-sqlite3":"^7.6.13"},"_npmOperationalInternal":{"tmp":"tmp/open-audit_1.0.2_1752082389932_0.7060464197762333","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@arcari/open-audit","version":"1.0.4","keywords":[],"author":{"name":"Tomas Lachmann"},"license":"MIT","_id":"@arcari/open-audit@1.0.4","maintainers":[{"name":"arcari","email":"tomaslachmann@gmail.com"}],"homepage":"https://github.com/tomaslachmann/open-audit#readme","bugs":{"url":"https://github.com/tomaslachmann/open-audit/issues"},"dist":{"shasum":"afe0d6dfd3ab9b90700e545ed5fa19d24d29986e","tarball":"https://registry.npmjs.org/@arcari/open-audit/-/open-audit-1.0.4.tgz","fileCount":6,"integrity":"sha512-wiM2gTSuU32HuWw+sB82gSy1QAhvVsAELEo7ZQi2WVK4oebSSigKgoGx990TZ4kOhEQif2hHF/+Yobkzl/Djtg==","signatures":[{"sig":"MEYCIQCk2Qn8JXvPk3ynyCt/JAxSPrpLR/SM93VnfM0GAY5LYgIhAI582A+mujv5kleVtKF0B6XB0vKClh7H6lKFcsCQMRsE","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":32867},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"02e83a213bf9ca9401c152090a9ea0a3889a91e6","scripts":{"dev":"ts-node-dev --respawn src/index.ts","test":"vitest --disable-console-intercept","build":"tsup","start":"node dist/index.js"},"_npmUser":{"name":"arcari","actor":{"name":"arcari","type":"user","email":"tomaslachmann@gmail.com"},"email":"tomaslachmann@gmail.com"},"repository":{"url":"git+https://github.com/tomaslachmann/open-audit.git","type":"git"},"_npmVersion":"11.3.0","description":"> A lightweight, pluggable audit log library for Node.js — log user actions to Postgres, MySQL, MongoDB, SQLite, or files.","directories":{"test":"test","example":"examples"},"_nodeVersion":"24.1.0","dependencies":{"chalk":"^5.4.1"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","vitest":"^3.2.4","@types/pg":"^8.15.4","typescript":"^5.8.3","@types/node":"^24.0.12","ts-node-dev":"^2.0.0","@types/mysql2":"github:types/mysql2","@types/mongodb":"^4.0.6","@types/better-sqlite3":"^7.6.13"},"_npmOperationalInternal":{"tmp":"tmp/open-audit_1.0.4_1752082731185_0.3706418843043031","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@arcari/open-audit","version":"1.0.5","keywords":[],"author":{"name":"Tomas Lachmann"},"license":"MIT","_id":"@arcari/open-audit@1.0.5","maintainers":[{"name":"arcari","email":"tomaslachmann@gmail.com"}],"homepage":"https://github.com/tomaslachmann/open-audit#readme","bugs":{"url":"https://github.com/tomaslachmann/open-audit/issues"},"dist":{"shasum":"a8448701f9a894fe3b5d133baa1261b2bfe3ed25","tarball":"https://registry.npmjs.org/@arcari/open-audit/-/open-audit-1.0.5.tgz","fileCount":7,"integrity":"sha512-8CKvlXYNL4bLR3mck8HMil9C6hK1S91DCDzlRCvtv954Zpu2tI+wM3YUgk37qkQvVoX0j7OEFisEp7xYTdwaCw==","signatures":[{"sig":"MEUCIQDL93yr+Ie8Z9R/vws6qAu+WXltTg5RjUexB50rykWGCAIgaeQCcLQh3PVEMiCjZ1qWM/YIh6ThmDnzKcrdy+18eUM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45628},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"3540e49ea8c7d4b829ba7d5ab19aff66bd2f3af7","scripts":{"dev":"ts-node-dev --respawn src/index.ts","test":"vitest --disable-console-intercept","build":"tsup","start":"node dist/index.js"},"_npmUser":{"name":"arcari","actor":{"name":"arcari","type":"user","email":"tomaslachmann@gmail.com"},"email":"tomaslachmann@gmail.com"},"repository":{"url":"git+https://github.com/tomaslachmann/open-audit.git","type":"git"},"_npmVersion":"11.3.0","description":"> A lightweight, pluggable audit log library for Node.js — log user actions to Postgres, MySQL, MongoDB, SQLite, or files.","directories":{"test":"test","example":"examples"},"_nodeVersion":"24.1.0","dependencies":{"chalk":"^5.4.1"},"_hasShrinkwrap":false,"devDependencies":{"pg":"^8.16.3","tsup":"^8.5.0","dotenv":"^17.2.0","mysql2":"^3.14.1","vitest":"^3.2.4","@types/pg":"^8.15.4","typescript":"^5.8.3","@types/node":"^24.0.12","ts-node-dev":"^2.0.0","@types/mysql2":"github:types/mysql2","@types/mongodb":"^4.0.6","better-sqlite3":"^12.2.0","@types/better-sqlite3":"^7.6.13"},"_npmOperationalInternal":{"tmp":"tmp/open-audit_1.0.5_1752143395737_0.035870256061727446","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@arcari/open-audit","version":"1.0.6","keywords":[],"author":{"name":"Tomas Lachmann"},"license":"MIT","_id":"@arcari/open-audit@1.0.6","maintainers":[{"name":"arcari","email":"tomaslachmann@gmail.com"}],"homepage":"https://github.com/tomaslachmann/open-audit#readme","bugs":{"url":"https://github.com/tomaslachmann/open-audit/issues"},"dist":{"shasum":"6b6251861f764796a5b76e6163f48523893032f4","tarball":"https://registry.npmjs.org/@arcari/open-audit/-/open-audit-1.0.6.tgz","fileCount":7,"integrity":"sha512-+4i7Cw/Cs+kcnRT/SCZMiYhkk/65LW2qUOtwY8KZLcXgpZEV99BnVHhAAzIfePJZkaaHSJYM8ULlHloDpEZl6A==","signatures":[{"sig":"MEUCIFQGCUbSqSjX2laJiaN04raiScWkflwLaZfgJwaqWQ6JAiEAm0RFFBCQs9XT0THGdAxL4tbMQk1gorj+Teo77V3XqAA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45624},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"106458849b391c5a4f7c248ec1d43440c1670dc1","scripts":{"dev":"ts-node-dev --respawn src/index.ts","test":"vitest --disable-console-intercept","build":"tsup","start":"node dist/index.js"},"_npmUser":{"name":"arcari","actor":{"name":"arcari","type":"user","email":"tomaslachmann@gmail.com"},"email":"tomaslachmann@gmail.com"},"repository":{"url":"git+https://github.com/tomaslachmann/open-audit.git","type":"git"},"_npmVersion":"11.3.0","description":"> A lightweight, pluggable audit log library for Node.js — log user actions to Postgres, MySQL, MongoDB, SQLite, or files.","directories":{"test":"test","example":"examples"},"_nodeVersion":"24.1.0","dependencies":{"chalk":"^5.4.1"},"_hasShrinkwrap":false,"devDependencies":{"pg":"^8.16.3","tsup":"^8.5.0","dotenv":"^17.2.0","mysql2":"^3.14.1","vitest":"^3.2.4","@types/pg":"^8.15.4","typescript":"^5.8.3","@types/node":"^24.0.12","ts-node-dev":"^2.0.0","@types/mysql2":"github:types/mysql2","@types/mongodb":"^4.0.6","better-sqlite3":"^12.2.0","@types/better-sqlite3":"^7.6.13"},"_npmOperationalInternal":{"tmp":"tmp/open-audit_1.0.6_1752146655223_0.21829964917441602","host":"s3://npm-registry-packages-npm-production"}},"1.0.7":{"name":"@arcari/open-audit","version":"1.0.7","description":"> A lightweight, pluggable audit log library for Node.js — log user actions to Postgres, MySQL, MongoDB, SQLite, or files.","keywords":[],"homepage":"https://github.com/tomaslachmann/open-audit#readme","bugs":{"url":"https://github.com/tomaslachmann/open-audit/issues"},"repository":{"type":"git","url":"git+https://github.com/tomaslachmann/open-audit.git"},"license":"MIT","author":{"name":"Tomas Lachmann"},"type":"module","main":"dist/index.js","types":"dist/index.d.ts","directories":{"example":"examples","test":"test"},"scripts":{"build":"tsup","start":"node dist/index.js","dev":"ts-node-dev --respawn src/index.ts","test":"vitest --disable-console-intercept","test:unit":"vitest run 'test/**/*.test.ts' '!test/**/*.integration.test.ts'","test:integration":"vitest run 'test/**/*.integration.test.ts'"},"dependencies":{"chalk":"^5.4.1"},"devDependencies":{"@types/better-sqlite3":"^7.6.13","@types/mongodb":"^4.0.6","@types/mysql2":"github:types/mysql2","@types/node":"^24.0.12","@types/pg":"^8.15.4","better-sqlite3":"^12.2.0","dotenv":"^17.2.0","mysql2":"^3.14.1","pg":"^8.16.3","ts-node-dev":"^2.0.0","tsup":"^8.5.0","typescript":"^5.8.3","vitest":"^3.2.4"},"module":"dist/index.mjs","_id":"@arcari/open-audit@1.0.7","gitHead":"3251abbb9bb2b0b2d6d6969e9963940d0abf28f3","_nodeVersion":"20.19.3","_npmVersion":"10.8.2","dist":{"integrity":"sha512-Fu8HPPgOlmUX8VZs1proWlS/VPnGe8AWc8je18Q+sqfflNG6ERTcPnfQqZZlxsDi1kzzEoGJF0ylCyfIraD4kA==","shasum":"240bd3e6da381a22ff1737ba486c3f97ab697f28","tarball":"https://registry.npmjs.org/@arcari/open-audit/-/open-audit-1.0.7.tgz","fileCount":7,"unpackedSize":45778,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEeKn2OS1K2c4M9Kbz3zdLf+lXuESdA1BhfBtcwdHppFAiA98cqOhU0gHcaNzbY5R3bqWNWGwBxKxTzWYZTdj4hiRQ=="}]},"_npmUser":{"name":"arcari","email":"tomaslachmann@gmail.com","actor":{"name":"arcari","email":"tomaslachmann@gmail.com","type":"user"}},"maintainers":[{"name":"arcari","email":"tomaslachmann@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/open-audit_1.0.7_1752148780470_0.07203887283515198"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-09T16:55:10.698Z","modified":"2025-07-10T11:59:40.829Z","1.0.0":"2025-07-09T16:55:10.976Z","1.0.1":"2025-07-09T17:07:22.853Z","1.0.2":"2025-07-09T17:33:10.087Z","1.0.4":"2025-07-09T17:38:51.382Z","1.0.5":"2025-07-10T10:29:55.917Z","1.0.6":"2025-07-10T11:24:15.387Z","1.0.7":"2025-07-10T11:59:40.652Z"},"bugs":{"url":"https://github.com/tomaslachmann/open-audit/issues"},"author":{"name":"Tomas Lachmann"},"license":"MIT","homepage":"https://github.com/tomaslachmann/open-audit#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/tomaslachmann/open-audit.git"},"description":"> A lightweight, pluggable audit log library for Node.js — log user actions to Postgres, MySQL, MongoDB, SQLite, or files.","maintainers":[{"name":"arcari","email":"tomaslachmann@gmail.com"}],"readme":"# 🕵️‍♂️ OpenAudit\n\n> A lightweight, pluggable audit log library for Node.js — log user actions to Postgres, MySQL, MongoDB, SQLite, or files.\n\n---\n\n## 🚀 Features\n\n- ✅ Simple API: `OpenAudit.init()` and `OpenAudit.log()`\n- ✅ Multiple storage adapters:\n  - PostgreSQL (`pg`)\n  - MySQL / MariaDB (`mysql2`)\n  - SQLite (`better-sqlite3`)\n  - MongoDB (`mongodb`)\n  - File-based (JSON files)\n- ✅ Automatic table/collection creation on init\n- ✅ Debug/logging support with color output\n- ✅ Lightweight — no ORM, no runtime bloat\n\n---\n\n## 📦 Install\n\n```bash\nnpm install @arcari/open-audit\n```\n\n> You'll also need to install the database driver for your chosen adapter, or pass your custom, check the examples:\n\n```bash\n# For PostgreSQL\nnpm install pg\n\n# For MySQL/MariaDB\nnpm install mysql2\n\n# For MongoDB\nnpm install mongodb\n\n# For SQLite\nnpm install better-sqlite3\n```\n\n---\n\n## 🛠️ Basic Usage\n\n```ts\nimport { OpenAudit } from \"open-audit\";\n\nawait OpenAudit.init({\n  provider: \"postgresql\", // 'mysql' | 'mongodb' | 'sqlite' | 'file'\n  url: \"postgres://user:pass@localhost:5432/mydb\",\n  debug: true,\n  driver: \"pg\",\n});\n\nawait OpenAudit.log({\n  actorId: \"user_123\",\n  action: \"user.login\",\n  entity: \"user\",\n  entityId: \"user_123\",\n  metadata: {\n    ip: \"127.0.0.1\",\n    userAgent: \"Mozilla/5.0\",\n  },\n});\n```\n\n---\n\n## 📁 Examples\n\nExplore the [`examples`](./examples) folder in this repository to find practical usage examples demonstrating:\n\n- How to initialize and configure the library\n- Usage of all supported adapters (PostgreSQL, MySQL, SQLite, MongoDB, File, and custom)\n- Sample configurations and connection setups\n- Logging and audit event recording in action\n\nThese examples serve as a hands-on guide to quickly get started with the library in your projects.\n\n---\n\n## ⚙️ Configuration per Adapter\n\n### 🔹 PostgreSQL and pg driver\n\n```ts\n{\n  provider: 'postgresql',\n  url: 'postgres://user:pass@host:port/db',\n  debug?: boolean,\n  driver: \"pg\"\n}\n```\n\n---\n\n### 🔹 MySQL / MariaDB and mysql2 driver\n\n```ts\n{\n  provider: 'mysql',\n  url: 'mysql://user:pass@host:port/db',\n  debug?: boolean,\n  driver: \"mysql2\"\n}\n```\n\n---\n\n### 🔹 MongoDB and mongo driver\n\n```ts\n{\n  provider: 'mongodb',\n  url: 'mongodb://localhost:27017',\n  dbName?: string,          // default: 'audit'\n  collectionName?: string,  // default: 'audit_events'\n  debug?: boolean,\n  driver: \"mongo\"\n}\n```\n\n---\n\n### 🔹 SQLite and better-sqlite3 driver\n\n```ts\n{\n  provider: 'sqlite',\n  path?: string,   // default: './audit.sqlite'\n  debug?: boolean,\n  driver: \"better-sqlite3\"\n}\n```\n\n---\n\n### 🔹 File (JSON-based logging)\n\n```ts\n{\n  provider: 'file',\n  path?: string,   // default: './audit_logs'\n  debug?: boolean\n}\n```\n\nEach log is written to a daily `.json` file:\n\n```\naudit_logs/\n  └── 2025-07-09.json\n```\n\n---\n\n## 🧪 Event Format\n\n```ts\ntype AuditEvent = {\n  actorId?: string;\n  action: string;\n  entity?: string;\n  entityId?: string;\n  metadata?: object;\n};\n```\n\nExample:\n\n```ts\nawait OpenAudit.log({\n  actorId: \"user_1\",\n  action: \"post.create\",\n  entity: \"post\",\n  entityId: \"post_123\",\n  metadata: {\n    title: \"Hello World\",\n    tags: [\"intro\", \"welcome\"],\n  },\n});\n```\n\n---\n\n## 🧱 Example SQL Schema (Postgres/MySQL)\n\n```sql\nCREATE TABLE audit_events (\n  id SERIAL PRIMARY KEY,\n  timestamp TIMESTAMPTZ DEFAULT now(),\n  actor_id TEXT,\n  action TEXT NOT NULL,\n  entity TEXT,\n  entity_id TEXT,\n  metadata JSONB\n);\n```\n\nSQLite stores `metadata` as a stringified JSON column.\n\n---\n\n## 📣 Roadmap / Coming Soon\n\n- [ ] Web dashboard to view audit logs\n- [ ] CLI for searching and exporting logs\n- [ ] Custom adapter support (plugin interface)\n- [ ] Type-safe schema validation\n- [ ] Option for per-tenant database separation\n\n---\n\n## 🤝 Contributing\n\nPull requests are welcome! For major changes, open an issue first to discuss what you'd like to change.\n\nTo get started locally:\n\n```bash\ngit clone https://github.com/yourname/open-audit.git\n\ncd open-audit\n\nnpm install\n\nnpm run dev\n```\n\n---\n\n## 📄 License\n\nMIT — Tomas Lachmann  \nBuilt in 🇨🇿 Czechia with ❤️\n","readmeFilename":"README.md"}