@oopsie-app/node
v0.1.1
Published
Official Oopsie backend SDK for Node.js
Maintainers
Readme
@oopsie-app/node
Official Oopsie backend SDK for Node.js.
Install
npm install @oopsie-app/nodeQuick start
const express = require('express');
const Oopsie = require('@oopsie-app/node');
const app = express();
Oopsie.init(app, { ops: 'https://<apiToken>@your-oopsie-app.com/api/capture/<projectKey>' });
app.get('/health', (req, res) => {
res.json({ ok: true });
});ops is the only value you need in the quick start. It packages the project identity and the SDK credential into one copy-paste value, while the SDK wires the Express request and error handlers for you when you pass app.
Manual capture
try {
throw new Error('Payment pipeline failed');
} catch (error) {
await oopsie.captureException(error, {
request: {
method: 'POST',
url: '/billing/checkout',
},
payload: {
job: 'billing-sync',
},
});
}Release tracking
await oopsie.notifyRelease({
version: process.env.OOPSIE_RELEASE || '1.0.0',
environment: process.env.NODE_ENV || 'production',
commitSha: process.env.OOPSIE_COMMIT_SHA,
description: 'Deploy production',
});