The Cadmium Express SDK captures and sends unhandled exceptions in your Express applications to the Cadmium Cloud Service.
- Middleware integration for Express.
- Captures uncaught exceptions and unhandled rejections.
- Sends detailed error logs with context.
Install the dependencies:
npm install express axios dotenv
-
Initialize the SDK in your project:
const CadmiumSDK = require('./cadmium-sdk'); const cadmium = new CadmiumSDK({ applicationId: 'your-app-id', secret: 'your-cd-secret', id: 'your-cd-id' });
-
Use the middleware in your Express app:
app.use(cadmium.middleware());
-
Enable global exception handling:
cadmium.handleUncaughtExceptions();
-
Example Express App: Run the example app with:
node example.js
MIT