Summary
I'd like to add support for bearer authentication to enable notifications to private ntfy topics. Currently, claude-code-ntfy only supports public topics, which limits its usefulness for users who want private/secure notifications.
Current Limitation
The current NtfyClient implementation only supports unauthenticated requests to public ntfy topics. Many users host private ntfy servers or use ntfy.sh's authentication features to secure their notification topics.
Proposed Solution
Add bearer authentication support by:
- Config support: Add
ntfy_auth_token field to config (YAML + env var)
- Client updates: Update
NtfyClient to accept and store auth tokens
- HTTP headers: Add
Authorization: Bearer <token> header when token is provided
- Backward compatibility: Keep auth optional (empty token = no auth)
Implementation Details
# Example config.yaml
ntfy_topic: "private-topic"
ntfy_server: "https://ntfy.sh"
ntfy_auth_token: "tk_your_token_here" # New field
# Environment variable support
export CLAUDE_NOTIFY_AUTH_TOKEN="tk_your_token_here"
The implementation would follow ntfy's authentication documentation using bearer tokens.
Benefits
- Enables use with private ntfy servers
- Supports ntfy.sh's paid plans with authentication
- Maintains security for sensitive notifications
- Zero impact on existing public topic users
Request
I've implemented this feature locally and have it working with proper tests. The changes are minimal and maintain full backward compatibility. Would you be interested in a pull request for this feature?
The implementation includes:
- ✅ Config loading (YAML + env vars)
- ✅ Updated NtfyClient with auth support
- ✅ Proper HTTP bearer authentication
- ✅ Comprehensive tests
- ✅ Updated documentation
- ✅ Backward compatibility
Let me know if you'd like me to submit a PR!
Disclaimer: I made the changes with claude code and tested locally & with updated tests.
Summary
I'd like to add support for bearer authentication to enable notifications to private ntfy topics. Currently, claude-code-ntfy only supports public topics, which limits its usefulness for users who want private/secure notifications.
Current Limitation
The current
NtfyClientimplementation only supports unauthenticated requests to public ntfy topics. Many users host private ntfy servers or use ntfy.sh's authentication features to secure their notification topics.Proposed Solution
Add bearer authentication support by:
ntfy_auth_tokenfield to config (YAML + env var)NtfyClientto accept and store auth tokensAuthorization: Bearer <token>header when token is providedImplementation Details
The implementation would follow ntfy's authentication documentation using bearer tokens.
Benefits
Request
I've implemented this feature locally and have it working with proper tests. The changes are minimal and maintain full backward compatibility. Would you be interested in a pull request for this feature?
The implementation includes:
Let me know if you'd like me to submit a PR!
Disclaimer: I made the changes with claude code and tested locally & with updated tests.