@inso_web/els-react 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ # @inso_web/els-react — Examples
2
+
3
+ - **[vite-react](./vite-react/)** — Vite + React 18 + TypeScript starter с `ELSProvider`, `useErrorReporter` и `ELSErrorBoundary`.
@@ -0,0 +1,22 @@
1
+ # vite-react
2
+
3
+ Vite + React 18 + TypeScript starter для `@inso_web/els-react`.
4
+
5
+ ## Запуск
6
+
7
+ ```bash
8
+ npm install
9
+ VITE_ELS_API_KEY=els_live_xxxxxxxx npm run dev
10
+ ```
11
+
12
+ Затем открой `http://localhost:5173/`.
13
+
14
+ Environment:
15
+ - `VITE_ELS_API_KEY` — API ключ ELS
16
+ - `VITE_ELS_URL` — URL ELS API (default: `https://api.insoweb.ru/els`)
17
+
18
+ ## Что демонстрирует
19
+
20
+ - `ELSProvider` в корне приложения с авто-перехватом `window.onerror` и `unhandledrejection`
21
+ - `useErrorReporter()` хук для ручной отправки ошибок
22
+ - `ELSErrorBoundary` — React error boundary, автоматически логирующий ошибки рендера в ELS
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="ru">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>@inso_web/els-react — Vite example</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ <script type="module" src="/src/main.tsx"></script>
11
+ </body>
12
+ </html>