You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/developers/chats.mdx
+88-8Lines changed: 88 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,6 @@ Other Hive apps can call Ecency's `/api/mattermost/*` routes directly - **no Mat
22
22
-**Cookies required**: The routes rely on an httpOnly `mm_pat` cookie. When calling from a browser, use `credentials: "include"` so the cookie is stored for subsequent requests.
23
23
-**Hive access tokens only**: Your app never needs Mattermost credentials. Provide the user's Hive `accessToken`/`refreshToken` and username to bootstrap; the Ecency backend handles PAT creation and all proxying.
24
24
25
-
If you self-host Ecency, set these variables in your `.env` (see `apps/web/.env.template`):
26
-
27
-
-`MATTERMOST_BASE_URL`: Mattermost server REST base (e.g., `https://mattermost.example.com/api/v4`).
28
-
-`MATTERMOST_ADMIN_TOKEN`: Admin personal access token used to provision users, teams, and channels.
29
-
-`MATTERMOST_TEAM_ID`: Team id where chat channels live.
30
-
31
-
These are required only when running the Ecency API yourself; consumers of `ecency.com/api/mattermost` do not need them.
32
-
33
25
## Quickstart for Hive app integrators
34
26
35
27
1.**Collect Hive tokens**: Obtain the user's Ecency/Hive `accessToken` or `refreshToken` (JWT) plus the Hive `username` after login in your app.
@@ -121,3 +113,91 @@ All routes live under `/api/mattermost` and expect the `mm_pat` cookie set by th
121
113
122
114
- PAT cookies are httpOnly, `sameSite=lax`, and secured in production. Avoid exposing admin tokens client-side; all Mattermost admin operations stay server-side.
123
115
- Hive JWT validation ensures only the authenticated Hive account can bootstrap and obtain a chat PAT tied to their username.
116
+
117
+
## Self-host / Ecency instances
118
+
119
+
If you self-host Ecency, set these variables in your `.env` (see `apps/web/.env.template`):
120
+
121
+
-`MATTERMOST_BASE_URL`: Mattermost server REST base (e.g., `https://mattermost.example.com/api/v4`).
122
+
-`MATTERMOST_ADMIN_TOKEN`: Admin personal access token used to provision users, teams, and channels.
123
+
-`MATTERMOST_TEAM_ID`: Team id where chat channels live.
124
+
125
+
If you're self-hosting the Mattermost **Team Edition (community edition)** for development, you can start with a simple `docker-compose.yml` like:
Update `MM_SERVICESETTINGS_SITEURL`, SMTP values, and Traefik host/ACME email to match your environment. The exposed `8065` port allows direct Mattermost access; you can remove it if you only want Traefik handling ingress.
202
+
203
+
THESE ARE REQUIRED ONLY when running the Ecency API/instance yourself; consumers of `ecency.com/api/mattermost` or **Hive app integrators** DO NOT NEED them.
0 commit comments