npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gh-datadog-event

v2.3.0

Published

A TypeScript library for working with Datadog events

Readme

gh-datadog-event

A lightweight TypeScript library for sending events to Datadog's Events API. Can be used both as an npm package in your code and as a GitHub Action in your workflows.

npm version ESLint Prettier Vitest TypeDoc GitHub Pages GitHub Marketplace CI

Overview

gh-datadog-event makes it easy to send custom events to your Datadog dashboard from any Node.js application or GitHub workflow. Use it to track deployments, mark significant application events, or create custom alerts.

Usage as an npm package

Installation

npm install gh-datadog-event

Example Usage

import { CreateEvent } from 'gh-datadog-event';

// Set your Datadog API and APP keys as environment variables
// process.env.DATADOG_API_KEY = 'your-api-key';
// process.env.DATADOG_APP_KEY = 'your-app-key';

async function sendDeploymentEvent() {
  const results = await CreateEvent({
    requests: [
      {
        title: 'Deployment Completed',
        text: 'Service successfully deployed to production',
        alertType: 'info',
        priority: 'normal',
        tags: ['environment:production', 'service:api', 'team:backend']
      }
    ]
  });

  console.log(`Event created: ${results[0].eventUrl}`);
}

sendDeploymentEvent();

Usage as a GitHub Action

You can also use this package as a GitHub Action in your workflows to send events to Datadog.

Example Workflow

name: Deploy and Notify

on:
  push:
    branches: [ main ]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      
      # Your deployment steps here...
      
      - name: Notify Datadog of deployment
        uses: sds9-org/datadog-event@v2
        with:
          title: 'Deployment to Production'
          text: 'New version deployed to production environment'
          alertType: 'info'
          priority: 'normal'
          tags: 'environment:production,service:api'
          includeGitHubContext: 'true'
        env:
          DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
          DATADOG_APP_KEY: ${{ secrets.DATADOG_APP_KEY }}

Action Inputs

| Input | Description | Required | Default | | ----- | ----------- | -------- | ------- | | title | Title of the event | Yes | | | text | Text description of the event | Yes | | | alertType | Type of alert (e.g., "error", "warning", "info") | No | info | | priority | Priority of the event (e.g., "normal", "low") | No | normal | | host | Host associated with the event | No | | | tags | Comma-separated list of tags | No | | | aggregationKey | Key to group events together | No | | | sourceTypeName | Source type name for the event | No | | | includeGitHubContext | Whether to include GitHub context in tags | No | true |

Action Outputs

| Output | Description | | ------ | ----------- | | eventUrl | URL of the created event in Datadog | | eventId | ID of the created event |

API Reference

CreateEvent

Main function for creating events in Datadog.

Parameters

See the API documentation for detailed information about the function parameters and return types.

Getting Your Datadog API Keys

To use this library, you need a Datadog API key:

  1. Log in to your Datadog account
  2. Navigate to Organization Settings > API Keys
  3. Create a new API key or use an existing one

For additional functionality, you may also want an Application key:

  1. Navigate to Organization Settings > Application Keys
  2. Create a new Application key

Datadog Event Documentation

For more information about Datadog events, see the official Datadog Events documentation.

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a new branch for your feature or bugfix
  3. Write your code and tests
  4. Submit a pull request with a detailed description of your changes