This repository contains a Cloud Function designed to forward incoming SMS messages received through the SMS Gateway for Android™ Webhooks to a Discord Webhook.
- Node.js installed on your machine
- SMS Gateway installed on your device in any mode: Local, Cloud or Private
- A Discord Server with Webhook registered as described at https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks
- Clone this repository to your local machine.
- Install the required dependencies by running
npm install
. - Set up your environment variables to include:
API_KEY
: Random value, which will be passed to cloud function inapiKey
query parameter from webhook.WEBHOOK_URL
: Discord Webhook URL.
- Deploy the function to your preferred cloud provider. You might need to make some changes to the source code, please consult with your cloud provider documentation.
- Register webhook in SMS Gateway with the URL of your deployed function adding
?apiKey=YOUR_API_KEY
query parameter.
Ensure you have the following environment variables set up:
API_KEY
: Random value, which will be passed to cloud function inapiKey
query parameter from webhook for security purposes.WEBHOOK_URL
: Discord Webhook URL.
The function is triggered by incoming webhook events from SMS Gateway. When an SMS message is received, the function validates the API key, processes the message, and forwards it to the specified Discord webhook.
Contributions are welcome! Feel free to open an issue or submit a pull request.
This project is licensed under the Apache-2.0 License - see the LICENSE file for details.