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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@ewjdev/anyclick-github

v3.0.0

Published

GitHub adapter for UI feedback - includes browser HTTP adapter and Node-side GitHub integration

Readme

@ewjdev/anyclick-github

GitHub adapter for UI feedback - create issues with rich context and screenshots

npm version License: MIT

Overview

@ewjdev/anyclick-github provides adapters for integrating anyclick with GitHub Issues. Includes a browser-side HTTP adapter and a server-side GitHub API client.

Installation

npm install @ewjdev/anyclick-github

Setup

Media Branch (Required for Screenshots)

If your feedback includes screenshots, they are uploaded to a dedicated orphan branch in your repository. Run this command once during initial setup:

# Using environment variables
GITHUB_TOKEN=ghp_xxx GITHUB_REPO={repo-user}/your-repo npx @ewjdev/anyclick-github setup-media-branch

# Or using CLI arguments
npx @ewjdev/anyclick-github setup-media-branch -t ghp_xxx -o your-org -r your-repo

# Custom branch name (default: issues/src)
npx @ewjdev/anyclick-github setup-media-branch -b feedback-assets

Or programmatically in your setup script:

import { createGitHubAdapter } from "@ewjdev/anyclick-github/server";

const repoName = process.env.GITHUB_REPO;
const [owner, repo] = repoName.split("/");

const github = createGitHubAdapter({
  token: process.env.GITHUB_TOKEN!,
  owner,
  repo,
});

// Creates the branch if it doesn't exist
await github.ensureMediaBranch();

// Check if branch exists
const exists = await github.mediaBranchExists();

Quick Start

Browser Side

"use client";

import { FeedbackProvider } from "@ewjdev/anyclick-react";
import { createHttpAdapter } from "@ewjdev/anyclick-github";

const adapter = createHttpAdapter({
  endpoint: "/api/feedback",
});

<FeedbackProvider adapter={adapter}>{children}</FeedbackProvider>;

Server Side

// app/api/feedback/route.ts
import { createGitHubAdapter } from "@ewjdev/anyclick-github/server";

const repoName = process.env.GITHUB_REPO;

const [owner, repo] = repoName.split("/");

const github = createGitHubAdapter({
  owner,
  repo,
  token: process.env.GITHUB_TOKEN!,
});

export async function POST(request: Request) {
  const payload = await request.json();
  const result = await github.submit(payload);
  return Response.json(result);
}

Features

  • 📝 Issue Creation - Automatic GitHub Issue creation
  • 📸 Screenshot Uploads - Embed screenshots as issue attachments
  • 🏷️ Dynamic Labels - Configure labels based on feedback type
  • ✏️ Custom Formatting - Full control over issue title and body

Configuration

HTTP Adapter (Browser)

const adapter = createHttpAdapter({
  endpoint: "/api/feedback",
  headers: {
    "X-Custom-Header": "value",
  },
});

GitHub Adapter (Server)

const github = createGitHubAdapter({
  owner: "your-org",
  repo: "your-repo",
  token: process.env.GITHUB_TOKEN!,

  // Dynamic labels
  getLabels: (payload) => {
    const labels = ["feedback"];
    if (payload.type === "bug") labels.push("bug");
    if (payload.type === "feature") labels.push("enhancement");
    return labels;
  },

  // Custom title
  getTitle: (payload) => {
    const emoji = payload.type === "bug" ? "🐛" : "✨";
    return `${emoji} ${payload.comment?.slice(0, 80) || "Feedback"}`;
  },

  // Custom body formatting
  getBody: (payload) => {
    return formatFeedbackAsMarkdown(payload);
  },

  // Assign to users
  getAssignees: (payload) => {
    return payload.type === "bug" ? ["triage-team"] : [];
  },
});

Custom Markdown Formatting

import { formatFeedbackAsMarkdown } from "@ewjdev/anyclick-github/server";

// Use the built-in formatter
const markdown = formatFeedbackAsMarkdown(payload);

// Or create custom formatting
const github = createGitHubAdapter({
  // ...config
  getBody: (payload) => `
## ${payload.type === "bug" ? "🐛 Bug Report" : "✨ Feature Request"}

**Comment:** ${payload.comment || "No comment"}

### Element
- Selector: \`${payload.element.selector}\`
- Text: ${payload.element.innerText}

### Page
- URL: ${payload.page.url}
- Viewport: ${payload.page.viewportWidth}x${payload.page.viewportHeight}
  `,
});

Environment Variables

GITHUB_TOKEN=ghp_xxxxxxxxxxxx
GITHUB_REPO=repo-owner/your-repository-name

Required Token Scopes

  • repo - Full control of private repositories (required for screenshot uploads)
  • public_repo - Access public repositories only (for public repos)

Media Branch Configuration

Screenshots are uploaded to an orphan branch (default: issues/src). Configure via adapter options:

const github = createGitHubAdapter({
  // ...required options
  mediaBranch: "feedback-media", // Custom branch name
  assetsPath: "screenshots", // Custom path within branch
});

Documentation

For full documentation, visit anyclick.ewj.dev/docs/adapters

Related Packages

License

MIT © anyclick