This bot started as an internal tooling project to help enforce and meet SLAs at Supabase. It borrows many mechanisms and most of the functionality designed in supa_queue while extending them to be a standalone product.
Currently supported | Includes Edge Function? | Has setup guide? |
---|---|---|
Zendesk | Yes | Yes |
Freshdesk | Yes | Yes |
Note
- We encourage contributions to include other Help/Support platforms.
- Platform specific Edge Functions are in this directory
Here's the top-level diagram explaining how it works:
-
It monitors for new tickets in a few slack channels. For example, you could set different priorities depending on the Tier/Plan of your customer.
-
If there is no message after an
X
amount of time, then it will post on the channels to alert people working in support. -
You can respond in the thread with a
@mention
to the bot, so they will know you acknowledged the ticket and will delay future comms in 30 min.
- Setup a Supabase project for the bot here
- Install the Supabase CLI
- Login to your Supabase instance in the CLI
- Run the initial.sql in the database.
- Deploy the Supabase Edge Functions with the option
--no-verify-jwt
It will depend on the integrations available but we recommend setting each slack channel for each level of Priority you have example: (Enterprise, Teams, Pro, Free). This allows you to set different SLA enforcements on each of them.
Use this manifest to create the bot:
{
"display_information": {
"name": "Sla Buddy",
"description": "Your helpful fren",
"background_color": "#4061c7"
},
"features": {
"bot_user": {
"display_name": "Sla Buddy",
"always_online": false
},
"slash_commands": [
{
"command": "/add-support-engineer",
"url": "https://supabase.slabuddy.com/functions/v1/modal-handler/add-engineer",
"description": "adds an new support engineer to SLA Buddy",
"usage_hint": "Just run it without arguments and use the modal",
"should_escape": false
},
{
"command": "/sla-setup",
"url": "https://supabase.slabuddy.com/functions/v1/modal-handler/sla-setup",
"description": "setup or edit the configuration for a given channel",
"usage_hint": "Just run it without arguments and use the modal",
"should_escape": false
}
]
},
"oauth_config": {
"scopes": {
"bot": [
"app_mentions:read",
"channels:history",
"channels:join",
"channels:read",
"chat:write",
"links:write",
"users:read",
"commands",
"files:write",
"chat:write.public"
]
}
},
"settings": {
"event_subscriptions": {
"request_url": "https://supabase.slabuddy.com/functions/v1/get-mentions",
"bot_events": [
"app_mention"
]
},
"interactivity": {
"is_enabled": true,
"request_url": "https://supabase.slabuddy.com/functions/v1/modal-handler/modal"
},
"org_deploy_enabled": false,
"socket_mode_enabled": false,
"token_rotation_enabled": false
}
}
Note
You'll need to edit the URLs being called according to your project URL on Supabase.
It is necessary to set up secrets to get the SLA Buddy working. In this section we go over the secrets that need to be set.
- service_role
- Supabase API URL
Example:
service_role: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InNsYWJ1ZGR5Iiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsInlvdSI6ImFyZSBzbmVha3kg8J-kq_CfmYMiLCJpYXQiOjE2NTQ1NDA5MTYsImV4cCI6MTk3MDExNjkxNn0.eGFfzIM05qy6ALGVJ4rCSiadFThqeGfCxCdfK_Zyus0
supabase_api_url: https://slabuddy.supabase.co
- SLACK_BOT_TOKEN
- SLACK_ORG
- GIPHY_API (optional // requires minor tweaking in an edge function to remove this)
- Help Platform secrets [depends on the platform detailed instructions below]
Frequentely Asked Questions
Yes, on a busy day, you should expect up to around 7500 edge function invocations/day which would sum up to 225k invocations/month in the billing period. The memory might be constrained. If you want to make it more reliable, a Pro Plan + small compute add-on is recommended. This would be 30$/month if you don't use supabase for anything else, but around 15$/month if you already use a pro Supabase org.
We believe that even if you are unable to answer to a user, you should still be able to give them some information about the next steps. E.g I am escalating this to the responsible team and a human-provided message will enhance the trust of your users.
We believe that the trickiest part of a good experience is to nail the first two escalation levels. Since these will be the most widely used, it should be the least intrusive as possible.
So, you should customize the Edge-Function post-ticket-escalation
with more personalized tagging ensuring that it fits your team.
- Add Support engineers to the Bot using the
slash
command/add-support-engineer
- Add @SLA Buddy to the channels that receive ticket information
- Set the escalation levels & messages with
/sla-setup
Instruction guide for setting up with Freshdesk
https://support.freshdesk.com/support/solutions/articles/206103-the-slack-app
To push notifications to Slack when new tickets are created in Freshdesk, go to Admin > Workflows > Automations > Ticket creation tab > New rule
*Ticket ID*: <message here>
*Ticket priority*: <priority here>
*Type*: <extra data for the ticket>
Setting the Freshdesk secrets to be available on Supabase Edge Functions:
Secrets needed:
- FRESHDESK_DOMAIN
- FRESHDESK_API
Instruction guide for setting up with Zendesk
https://support.zendesk.com/hc/en-us/community/posts/4409515204506-Send-notifications-to-Slack
This is the format expected by the scanner edge function:
*Ticket ID*: <message here>
*Ticket priority*: <priority here>
*Type*: <extra data for the ticket>
You can check this guide for sending slack messages. Example of attachment to use for the message box:
{
"attachments": [
{
"fallback": "New problem ticket created: {{ticket.id}}",
"pretext": "New problem ticket created: {{ticket.id}}",
"color": "#D00000",
"fields": [
{
"title": "Ticket ID",
"value": "{{ticket.id}}",
"short": true
},
{
"title": "Ticket Priority",
"value": "{{ticket.priority}}",
"short": true
},
{
"title": "Type",
"value": "{{ticket.type}}",
"short": true
}
]
}
]
}
You can check [Zendesk placeholders](https://support.zendesk.com/hc/en-us/articles/4408886858138-Zendesk-Support-placeholders-reference) if you want to configure more how to pass type and other data.
Setting the Zendesk secrets to be available on Supabase Edge Functions:
Secrets needed:
- ZENDESK_EMAIL
- ZENDESK_SUBDOMAIN
- ZENDESK_API_TOKEN
This code is licensed under Apache License 2.0.