Skip to main content

chat-adapter-github

GitHub adapter for chat-py. Python port of upstream packages/adapter-github.

Handles issue_comment and pull_request_review_comment webhooks; supports PAT, single-tenant GitHub App, and multi-tenant GitHub App auth.

Install

uv add chat-py chat-py-adapter-github chat-py-adapter-state-pg

Auth / config

Three discriminated config variants:

Mode Required fields Env var fallbacks
PAT (personal access token) token GITHUB_TOKEN
Single-tenant App appId + installationId + privateKey GITHUB_APP_ID, GITHUB_INSTALLATION_ID, GITHUB_APP_PRIVATE_KEY
Multi-tenant App appId + privateKey GITHUB_APP_ID, GITHUB_APP_PRIVATE_KEY

All variants additionally accept: webhookSecret (required for signature verify), botUserId, apiUrl, logger, userName.

Minimal example

from chat import Chat
from chat_adapter_github import create_github_adapter
from chat_adapter_state_pg import create_postgres_state

bot = Chat(
    user_name="mybot",
    adapters={"github": create_github_adapter(
        token="ghp_...",             # PAT mode
        webhookSecret="...",
    )},
    state=create_postgres_state(url="postgres://localhost/chat"),
)


@bot.on_new_mention
async def respond(thread, message):
    await thread.post("On it.")

Mount bot.handle_webhook("github", body, headers) under /api/webhooks/github. The handler verifies X-Hub-Signature-256 via verify_github_signature.

Thread ID

GitHub thread IDs encode {owner}/{repo}#{issue_or_pr_number}, optionally with a comment ID for review threads.

Features

  • HMAC-SHA256 webhook signature verify (verify_github_signature)
  • GFM markdown rendering via GitHubFormatConverter
  • card_to_github_markdown / card_to_plain_text fallbacks (no native card support)
  • Reactions (on_reaction) for issue comments and PR review comments

Parity notes

  • No card or streaming support — GitHub comments are markdown-only. Cards degrade to GFM via card_to_github_markdown.
  • Error wrapping (handle_github_error) maps GitHub REST errors to the shared AdapterError hierarchy.

Test

uv run pytest packages/chat-adapter-github

# Live
GITHUB_TOKEN=... uv run pytest packages/chat-integration-tests -k github

Upstream

https://github.com/vercel/chat/tree/main/packages/adapter-github

Metadata

Release files for chat-py-adapter-github 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for chat-py-adapter-github 0.1.0
File Interpreter ABI Platform Actions
chat_py_adapter_github-0.1.0-py3-none-any.whl Python 3 none any Details for chat_py_adapter_github-0.1.0-py3-none-any.whl

Release files / chat_py_adapter_github-0.1.0-py3-none-any.whl

Download URL chat_py_adapter_github-0.1.0-py3-none-any.whl
Size 22.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa15e472d8612eb163786b3c83c4df9e0316b47617311b9696d677ad4b0c5a90
BLAKE2b-256 checksum
How to use checksums
900c613958da8df1f4a665657a48b57d7407a4c17e6092254354d5d73a26f00e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for chat-py-adapter-github 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page