Skip to content

Commit 6f72201

Browse files
update Slack docs
1 parent d9dc869 commit 6f72201

File tree

5 files changed

+192
-89
lines changed

5 files changed

+192
-89
lines changed

app/notifiers/slack/page.tsx

Lines changed: 192 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@ import type { Metadata } from "next";
22
import DocsNavbarComponent from "../../components/DocsNavbarComponent";
33
import DocsSidebarComponent from "../../components/DocsSidebarComponent";
44
import DocTableOfContentComponent from "../../components/DocTableOfContentComponent";
5-
import Image from "next/image";
65

76
export const metadata: Metadata = {
87
title: "How to configure Slack notifications for Postgresus | Postgresus",
98
description:
10-
"Step-by-step guide to set up Slack notifications for PostgreSQL backup alerts with Postgresus. Learn how to create Slack webhook and configure notifications.",
9+
"Step-by-step guide to set up Slack notifications for PostgreSQL backup alerts with Postgresus. Learn how to create a Slack bot app and configure notifications.",
1110
keywords: [
1211
"Postgresus",
1312
"Slack notifications",
1413
"PostgreSQL backup",
15-
"Slack webhook",
14+
"Slack bot token",
15+
"Slack API",
1616
"backup alerts",
1717
"database notifications",
1818
],
1919
openGraph: {
2020
title: "How to configure Slack notifications for Postgresus | Postgresus",
2121
description:
22-
"Step-by-step guide to set up Slack notifications for PostgreSQL backup alerts with Postgresus. Learn how to create Slack webhook and configure notifications.",
22+
"Step-by-step guide to set up Slack notifications for PostgreSQL backup alerts with Postgresus. Learn how to create a Slack bot app and configure notifications.",
2323
type: "article",
2424
url: "https://postgresus.com/notifiers/slack",
2525
},
2626
twitter: {
2727
card: "summary",
2828
title: "How to configure Slack notifications for Postgresus | Postgresus",
2929
description:
30-
"Step-by-step guide to set up Slack notifications for PostgreSQL backup alerts with Postgresus. Learn how to create Slack webhook and configure notifications.",
30+
"Step-by-step guide to set up Slack notifications for PostgreSQL backup alerts with Postgresus. Learn how to create a Slack bot app and configure notifications.",
3131
},
3232
alternates: {
3333
canonical: "https://postgresus.com/notifiers/slack",
@@ -51,33 +51,43 @@ export default function SlackPage() {
5151
step: [
5252
{
5353
"@type": "HowToStep",
54-
name: "Open Slack workspace",
55-
text: "Navigate to your Slack workspace where you want to receive notifications.",
54+
name: "Go to Slack API",
55+
text: "Navigate to https://api.slack.com/apps and sign in to your Slack workspace.",
5656
},
5757
{
5858
"@type": "HowToStep",
59-
name: "Access Slack apps",
60-
text: "Go to your Slack workspace and access the Apps section.",
59+
name: "Create New App",
60+
text: "Click on 'Create New App' button and choose 'From scratch'.",
6161
},
6262
{
6363
"@type": "HowToStep",
64-
name: "Create incoming webhook",
65-
text: "Search for and add the Incoming Webhooks app to your workspace.",
64+
name: "Configure Bot Permissions",
65+
text: "Navigate to OAuth & Permissions and add the required scopes: chat:write, channels:join, im:write, and groups:write under Bot Token Scopes.",
6666
},
6767
{
6868
"@type": "HowToStep",
69-
name: "Select channel",
70-
text: "Choose the channel where you want to receive backup notifications.",
69+
name: "Install to Workspace",
70+
text: "Install the app to your workspace and authorize it.",
7171
},
7272
{
7373
"@type": "HowToStep",
74-
name: "Copy webhook URL",
75-
text: "Copy the generated webhook URL from Slack.",
74+
name: "Copy Bot Token",
75+
text: "Copy the Bot User OAuth Token that starts with 'xoxb-'.",
76+
},
77+
{
78+
"@type": "HowToStep",
79+
name: "Get Channel ID",
80+
text: "Open your target channel and get the Channel ID from the channel details.",
81+
},
82+
{
83+
"@type": "HowToStep",
84+
name: "Add bot to private channel",
85+
text: "If using a private channel, invite the bot to the channel by mentioning it.",
7686
},
7787
{
7888
"@type": "HowToStep",
7989
name: "Configure in Postgresus",
80-
text: "Paste the webhook URL into Postgresus notifier configuration.",
90+
text: "In Postgresus, add the Bot Token and Channel ID to the Slack notifier configuration.",
8191
},
8292
{
8393
"@type": "HowToStep",
@@ -107,133 +117,226 @@ export default function SlackPage() {
107117
failures and warnings directly in your Slack channels.
108118
</p>
109119

110-
<h2 id="setup-slack-webhook">Setup Slack webhook</h2>
120+
<h2 id="create-slack-app">Create a Slack App</h2>
121+
122+
<h3 id="go-to-slack-api">1. Go to Slack API</h3>
123+
124+
<p>
125+
Navigate to{" "}
126+
<a
127+
href="https://api.slack.com/apps"
128+
target="_blank"
129+
rel="noopener noreferrer"
130+
>
131+
https://api.slack.com/apps
132+
</a>{" "}
133+
and sign in to your Slack workspace.
134+
</p>
135+
136+
<h3 id="create-new-app">2. Create New App</h3>
137+
138+
<p>
139+
Click on <strong>&quot;Create New App&quot;</strong> button.
140+
</p>
141+
142+
<h3 id="choose-from-scratch">
143+
3. Choose &quot;From scratch&quot;
144+
</h3>
145+
146+
<p>
147+
Select <strong>&quot;From scratch&quot;</strong> option when
148+
prompted.
149+
</p>
150+
151+
<h3 id="name-your-app">4. Name your app</h3>
152+
153+
<p>
154+
Enter a name for your app (e.g., &quot;Postgresus
155+
Notifications&quot;) and select the workspace where you want to
156+
install it. Click <strong>&quot;Create App&quot;</strong>.
157+
</p>
158+
159+
<h2 id="configure-bot-permissions">Configure Bot Permissions</h2>
111160

112-
<h3 id="open-slack-workspace">1. Open your Slack workspace</h3>
161+
<h3 id="navigate-to-oauth">
162+
5. Navigate to OAuth &amp; Permissions
163+
</h3>
113164

114165
<p>
115-
Navigate to your Slack workspace where you want to receive
116-
backup notifications.
166+
In the left sidebar, click on{" "}
167+
<strong>&quot;OAuth &amp; Permissions&quot;</strong>.
117168
</p>
118169

119-
<Image
170+
<img
120171
src="/images/notifier-slack/image-1.png"
121-
alt="Open Slack workspace"
122-
width={800}
123-
height={500}
124-
className="my-6 rounded-lg border border-gray-200"
172+
alt="Navigate to OAuth &amp; Permissions"
173+
className="my-6 rounded-lg border border-gray-200 max-w-[700px]"
125174
loading="lazy"
126175
/>
127176

128-
<h3 id="access-slack-apps">2. Access Slack apps</h3>
177+
<h3 id="add-bot-scopes">6. Add Bot Token Scopes (Required)</h3>
129178

130179
<p>
131-
Click on your workspace name in the top left, then select{" "}
132-
<strong>&quot;Settings &amp; administration&quot;</strong>{" "}
133-
<strong>&quot;Manage apps&quot;</strong>.
180+
Scroll down to the <strong>&quot;Scopes&quot;</strong> section
181+
and under <strong>&quot;Bot Token Scopes&quot;</strong>, click{" "}
182+
<strong>&quot;Add an OAuth Scope&quot;</strong>.
134183
</p>
135184

136-
<Image
185+
<p>Add all of the following required scopes:</p>
186+
187+
<ul>
188+
<li>
189+
<code>chat:write</code> - to send messages to channels
190+
</li>
191+
<li>
192+
<code>channels:join</code> - to allow the bot to join public
193+
channels automatically
194+
</li>
195+
<li>
196+
<code>im:write</code> - to send direct messages to users
197+
</li>
198+
<li>
199+
<code>groups:write</code> - to send messages to private
200+
channels
201+
</li>
202+
<li>
203+
<code>channels:history</code> - to read channel history
204+
</li>
205+
</ul>
206+
207+
<img
137208
src="/images/notifier-slack/image-2.png"
138-
alt="Access Slack Apps"
139-
width={600}
140-
height={400}
141-
className="my-6 rounded-lg border border-gray-200"
209+
alt="Add Bot Token Scopes"
210+
className="my-6 rounded-lg border border-gray-200 max-w-[700px]"
142211
loading="lazy"
143212
/>
144213

145-
<h3 id="search-incoming-webhooks">
146-
3. Search for incoming webhooks
147-
</h3>
214+
<h2 id="install-app">Install App to Workspace</h2>
215+
216+
<h3 id="install-to-workspace">7. Install to Workspace</h3>
148217

149218
<p>
150-
In the App Directory, search for{" "}
151-
<strong>&quot;Incoming Webhooks&quot;</strong> and click on it.
219+
Scroll to the top of the{" "}
220+
<strong>&quot;OAuth &amp; Permissions&quot;</strong> page and
221+
click <strong>&quot;Install to Workspace&quot;</strong>.
152222
</p>
153223

154-
<Image
224+
<img
155225
src="/images/notifier-slack/image-3.png"
156-
alt="Search for Incoming Webhooks"
157-
width={700}
158-
height={400}
159-
className="my-6 rounded-lg border border-gray-200"
226+
alt="Install to Workspace"
227+
className="my-6 rounded-lg border border-gray-200 max-w-[700px]"
160228
loading="lazy"
161229
/>
162230

163-
<h3 id="add-to-slack">4. Add to Slack</h3>
231+
<h3 id="authorize-app">8. Authorize the app</h3>
164232

165233
<p>
166-
Click the <strong>&quot;Add to Slack&quot;</strong> button to
167-
install the Incoming Webhooks app to your workspace.
234+
Review the permissions and click{" "}
235+
<strong>&quot;Allow&quot;</strong> to authorize the app.
168236
</p>
169237

170-
<Image
171-
src="/images/notifier-slack/image-4.png"
172-
alt="Add to Slack"
173-
width={700}
174-
height={400}
175-
className="my-6 rounded-lg border border-gray-200"
176-
loading="lazy"
177-
/>
238+
<h3 id="copy-bot-token">9. Copy Bot User OAuth Token</h3>
178239

179-
<h3 id="select-channel">5. Select channel</h3>
240+
<p>
241+
After installation, you&apos;ll see the{" "}
242+
<strong>&quot;Bot User OAuth Token&quot;</strong>. It starts
243+
with <code>xoxb-</code>. Copy this token - you&apos;ll need it
244+
for Postgresus configuration.
245+
</p>
246+
247+
<h2 id="get-channel-id">Get Channel ID</h2>
248+
249+
<h3 id="open-channel">10. Open your target channel</h3>
180250

181251
<p>
182-
Choose the channel where you want to receive backup
183-
notifications, then click{" "}
184-
<strong>&quot;Add Incoming Webhooks integration&quot;</strong>.
252+
In your Slack workspace, open the channel where you want to
253+
receive backup notifications.
185254
</p>
186255

187-
<Image
188-
src="/images/notifier-slack/image-5.png"
189-
alt="Select channel for notifications"
190-
width={600}
191-
height={400}
192-
className="my-6 rounded-lg border border-gray-200"
256+
<h3 id="get-channel-info">11. Get the channel ID</h3>
257+
258+
<p>
259+
Click on the channel name at the top, then scroll down in the
260+
channel details. You&apos;ll find the{" "}
261+
<strong>Channel ID</strong> at the bottom of the
262+
&quot;About&quot; section. It starts with <code>C</code> (for
263+
public channels) or <code>G</code> (for private channels).
264+
</p>
265+
266+
<p>Copy this Channel ID.</p>
267+
268+
<img
269+
src="/images/notifier-slack/image-4.png"
270+
alt="Get Channel ID"
271+
className="my-6 rounded-lg border border-gray-200 max-w-[500px]"
193272
loading="lazy"
194273
/>
195274

196-
<h3 id="copy-webhook-url">6. Copy webhook URL</h3>
275+
<h3 id="add-bot-to-channel">
276+
12. Add bot to channel (required for private channels)
277+
</h3>
197278

198279
<p>
199-
After creating the webhook, you&apos;ll see the{" "}
200-
<strong>Webhook URL</strong>. Copy this URL - you&apos;ll need
201-
it for Postgresus configuration.
280+
<strong>
281+
If you&apos;re using a private channel, you must manually
282+
invite the bot to the channel:
283+
</strong>
202284
</p>
203285

204-
<Image
205-
src="/images/notifier-slack/image-6.png"
206-
alt="Copy webhook URL"
207-
width={700}
208-
height={500}
209-
className="my-6 rounded-lg border border-gray-200"
210-
loading="lazy"
211-
/>
286+
<ol>
287+
<li>
288+
In the private channel, type{" "}
289+
<code>@Postgresus Notifications</code> (or whatever name you
290+
gave your app)
291+
</li>
292+
<li>
293+
Click on the bot name when it appears and select{" "}
294+
<strong>&quot;Add to Channel&quot;</strong> or{" "}
295+
<strong>&quot;Invite to Channel&quot;</strong>
296+
</li>
297+
</ol>
298+
299+
<p>
300+
For <strong>public channels</strong>, the bot will automatically
301+
join when sending the first message (thanks to the{" "}
302+
<code>channels:join</code> permission), so this step is not
303+
necessary.
304+
</p>
212305

213306
<h2 id="configure-postgresus">Configure in Postgresus</h2>
214307

215-
<h3 id="add-slack-notifier">1. Add Slack notifier</h3>
308+
<h3 id="add-slack-notifier">13. Add Slack notifier</h3>
216309

217310
<p>
218311
In Postgresus, navigate to the notifiers settings and add a new
219-
Slack notifier. Paste the webhook URL you copied from Slack.
312+
Slack notifier:
220313
</p>
221314

222-
<Image
223-
src="/images/notifier-slack/image-7.png"
224-
alt="Configure Slack in Postgresus"
225-
width={600}
226-
height={400}
227-
className="my-6 rounded-lg border border-gray-200"
315+
<ul>
316+
<li>
317+
<strong>Bot Token:</strong> Paste the Bot User OAuth Token you
318+
copied (starts with <code>xoxb-</code>)
319+
</li>
320+
<li>
321+
<strong>Target Channel ID:</strong> Paste the Channel ID you
322+
copied (starts with <code>C</code>, <code>G</code>,{" "}
323+
<code>D</code>, or <code>U</code>)
324+
</li>
325+
</ul>
326+
327+
<img
328+
src="/images/notifier-slack/image-5.png"
329+
alt="Add Slack notifier"
330+
className="my-6 rounded-lg border border-gray-200 max-w-[700px]"
228331
loading="lazy"
229332
/>
230333

231-
<h3 id="test-notification">2. Test the notification</h3>
334+
<h3 id="test-notification">14. Test the notification</h3>
232335

233336
<p>
234-
After configuring the webhook, test the notification to ensure
235-
it&apos;s working correctly. You should receive a test message
236-
in your selected Slack channel.
337+
After configuring the notifier, test it to ensure it&apos;s
338+
working correctly. You should receive a test message in your
339+
selected Slack channel.
237340
</p>
238341

239342
<p>
36.6 KB
Loading
-48.1 KB
Loading
-6.67 KB
Binary file not shown.
-15.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)