Files
crm-embed-test/README.md

18 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# crm-embed-test
Тестовая страница встраивания в CRM Tvorymo: получает авторизацию CRM через `postMessage`
(`crm:ready` → `crm:auth`, `crm:refresh`), проверяет `access_token` на сервере через
Supabase `GET /auth/v1/user` (+ `exp`, `aud = authenticated`) и показывает имя/email/id.
- Node 22, без зависимостей: `server.js` + `public/index.html`.
- Разрешённые origin CRM — env `CRM_ORIGINS` (через запятую; по умолчанию
`https://shotam.tvorymo.com,https://units.tvorymo.com`). Используются в
`Content-Security-Policy: frame-ancestors …` (без `X-Frame-Options`) и как allowlist для `postMessage`:
сообщения от других origin игнорируются (пишется в журнал).
- Стили CRM берутся с `https://shotam.tvorymo.com/css/tvorymo-ui.css` и `/css/crm.css` (от корня;
старые пути `/tvorymo-crm/css/...` дают 404).
- Env: `SUPABASE_URL`, `SUPABASE_PUBLISHABLE_KEY`, `CRM_ORIGINS`, `PORT` (по умолчанию 3000).
- Деплой: Coolify (Dockerfile), домен `https://test-crm.tes.gd`.
Подробности — `SPEC.md`.