Skip to content

Commit f5c8693

Browse files
durw4rdcursoragent
authored andcommitted
Add Mattermost incoming webhooks integration
Receive flag change notifications in Mattermost channels via Mattermost's incoming webhook feature. Uses the auditLogEventsHook capability with three templates (default, project, environment) targeting Mattermost's Slack-compatible attachment payload schema. All 2,387 tests in npm test pass, including JSON-validity checks across the project/environment/flag sample contexts. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 4fd6ea1 commit f5c8693

8 files changed

Lines changed: 128 additions & 0 deletions

File tree

integrations/mattermost/LICENSE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2026 Catamorphic Co.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

integrations/mattermost/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Mattermost
2+
3+
User documentation for this integration is available on the LaunchDarkly documentation site: [Mattermost](https://launchdarkly.com/docs/integrations/mattermost)
4+
5+
API documentation for this integration is available on Mattermost's documentation site: [Incoming webhooks for Mattermost](https://docs.mattermost.com/developer/webhooks-incoming.html)
6+
7+
## Getting started with the Mattermost integration
8+
9+
Run `npm run curl mattermost` in the root repository directory to generate a `curl` command to send data to Mattermost.
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"name": "Mattermost incoming webhooks",
3+
"version": "1.0.0",
4+
"overview": "Receive flag change notifications in your Mattermost channels.",
5+
"description": "Receive LaunchDarkly notifications in your Mattermost channels. Subscribe to changes in flags, projects, environments, and other resources via Mattermost's incoming webhook integration.",
6+
"author": "LaunchDarkly",
7+
"supportEmail": "support@launchdarkly.com",
8+
"links": {
9+
"site": "https://mattermost.com",
10+
"launchdarklyDocs": "https://launchdarkly.com/docs/integrations/mattermost",
11+
"privacyPolicy": "https://mattermost.com/privacy-policy/"
12+
},
13+
"categories": ["messaging"],
14+
"icons": {
15+
"square": "assets/images/square.svg",
16+
"horizontal": "assets/images/horizontal.svg"
17+
},
18+
"formVariables": [
19+
{
20+
"key": "url",
21+
"name": "Incoming webhook URL",
22+
"type": "uri",
23+
"description": "Enter your Mattermost [incoming webhook URL](https://docs.mattermost.com/developer/webhooks-incoming.html).",
24+
"isSecret": false
25+
}
26+
],
27+
"capabilities": {
28+
"auditLogEventsHook": {
29+
"endpoint": {
30+
"url": "{{{url}}}",
31+
"method": "POST",
32+
"headers": [
33+
{
34+
"name": "Content-Type",
35+
"value": "application/json"
36+
}
37+
]
38+
},
39+
"templates": {
40+
"project": "templates/project.json.hbs",
41+
"environment": "templates/environment.json.hbs",
42+
"default": "templates/default.json.hbs",
43+
"validation": "templates/default.json.hbs"
44+
},
45+
"defaultPolicy": [
46+
{
47+
"effect": "allow",
48+
"resources": ["proj/*:env/production:flag/*"],
49+
"actions": ["*"]
50+
}
51+
]
52+
}
53+
}
54+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"username": "LaunchDarkly",
3+
"attachments": [
4+
{
5+
"fallback": "{{{title.plainText}}}",
6+
"color": "#405BFF",
7+
"title": "{{{name}}}",
8+
"title_link": "{{{_links.site.href}}}",
9+
"text": "{{{title.markdown}}}{{#if details.markdown}}\n\n{{{details.markdown}}}{{/if}}{{#if comment}}\n\n**Comment:** {{{comment}}}{{/if}}",
10+
"fields": [
11+
{{#if project.name}}{ "title": "Project", "value": "{{{project.name}}}", "short": true },
12+
{{/if}}{{#if project.environment.name}}{ "title": "Environment", "value": "{{{project.environment.name}}}", "short": true },
13+
{{/if}}{ "title": "Action", "value": "{{{verbKind}}}", "short": true }
14+
],
15+
"footer": "LaunchDarkly",
16+
"ts": {{timestamp.seconds}}
17+
}
18+
]
19+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"username": "LaunchDarkly",
3+
"attachments": [
4+
{
5+
"fallback": "{{{title.plainText}}}",
6+
"color": "#405BFF",
7+
"title": "{{{name}}}",
8+
"title_link": "{{{_links.site.href}}}",
9+
"text": "{{{title.markdown}}}{{#if details.markdown}}\n\n{{{details.markdown}}}{{/if}}{{#if comment}}\n\n**Comment:** {{{comment}}}{{/if}}",
10+
"fields": [
11+
{ "title": "Project", "value": "{{{project.name}}}", "short": true }
12+
],
13+
"footer": "LaunchDarkly",
14+
"ts": {{timestamp.seconds}}
15+
}
16+
]
17+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"username": "LaunchDarkly",
3+
"attachments": [
4+
{
5+
"fallback": "{{{title.plainText}}}",
6+
"color": "#405BFF",
7+
"title": "{{{name}}}",
8+
"title_link": "{{{_links.site.href}}}",
9+
"text": "{{{title.markdown}}}{{#if details.markdown}}\n\n{{{details.markdown}}}{{/if}}{{#if comment}}\n\n**Comment:** {{{comment}}}{{/if}}",
10+
"footer": "LaunchDarkly",
11+
"ts": {{timestamp.seconds}}
12+
}
13+
]
14+
}

0 commit comments

Comments
 (0)