Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5e37542
fix: add AutoTransition to loading/idle state transitions on manageme…
RavelloH Jun 27, 2026
f099c6a
fix: generalize cross-breakdown dimensions and align OpenAPI spec
RavelloH Jun 27, 2026
2a0fa31
fix: add missing timeParams to funnels/analysis OpenAPI spec
RavelloH Jun 27, 2026
9551b78
fix: align OpenAPI contract metadata
RavelloH Jun 27, 2026
c98d585
chore: add explicit prettier defaults and read API version from packa…
RavelloH Jun 27, 2026
a48bf7f
test: fix the test timeout issue
RavelloH Jun 27, 2026
9f30af0
chore: add changelog for v0.2.0 release with API enhancements and dev…
RavelloH Jun 27, 2026
1aa8f6c
chore(release): sync package version to v0.2.0 [skip ci]
github-actions[bot] Jun 27, 2026
4297941
docs: add AI Agents integration section to README
RavelloH Jun 27, 2026
ef4fb94
fix: sync release api discovery artifacts
RavelloH Jun 27, 2026
d38e6cd
Implement API v1 analytics endpoints
RavelloH Jun 27, 2026
5dbf87f
fix: relax CSP connect-src and expand eslint allowDefaultProject
RavelloH Jun 27, 2026
30b7830
fix: preserve current analytics tab when clicking site in sidebar
RavelloH Jun 27, 2026
10c9975
chore: new icon with more beautiful views
RavelloH Jun 27, 2026
c623e27
fix: derive current analytics section from pathname directly for side…
RavelloH Jun 27, 2026
819b21d
fix: allow day/week intervals at range boundaries (90d, 7d, 12m)
RavelloH Jun 27, 2026
0a9d5f0
fix: apply current analytics section to all sidebar site links, not j…
RavelloH Jun 27, 2026
6e83ad8
perf: aggregate geo points by rounded coordinates to reduce payload size
RavelloH Jun 27, 2026
a1133aa
feat: add 2-column medium breakpoint for overview metric cards grid
RavelloH Jun 27, 2026
f003c30
fix: use project Spinner component in map loading fallback
RavelloH Jun 27, 2026
14e2559
feat: public link system
RavelloH Jun 27, 2026
57972cb
fix: fixed the issue where points could not be obtained when querying…
RavelloH Jun 27, 2026
ab68945
feat: new public tabs support
RavelloH Jun 27, 2026
146e2ab
deps: removed unused dependents
RavelloH Jun 27, 2026
1f7c57a
opti: optimize the script system
RavelloH Jun 27, 2026
b5f759c
perf: cache public api responses
RavelloH Jun 28, 2026
ec5305d
fix: pre-release public sharing and api contracts
RavelloH Jun 28, 2026
9371a4f
refactor(api): add hono app shell and edge adapters
RavelloH Jun 28, 2026
e428022
refactor(api): share hono route inventory
RavelloH Jun 28, 2026
70b09f0
test(api): cover hono edge adapters
RavelloH Jun 28, 2026
23d630b
test(api): add Hono route parity baseline
RavelloH Jun 28, 2026
b98fb73
refactor(api): add Hono middleware foundation
RavelloH Jun 28, 2026
fb4ec7e
refactor(api): route private dashboard API through Hono
RavelloH Jun 28, 2026
609d2b8
refactor(api): route public share API through Hono
RavelloH Jun 28, 2026
e69686d
refactor(api): route private admin API through Hono
RavelloH Jun 28, 2026
6108866
refactor(api): route archive APIs through Hono
RavelloH Jun 28, 2026
5c232ee
refactor(api): route API v1 resources through Hono
RavelloH Jun 28, 2026
b739f91
chore(api): align Next API fallbacks with Hono
RavelloH Jun 28, 2026
06816a1
chore(api): mark legacy routers as compatibility wrappers
RavelloH Jun 28, 2026
2d4ce96
chore(deps): bump softprops/action-gh-release from 2 to 3
dependabot[bot] Jun 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/readme/README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,21 @@ After filling in the variables, wait about 3 minutes for the deployment to finis

