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: v8View latest version
Follow these steps to set up your Mercury Bank and Slack integration:
- Log in to your Mercury account at https://mercury.com
- Navigate to Developer Settings
- Create a new API key with the following permissions:
accounts:read
- To read account informationtransactions:read
- To read transaction data
- Copy your API key for the next step
Set up the following environment variables in Val Town:
MERCURY_API_KEY
- Your Mercury API key from step 1SLACK_SIGNING_SECRET
- You'll get this in step 3
- Go to https://api.slack.com/apps and click "Create New App"
- Choose "From scratch" and give your app a name (e.g., "Mercury Bank")
- Select the workspace where you want to install the app
- Under "Basic Information", note your "Signing Secret" and add it to Val Town as
SLACK_SIGNING_SECRET
- Under "Slash Commands", create a new command:
- Command:
/mercury
- Request URL: Your Val Town HTTP endpoint URL (copy from the Val Town UI)
- Short Description: "Interact with your Mercury bank account"
- Usage Hint: "[balance|transactions|search] [args]"
- Command:
- Under "OAuth & Permissions", add the following scopes:
commands
- To create slash commandschat:write
- To post messages in channels
- Install the app to your workspace
- In Slack, try the command
/mercury help
to see available commands - Try
/mercury balance
to see your account balances - Try
/mercury transactions 5
to see your 5 most recent transactions
- If you see "An unexpected error occurred", check your Val Town logs for details
- Ensure your Mercury API key has the correct permissions
- Verify that your Slack app is properly configured with the correct URL
- Your Mercury API key has access to sensitive financial data. Keep it secure.
- Consider implementing additional authentication if multiple users will access this integration.
- For production use, implement proper request signature verification from Slack.