Unlisted
Like
Mercury
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data ā all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v16View latest version
This project integrates Mercury Bank's API with Slack, allowing you to:
- Check account balances
- View recent transactions
- Get notifications for important account events
- Search and filter transactions
- Receive automatic notifications for new transactions
/backend/
- Server-side code for handling API requestsindex.ts
- Main HTTP entry pointmercury.ts
- Mercury API clientslack.ts
- Slack message formatting and command handlingnotifications.ts
- Transaction notification systemcron.ts
- Scheduled job to check for new transactions
/shared/
- Shared types and utilitiestypes.ts
- TypeScript interfaces for Mercury and Slack data
- Mercury API credentials (stored as environment variables)
- Slack App with slash commands configured
- Slack Incoming Webhook URL for transaction notifications
- Webhook URL from this Val pointing to your Slack app
Once configured, you can use the following slash commands in Slack:
/mercury balance
- Check your account balances/mercury transactions [count]
- View recent transactions/mercury search [query]
- Search transactions
The integration supports two methods for transaction notifications:
-
Webhook Method (if Mercury supports webhooks):
- Receives real-time notifications from Mercury when transactions occur
- Posts formatted transaction details to your Slack channel immediately
-
Polling Method (fallback option):
- Regularly checks for new transactions via the Mercury API
- Compares with previously seen transactions to identify new ones
- Posts new transaction details to your Slack channel
- All API credentials are stored as environment variables
- No sensitive data is logged or stored