## Advanced Configuration

### Connect AI Agents for Analysis

InsightFlare exposes Skills for AI Agents. You can connect your InsightFlare deployment to agents such as OpenClaw, Codex, Claude Code, and others, so they can access InsightFlare data directly for analysis and report generation.
Send the following instruction to your Agent, replacing the domain with your deployed InsightFlare instance. Your Agent will guide you to the dashboard to create a dedicated API key for accessing InsightFlare data.

```txt
Read https://<your InsightFlare domain>/.well-known/skills.json, connect to this web analytics system, and guide me through authorization.
```

Then you can ask your Agent questions in natural language, for example:

```txt
"How did my site perform last month? Where did most visitors come from among the highest-traffic sites? Which pages were the most popular?"
```

### Override Wrangler Configuration with Cloudflare Variables

In Cloudflare build environments, you can use project variables and secrets to override deployment-specific values from `wrangler.toml`. `build:pre` reads these values before deployment, writes them into the active Wrangler config, and the following `wrangler deploy` uses the resolved config.
Expand Down Expand Up @@ -295,7 +310,7 @@ Set `NEXT_PUBLIC_DEMO_MODE=1` to make the development server automatically enabl
| Command | Purpose |
| --------------------------------- | ------------------------------------------- |
| `npm run dev` | Local dashboard development |
| `npm run check` | Run typecheck + lint + format + i18n checks |
| `npm run check` | Run typecheck + lint + format + i18n + tests + spec checks |
| `npm run typecheck` | TypeScript type checking |
| `npm run lint` / `lint:fix` | ESLint |
| `npm run format` / `format:check` | Prettier |
Expand Down
17 changes: 16 additions & 1 deletion .github/readme/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,21 @@ Cloudflare 会自动 Clone 这个仓库、创建并绑定所需要的资源。

## 进阶配置

### 接入 AI Agents 进行分析

我们开放了用于 AI Agents 的 Skills,您可以选择将 InsightFlare 接入您的 Agents,例如 OpenClaw、Codex、Claude Code 等, 让 Agents 能够直接访问 InsightFlare 的数据,进行分析和报告生成。
请直接发送下面的指令给您的 Agent,您需要域名换成您部署的 InsightFlare 实例。您的 Agents 会指引您前往仪表盘为其创建一个专用 API 密钥,便于其访问 InsightFlare 的数据。

```txt
阅读 https://<您的 InsightFlare 域名>/.well-known/skills.json,接入这个访问分析系统,并指引我进行授权。
```

随后,您可以以任意自然语言向 Agent 提问,例如:

```txt
“上个月,我的站点的访问情况如何?访问量最高的站点中,访客大都是来自哪里的?哪些页面最受欢迎?”
```

### 使用 Cloudflare 变量覆盖 Wrangler 配置

在 Cloudflare 的构建环境中,可以通过「变量和密钥」覆盖 `wrangler.toml` 中需要因部署而变化的配置。`build:pre` 会在部署前读取这些变量并写入当前 Wrangler 配置,随后 `wrangler deploy` 会使用覆盖后的配置。
Expand Down Expand Up @@ -295,7 +310,7 @@ InsightFlare 的前端 SDK 支持以手动调用的方式上报自定义事件
| 命令 | 用途 |
| --------------------------------- | ---------------------------------------------- |
| `npm run dev` | 本地开发仪表板 |
| `npm run check` | 一键执行 typecheck + lint + format + i18n 校验 |
| `npm run check` | 一键执行 typecheck + lint + format + i18n + test + spec 校验 |
| `npm run typecheck` | TypeScript 类型检查 |
| `npm run lint` / `lint:fix` | ESLint |
| `npm run format` / `format:check` | Prettier |
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,18 @@ jobs:
echo "file_path=$NEW_FILE" >> "$GITHUB_OUTPUT"
echo "Detected release changelog: $NEW_FILE"

