Skip to content

Commit e9a3796

Browse files
committed
docs: add feed documents
1 parent b5a59ee commit e9a3796

4 files changed

Lines changed: 167 additions & 0 deletions

File tree

website/docs/feed/channels.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Channels
6+
7+
Channels are containers of events. You can create multiple channels for different products/teams/environments.
8+
9+
## Create a channel
10+
11+
Console → Feed → Add Channel.
12+
13+
Fields
14+
15+
- name: Display name
16+
- notifyFrequency: Control how often notifications are sent for this channel
17+
- notificationIds: Select existing notification targets to receive fan-out
18+
19+
## Edit a channel
20+
21+
You can update name, notificationIds, notifyFrequency, and set an optional webhookSignature. Once a signature is set, any public webhook to this channel must include header `x-webhook-signature` with the same value.
22+
23+
## API
24+
25+
- List channels: GET `/open/workspace/{workspaceId}/feed/channels`
26+
- Channel info: GET `/open/workspace/{workspaceId}/feed/{channelId}/info`
27+
- Update: POST `/open/workspace/{workspaceId}/feed/{channelId}/update`
28+
- Create: POST `/open/workspace/{workspaceId}/feed/createChannel`
29+
- Delete: DELETE `/open/workspace/{workspaceId}/feed/{channelId}/del`
30+
31+
Example (update notification targets)
32+
33+
```bash
34+
curl -X POST \
35+
"$BASE_URL/workspace/$WORKSPACE_ID/feed/$CHANNEL_ID/update" \
36+
-H "Authorization: Bearer $TOKEN" \
37+
-H "Content-Type: application/json" \
38+
-d '{
39+
"name": "Ops",
40+
"notifyFrequency": 60,
41+
"notificationIds": ["notif_123", "notif_456"]
42+
}'
43+
```

website/docs/feed/integrations.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
5+
# Integrations
6+
7+
Tianji provides built-in webhook adapters to convert third-party payloads into Feed events.
8+
9+
## GitHub
10+
11+
Endpoint
12+
13+
POST `/open/feed/{channelId}/github`
14+
15+
Notes
16+
17+
- Use "application/json" content type.
18+
- Header `X-GitHub-Event` is required by GitHub and consumed by the adapter.
19+
- Supported types: `push`, `star`, `issues` (opened/closed). Others will be logged as unknown.
20+
21+
## Stripe
22+
23+
Endpoint
24+
25+
POST `/open/feed/{channelId}/stripe`
26+
27+
Notes
28+
29+
- Configure a Stripe webhook endpoint pointing to the URL above.
30+
- Supported types: `payment_intent.succeeded`, `payment_intent.canceled`, `customer.subscription.created`, `customer.subscription.deleted`.
31+
32+
## Sentry
33+
34+
Endpoint
35+
36+
POST `/open/feed/{channelId}/sentry`
37+
38+
Notes
39+
40+
- Header `Sentry-Hook-Resource: event_alert` and action `triggered` are mapped to Feed events.
41+
- See step-by-step screenshots in "Integration with Sentry".
42+
43+
## Tencent Cloud Alarm
44+
45+
Endpoint
46+
47+
POST `/open/feed/{channelId}/tencent-cloud/alarm`
48+
49+
Notes
50+
51+
- Supports alarm types `event` and `metric`. Payload is validated; invalid requests are rejected.
52+
53+
## Webhook Playground
54+
55+
Endpoint
56+
57+
POST `/open/feed/playground/{workspaceId}`
58+
59+
Notes
60+
61+
- Echo headers/body/method/url to the workspace real-time playground for debugging integrations.

website/docs/feed/intro.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
sidebar_position: 0
3+
---
4+
5+
# Feed overview
6+
7+
Feed is a lightweight event stream for your workspace. It helps teams aggregate important events from different systems into channels, collaborate around incidents, and keep stakeholders informed.
8+
9+
## Concepts
10+
11+
- Channel: A logical stream to collect and organize events. Each channel can be connected to one or more notification targets and can optionally require a webhook signature.
12+
- Event: A single record with name, content, tags, source, sender identity, importance and optional payload. Events can be archived/unarchived.
13+
- State: A special kind of ongoing event that can be upserted (created or updated) repeatedly by a stable eventId, and resolved when finished.
14+
- Integration: Built-in webhook adapters that convert 3rd-party payloads (e.g. GitHub, Stripe, Sentry, Tencent Cloud Alarm) into Feed events.
15+
- Notification: Channels can fan-out events to configured notifiers; delivery frequency can be tuned by channel settings.
16+
17+
## Typical use cases
18+
19+
- Product and infra incident stream across multiple services
20+
- CI/CD deployment and release notices
21+
- Billing and subscription signals
22+
- Security, monitoring and error alerts

website/docs/feed/state.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
# State (ongoing incidents)
6+
7+
Feed State models ongoing incidents with an immutable `eventId`. You can repeatedly upsert updates to the same `eventId` until it is resolved.
8+
9+
## Endpoints
10+
11+
- Upsert state (public): `POST /open/feed/{channelId}/state/upsert`
12+
- Resolve state (auth): `POST /open/workspace/{workspaceId}/feed/{channelId}/state/resolve`
13+
- List ongoing states (auth): `GET /open/workspace/{workspaceId}/feed/state/all?channelId=...&limit=...`
14+
15+
## Upsert body
16+
17+
```json
18+
{
19+
"eventId": "deploy#2025-08-12",
20+
"eventName": "deploy_progress",
21+
"eventContent": "Rollout 60%",
22+
"tags": ["prod"],
23+
"source": "ci",
24+
"senderId": "runner-42",
25+
"senderName": "GitHub Actions",
26+
"important": true,
27+
"payload": {"stage": "canary"}
28+
}
29+
```
30+
31+
If the channel is configured with `webhookSignature`, you must include header `x-webhook-signature`.
32+
33+
## Resolve example
34+
35+
```bash
36+
curl -X POST \
37+
"$BASE_URL/workspace/$WORKSPACE_ID/feed/$CHANNEL_ID/state/resolve" \
38+
-H "Authorization: Bearer $TOKEN" \
39+
-H "Content-Type: application/json" \
40+
-d '{"stateId": "STATE_ID"}'
41+
```

0 commit comments

Comments
 (0)