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

chat-adapter-jira

v0.1.0

Published

Jira Cloud adapter for Vercel Chat SDK — issue comments as chat threads

Downloads

142

Readme

chat-adapter-jira

npm version License: MIT

Jira Cloud adapter for the Vercel Chat SDK. Maps Jira issues to Chat SDK threads and issue comments to messages, with bidirectional ADF (Atlassian Document Format) conversion.

Install

pnpm add chat-adapter-jira chat @chat-adapter/shared

Quick Start

import { Chat } from "chat";
import { createJiraAdapter } from "chat-adapter-jira";

const adapter = createJiraAdapter({
  site: process.env.JIRA_SITE,           // e.g., "mycompany" for mycompany.atlassian.net
  email: process.env.JIRA_EMAIL,
  apiToken: process.env.JIRA_API_TOKEN,
  webhookSecret: process.env.JIRA_WEBHOOK_SECRET,
});

const chat = new Chat({
  adapter,
  async onMessage({ message, thread, reply }) {
    await reply(`Got it — looking into ${message.raw.issue.key} now.`);
  },
});

// Mount the webhook handler on your HTTP server
// POST /api/webhooks/jira → chat.handleWebhook(request)

Configuration

Environment Variables

| Variable | Required | Description | |---|---|---| | JIRA_SITE | Yes | Site domain (e.g., mycompany for mycompany.atlassian.net) | | JIRA_EMAIL | Yes | Email for API token auth | | JIRA_API_TOKEN | Yes | API token from id.atlassian.com | | JIRA_WEBHOOK_SECRET | Yes | Webhook HMAC secret | | JIRA_BOT_NAME | No | Bot display name (auto-detected if omitted) | | JIRA_BOT_ACCOUNT_ID | No | Bot account ID (auto-detected if omitted) |

Jira Webhook Setup

In Jira, go to Settings → System → Webhooks and add:

  • URL: Your webhook endpoint (e.g., https://your-app.com/api/webhooks/jira)
  • Secret: Same value as JIRA_WEBHOOK_SECRET
  • Events: Check comment_created (and optionally comment_updated)
  • JQL filter (optional): project = PROJ to limit to specific projects

Features

Issue Comments

Inbound comments on Jira issues are delivered as Chat SDK messages. The adapter handles the full comment lifecycle.

async onMessage({ message, reply }) {
  // message.threadId is "jira:PROJ-42"
  // message.text is the plain text extracted from ADF
  // message.formatted is the mdast AST converted from ADF
  await reply("Thanks for the update!");
}

Rich Text (ADF) Support

The adapter bidirectionally converts between Jira's Atlassian Document Format and the Chat SDK's mdast AST. Supported elements: paragraphs, headings, bold, italic, strikethrough, code (inline and blocks), links, lists, blockquotes, tables, mentions, emoji, and horizontal rules.

Edit and Delete Comments

await chat.editMessage(threadId, commentId, "Updated response");
await chat.deleteMessage(threadId, commentId);

Markdown Messages

Send formatted comments using markdown (automatically converted to ADF):

await reply({ markdown: "**Status:** Fixed in `v2.1.0` :rocket:" });

Fetch Comment History

const { messages, nextCursor } = await chat.fetchMessages(threadId, { limit: 50 });

List Issues (JQL)

const { threads } = await chat.listThreads(channelId);
// channelId = "jira:PROJ" — lists open issues in the PROJ project

Thread and Project Info

const thread = await chat.fetchThread("jira:PROJ-42");
// thread.metadata: { summary, status, issueType, assignee, priority, ... }

const channel = await chat.fetchChannelInfo("jira:PROJ");
// channel: { name, metadata: { key, description, lead, issueTypes } }

Thread ID Format

| Format | Example | |---|---| | jira:{issueKey} | jira:PROJ-42 |

Channel IDs represent projects: jira:PROJ

Unsupported Operations

These methods throw NotImplementedError:

  • addReaction() / removeReaction() — Jira has reactions in the UI but no public API
  • startTyping() — no Jira equivalent
  • openDM() — issues are created by users, not the bot
  • stream() / openModal() / postEphemeral() / scheduleMessage()

Self-Echo Prevention

The adapter automatically skips comments from the bot's own account (resolved on initialize() via GET /myself).

License

MIT