- name: Sync package versions
- name: Setup Node.js
if: steps.changelog.outputs.has_release == 'true'
uses: actions/setup-node@v6
with:
node-version: 24
cache: npm

- name: Install dependencies
if: steps.changelog.outputs.has_release == 'true'
run: npm ci

- name: Sync release artifacts
if: steps.changelog.outputs.has_release == 'true'
shell: bash
run: |
Expand Down Expand Up @@ -83,16 +94,20 @@ jobs:
updatePackageLock("package-lock.json");
NODE

git add package.json package-lock.json
npm run generate:openapi
npm run generate:skills
npx tsx scripts/check-openapi-contract.ts

git add package.json package-lock.json docs/openapi.json docs/openapi.yaml docs/skills.json

if git diff --cached --quiet; then
echo "Package versions are already up to date."
echo "Release artifacts are already up to date."
exit 0
fi

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "chore(release): sync package version to ${{ steps.changelog.outputs.version }} [skip ci]"
git commit -m "chore(release): sync release artifacts to ${{ steps.changelog.outputs.version }} [skip ci]"
git push origin HEAD:${{ github.ref_name }}

- name: Finalize release commit
Expand All @@ -114,7 +129,7 @@ jobs:

- name: Create release
if: steps.changelog.outputs.has_release == 'true'
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ steps.changelog.outputs.version }}
name: Release ${{ steps.changelog.outputs.version }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ src/tracker/sdk.min.ts
src/tracker/sdk.no-perf.min.ts
coverage
logs/

plan/
35 changes: 35 additions & 0 deletions changelog/v0.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
InsightFlare v0.2.0 expands the product from a dashboard-first analytics app into a more integration-ready analytics service with a documented API surface, API key authentication, and stronger request validation.

This release focuses on making InsightFlare easier to connect with external tools and safer to expose programmatically. It introduces API key management, a versioned API contract, OpenAPI and agent discovery endpoints, and a more consistent API response model.

## Highlights

- Added API key management, including scoped keys, API key authentication, and dashboard controls for creating and managing access.
- Introduced the versioned `/api/v1` API surface with generated OpenAPI 3.1 documentation and request/response examples.
- Added `.well-known` discovery endpoints for OpenAPI, agent skills, health, security, and account password-change metadata.
- Added generated `skills.json` documentation so LLM and agent clients can understand the public API more easily.
- Added stronger request validation through shared Zod schemas for analytics, realtime, site, team, funnel, tracker, and common API inputs.
- Improved API response consistency with request IDs, timestamps, and a unified response envelope.
- Added same-origin request validation and strengthened secret/session handling for safer deployments.
- Added dashboard surfaces for API key management and clearer version update details.
- Improved geography and realtime dashboard rendering by moving heavier map and realtime views into dedicated client-side stages.

## Changes Since v0.1.0

- Fixed API version reporting so it is read from `package.json` instead of being hardcoded.
- Fixed `/api/v1` root route matching with an optional catch-all route.
- Aligned generated OpenAPI metadata, schemas, examples, and endpoint behavior with the actual implementation.
- Fixed mobile page scrolling behavior.
- Fixed rollback secret handling so fallback values are applied correctly.
- Replaced hardcoded locale checks with the i18n system.
- Renamed the funnel route to `funnels` for consistency.
- Removed unnecessary release-summary height restrictions.
- Reduced worker bundle pressure by moving heavier dashboard experiences behind client-only islands.

## Developer Experience

- Added scripts for generating OpenAPI and skills documentation.
- Added an OpenAPI contract checker to catch documentation drift.
- Added CI coverage thresholds and broadened test coverage across API v1, API keys, scheduled tasks, hourly rollups, realtime mocks, schemas, validation, and dashboard client data.
- Added explicit Prettier defaults and stricter ESLint coverage for the codebase.
- Added environment and prebuild checks for safer Cloudflare deployment flows.
Loading