hackmdio / hackmdio/api-client

Feature request: endpoints for retrieving note comments and reactions

Open
#48 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
20
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Summary

The @hackmd/api client currently has no methods for retrieving comment or reaction data from notes. The only comment-related field exposed is commentPermission (controlling who can comment), but the actual comment content, threads, and reactions are completely inaccessible via the API.

Request

Add API endpoints and corresponding client methods for retrieving comments and reactions:

Proposed endpoints
GET /v1/notes/:noteId/comments
GET /v1/notes/:noteId/reactions
Proposed client methods
// Get all comments on a note (including replies and reactions per comment)
async getComments(noteId: string): Promise<Comment[]>

// Get all reactions on a note
async getReactions(noteId: string): Promise<Reaction[]>
Suggested response types
interface Comment {
  id: string
  author: {
    id: string
    name: string
  }
  body: string
  createdAt: string  // ISO 8601
  updatedAt: string  // ISO 8601
  resolved: boolean
  range?: {
    startLine: number
    endLine: number
  }
  replies: Reply[]
  reactions: ReactionGroup[]
}

interface Reply {
  id: string
  author: {
    id: string
    name: string
  }
  body: string
  createdAt: string
}

interface ReactionGroup {
  emoji: string
  users: string[]  // user IDs
}

interface Reaction {
  noteId: string
  emoji: string
  user: {
    id: string
    name: string
  }
  createdAt: string
}

Motivation

HackMD's commenting and reaction features are valuable for collaboration, but teams that use the API or CLI to sync notes to external systems (e.g., GitHub repositories) lose all of this context. Exposing comment and reaction data via the API would enable:

  • Backing up discussion context alongside note content
  • Building integrations that preserve collaboration history
  • Automating workflows that depend on comment/reaction data

Related

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by reviewing the existing @hackmd/api client methods and the related issues #428 and #207; the work is complete when the proposed comment and reaction endpoints, client methods, and response types are defined and supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.