Installation

Install the Rasputin Fastify SDK on a long-running Node.js or Bun server. Set a release and create a client to capture production errors.

  1. 1

    Install the package

    Add the Fastify SDK to your app. Register with await app.register(plugin) before routes and route plugins.

    npm install @rasputin-ai/fastify

  2. 2

    Set your release

    Pass a Git commit SHA as release. On common hosts you can use the platform's existing variable instead of setting RASPUTIN_RELEASE.

    How to set the release field
  3. 3

    Create your client

    Initialize Rasputin once when your app starts.

    import Fastify from 'fastify';
    import { RasputinInit } from '@rasputin-ai/fastify';
    
    const { client, plugin } = RasputinInit({
      dsn: process.env.RASPUTIN_DSN!,
      projectApiKey: process.env.RASPUTIN_PROJECT_API_KEY!,
      release: process.env.RASPUTIN_RELEASE!,
      environment: 'production',
    });
    
    const app = Fastify();
    
    await app.register(plugin); // Register before routes and route plugins.
    app.get('/health', async () => 'ok');

  4. 4

    That's it

    Uncaught errors will report on a long-running Node or Bun process.

    Set up the runtime recorder