1.0.0 • Published 10 months ago

cadmium-express-sdk v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Cadmium Express SDK

The Cadmium Express SDK captures and sends unhandled exceptions in your Express applications to the Cadmium Cloud Service.

Features

  • Middleware integration for Express.
  • Captures uncaught exceptions and unhandled rejections.
  • Sends detailed error logs with context.

Installation

Install the dependencies:

npm install express axios dotenv

Usage

  1. 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'
    });
  2. Use the middleware in your Express app:

    app.use(cadmium.middleware());
  3. Enable global exception handling:

    cadmium.handleUncaughtExceptions();
  4. Example Express App: Run the example app with:

    node example.js

License

MIT