{"_id":"@dudezkie/sentinel-logger","name":"@dudezkie/sentinel-logger","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@dudezkie/sentinel-logger","version":"1.0.0","description":"Sentinel error logging SDK for JavaScript/TypeScript - Thin, non-blocking error capture for Node.js and browser applications","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"keywords":["error","logging","sentinel","observability","exception","monitoring","typescript"],"author":{"name":"Sentinel","email":"support@sentinel.dev"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/yourusername/sentinel-js.git"},"bugs":{"url":"https://github.com/yourusername/sentinel-js/issues"},"homepage":"https://github.com/yourusername/sentinel-js#readme","devDependencies":{"typescript":"^5.3.3","@types/node":"^20.10.5"},"engines":{"node":">=18.0.0"},"_id":"@dudezkie/sentinel-logger@1.0.0","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-6yChPN/LeDBvH9xTYcariAmXK3GVkxAjvCbSSunagmD3SjHnSUkbBW46VXCK5LUXa66cpAbg2pQSb4I6AoZFWQ==","shasum":"4f09ae930e5101bba479e74388efbb600a80b744","tarball":"https://registry.npmjs.org/@dudezkie/sentinel-logger/-/sentinel-logger-1.0.0.tgz","fileCount":14,"unpackedSize":13756,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQChgbZI3rahW/R1HJaMnKFvxbsueMthd840tPhkOCJeiwIgJC7qcwWFs0qKEEOl99A3pW3r30vlBXWL1FFr0YI0nDA="}]},"_npmUser":{"name":"dudezkie","email":"lfaderon@gmail.com"},"directories":{},"maintainers":[{"name":"dudezkie","email":"lfaderon@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sentinel-logger_1.0.0_1768445556990_0.39291621703071455"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-15T02:52:36.923Z","1.0.0":"2026-01-15T02:52:37.136Z","modified":"2026-01-15T02:52:37.321Z"},"maintainers":[{"name":"dudezkie","email":"lfaderon@gmail.com"}],"description":"Sentinel error logging SDK for JavaScript/TypeScript - Thin, non-blocking error capture for Node.js and browser applications","homepage":"https://github.com/yourusername/sentinel-js#readme","keywords":["error","logging","sentinel","observability","exception","monitoring","typescript"],"repository":{"type":"git","url":"git+https://github.com/yourusername/sentinel-js.git"},"author":{"name":"Sentinel","email":"support@sentinel.dev"},"bugs":{"url":"https://github.com/yourusername/sentinel-js/issues"},"license":"MIT","readme":"# Sentinel JavaScript/TypeScript SDK\r\n\r\nThin SDK for capturing errors in JavaScript and TypeScript applications.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @sentinel/logger\r\n```\r\n\r\n## Usage\r\n\r\n### Basic Usage\r\n\r\n```javascript\r\nimport { capture } from '@sentinel/logger';\r\n\r\ntry {\r\n  // Your code that might throw\r\n  throw new Error('Something went wrong');\r\n} catch (error) {\r\n  capture(error);\r\n}\r\n```\r\n\r\n### With Context\r\n\r\n```javascript\r\nimport { capture } from '@sentinel/logger';\r\n\r\ntry {\r\n  // Your code\r\n} catch (error) {\r\n  capture(error, {\r\n    userId: '123',\r\n    requestId: 'abc',\r\n    customField: 'value'\r\n  });\r\n}\r\n```\r\n\r\n### Initialize with Configuration\r\n\r\n```javascript\r\nimport { init } from '@sentinel/logger';\r\n\r\n// Initialize once at application startup\r\ninit({\r\n  apiUrl: 'https://your-sentinel-api.com',\r\n  enabled: true\r\n});\r\n\r\n// Then use capture anywhere\r\nimport { capture } from '@sentinel/logger';\r\ncapture(error);\r\n```\r\n\r\n### Advanced Usage (Class-based)\r\n\r\n```javascript\r\nimport { Sentinel } from '@sentinel/logger';\r\n\r\nconst sentinel = new Sentinel({\r\n  apiUrl: 'https://your-sentinel-api.com'\r\n});\r\n\r\nsentinel.capture(error, { context: 'data' });\r\n```\r\n\r\n## Configuration\r\n\r\n### Environment Variables\r\n\r\n- `SENTINEL_API_URL`: Backend API URL (default: `http://localhost:8080`)\r\n- `SENTINEL_ENABLED`: Enable/disable error capture (default: `true`)\r\n\r\n### Programmatic Configuration\r\n\r\n```javascript\r\nimport { init } from '@sentinel/logger';\r\n\r\ninit({\r\n  apiUrl: 'https://api.example.com',\r\n  enabled: process.env.NODE_ENV === 'production'\r\n});\r\n```\r\n\r\n## Features\r\n\r\n- **Non-blocking**: Never blocks your application\r\n- **Fire-and-forget**: Returns immediately\r\n- **Never crashes**: All errors are silently handled\r\n- **Zero dependencies**: Uses native fetch (Node.js 18+ or browser)\r\n- **TypeScript support**: Full type definitions included\r\n\r\n## Browser Support\r\n\r\nWorks in all modern browsers that support `fetch` API. For older browsers, include a fetch polyfill.\r\n\r\n## Node.js Support\r\n\r\nRequires Node.js 18+ (for native fetch). For older versions, install `node-fetch`:\r\n\r\n```bash\r\nnpm install node-fetch\r\n```\r\n\r\n## React Integration\r\n\r\n```jsx\r\nimport { capture } from '@sentinel/logger';\r\nimport { ErrorBoundary } from 'react-error-boundary';\r\n\r\nfunction ErrorFallback({ error }) {\r\n  capture(error, { component: 'ErrorBoundary' });\r\n  return <div>Something went wrong</div>;\r\n}\r\n\r\nfunction App() {\r\n  return (\r\n    <ErrorBoundary FallbackComponent={ErrorFallback}>\r\n      <YourApp />\r\n    </ErrorBoundary>\r\n  );\r\n}\r\n```\r\n","readmeFilename":"README.md","_rev":"1-1086a8baa88737fffdb72e2cd7b99906"}