Skip to content

feat: Add Tchap channel adapter#42

Closed
kaaloo wants to merge 9 commits intoletta-ai:mainfrom
etalab-ia:feature/tchap-channel-adapter
Closed

feat: Add Tchap channel adapter#42
kaaloo wants to merge 9 commits intoletta-ai:mainfrom
etalab-ia:feature/tchap-channel-adapter

Conversation

@kaaloo
Copy link

@kaaloo kaaloo commented Jan 30, 2026

Adds support for Tchap (French government Matrix instance) and general Matrix servers.

Includes:

  • New TchapAdapter class using matrix-bot-sdk.
  • E2EE support (enabled by default).
  • Interactive onboarding via CLI (lettabot onboard).
  • Helper script for stable bot access tokens (npm run tchap-login).
  • Documentation in docs/tchap-setup.md.

Tested on matrix.i.tchap.gouv.fr and matrix.dev01.tchap.incubateur.net.

kaaloo and others added 5 commits January 30, 2026 18:49
Direnv uses .envrc for environment variables which may contain secrets.
This file should not be committed to the repository.

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>
Implements Tchap/Matrix integration using matrix-bot-sdk.

- Adds src/channels/tchap.ts with E2EE, DM pairing, and editing support

- Updates main.ts to load Tchap adapter

- Adds configuration to .env.example

- Fixes WhatsApp adapter build error (legacy export)
@kaaloo kaaloo marked this pull request as ready for review January 30, 2026 17:53
Copy link
Contributor

@cpfiffer cpfiffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution! The adapter is well-implemented with good E2EE support, French localization, and clean integration with the existing patterns.

Suggestion: Rename from "Tchap" to "Matrix"

Since the adapter works with any Matrix homeserver (matrix.org, self-hosted Synapse, Tchap, etc.), I'd suggest marketing it as a Matrix adapter rather than Tchap-specific:

Renames:

  • TchapAdapterMatrixAdapter
  • src/channels/tchap.tssrc/channels/matrix.ts
  • TCHAP_* env vars → MATRIX_* (e.g., MATRIX_HOMESERVER_URL, MATRIX_ACCESS_TOKEN)
  • TchapConfigMatrixConfig
  • Channel id: "tchap""matrix"

Docs:

  • Rename docs/tchap-setup.mddocs/matrix-setup.md
  • Title: "Matrix Setup Guide (including Tchap)"
  • Mention Tchap as a specific use case for French government users

This makes the adapter more discoverable and useful to the broader Matrix community while still supporting Tchap users.

The French localization for pairing messages is a nice touch - we could keep that as a config option or detect based on homeserver URL.

Let me know what you think!

@kaaloo kaaloo marked this pull request as draft January 31, 2026 03:34
@cpfiffer
Copy link
Contributor

cpfiffer commented Feb 2, 2026

How is this PR going? I'm happy to take it over.

@cpfiffer
Copy link
Contributor

cpfiffer commented Mar 4, 2026

Closing this draft for stale triage cleanup. It has been inactive/conflicting for over a month and is largely superseded by current Matrix-focused work in #430. If you want to continue this line of work, please reopen with a refreshed branch (or open a new PR from latest main).

@cpfiffer cpfiffer closed this Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants