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

@netcentric/cm-notify-core

v1.0.12

Published

Adobe Cloud Manager Pipeline Notifications to Slack, Teams and Email

Readme

cm-notify-core

Version Release Status CodeQL Analysis semver: semantic-release License

Cloud Manager Notify Core is a Node.js application that process Cloud Manager events and sends notifications to Slack, Microsoft Teams or Email.

Installation

npm install --omit=dev --omit=peer @netcentric/cm-notify-core

Usage

const { CMNotify } = require('@netcentric/cm-notify-core');

const cmNotify = new CMNotify();

router.post('/cm-webhook', async (req, res, next) => {
  const isValidEvent = await cmNotify.post(req);

  if (!isValidEvent) {
    return res.status(400).send('Invalid event');
  }
  // Message is sent to Slack/Teams
  res.send('Valid event');
})
  • If you need to wait for the message to be sent, you can use the waitResponse param in post method.
  • If you need to verify the request, you can use the verify param in post method. For verification you need to set the secret in the config. The secret can be a string, path to PublicKey or content of Public Key.
  /**
 * Sends notifications to the configured channels.
 * @param {Object} req - The request object containing the event data.
 * @param {Object} config - Configuration options for the method.
 * @param {boolean} [config.verify=false] - If true, verifies the request signature before processing.
 * @param {boolean} [config.waitResponse=false] - If true, waits for all notifications to be settled before returning.
 * @returns {Promise<Array<PromiseSettledResult<Awaited<*>>>|boolean>} - Returns a promise that resolves to the notification results or a boolean.
 */
  async post(req, {
    verify = false,
    waitResponse = false
  }) {}

Example:

const { CMNotify } = require('@netcentric/cm-notify-core');

const cmNotify = new CMNotify();

router.post('/cm-webhook', async (req, res, next) => {
  try {
    const allMessages = await cmNotify.post(req, { waitResponse: true });
    allMessages.forEach((result, index) => {
      if (result.status === 'fulfilled') {
        console.log(`Posting Message ${index + 1} responded with value:`, result.value);
      } else if (result.status === 'rejected') {
        console.log(`Posting Message ${index + 1} rejected with reason:`, result.reason);
      }
    });
    // Message is sent to Slack/Teams/Email
    res.send('Valid event');
  } catch (error) {
    console.error(error);
    res.status(400).send('Error sending messages');
  }
});

Configuration

/**
 * @typedef {Object} CmNotifyConfig
 * @property {string} [slackWebhook] - The Slack webhook URL (default: from environment variable SLACK_WEBHOOK).
 * @property {string} [teamsEmail] - The Teams channel email address (default: from environment variable TEAMS_EMAIL).
 * @property {string} [teamsWebhook] - The Teams webhook URL (default: from environment variable TEAMS_WEBHOOK).
 * @property {string} [orgName] - The name of the organization (default: from environment variable ORGANIZATION_NAME).
 * @property {string} [clientId] - The client ID (default: from environment variable CLIENT_ID).
 * @property {string} [title] - The title of the notification (default: 'Cloud Manager Pipeline Notification').
 * @property {string} [fromEmail] - The sender's email address (default: from environment variable EMAIL_FROM).
 * @property {string} [dataPath] - The path to the directory containing data JSON files (default: from environment variable DATA_PATH or '.data').
 * @property {string} [secret] - The secret used for verification, can be client_secret string, path to PublicKey or content of Public Key (default: from environment variable SECRET).
 */
class CMNotify {
  /**
   * @constructor
   * @param {CmNotifyConfig} config - Configuration object for CMNotify.
   */
  constructor(config = {}) {}
}

Messages

  • Slack
Cloud Manager Pipeline Notification:
STATUS: ended
DATE: 10.04.2025, 22:06:36 CET
NAME: piepeline-name
TARGET: STAGE_PROD
TYPE: WEB_TIER
URL: program/12345/pipeline/12345/execution/12345

Setup

Cloud Manager pipelines data (optional)

  • The application needs a list of Cloud Manager pipelines to create message details.
  • The list of pipelines can be generated using the @netcentric/cm-notify CLI.
  • Or you can create the file manually. File name needs to be pipelines-data.json located in .data directory.
[
  {
    "name": "pipeline-name",
    "id": "1234567",
    "buildTarget": "DEV",
    "type": "FRONT_END"
  },
  {
    "name": "pipeline-name-dev",
    "id": "1233217",
    "buildTarget": "DEV",
    "type": "CI_CD"
  }
]
  • More info in the @netcentric/cm-notify repo.
  • This data is optional, but it is used to create a more detailed message.
  • If the data is not provided, the message will contain the pipeline Status, Date and URL.
  • The message will not contain the pipeline name, target and type.

Google Auth Token (optional, only if Email notification is used)

  • The application uses Google Auth to send emails.
  • You can use the @netcentric/cm-notify CLI to generate the token.
  • Or you can create the token manually.
  • The token is stored in the .data directory in the gmail-token.json file.
  • For GMAIL API you also need google-credentials.json in the .data directory.
  • More info in the @netcentric/cm-notify repo.

Environment Variables

  • Environment variables are used as a fallback if configuration is not provided in the constructor.
  • Recommended to use .env file for sensitive data.
  • Create a .env file in the root folder with the following variables:

Minimal required envs:

# Cloud Manager envs
ORGANIZATION_NAME=orgname# used to build the URL for the Pipeline
# Messanger apps env
SLACK_WEBHOOK=slack_webhook_url

All envs:

# Cloud Manager envs
ORGANIZATION_NAME=orgname# used to build the URL for the Pipeline
CLIENT_ID=e231#used to validate CM event
# Messanger apps env
SLACK_WEBHOOK=https://hooks.slack.com/services/123
# Teams webhook URL
TEAMS_WEBHOOK=https://prod-123.westus.logic.azure.com:443/workflows/123
# Teams email, alternative approach, if Webhook is disabled
[email protected]
# Email sender env
# Only needed if Teams email approach is used
[email protected]
# App env (optional)
DATA_PATH=.data# path to the data folder wher tokens are stored, default is .data

Cloud Manager Webhook

  1. Go to https://developer.adobe.com/console
  2. Create a new project
  3. Add Events to the project
  4. Select Cloud Manager Events
  5. Configure Webhook URL.