跳转到内容

用 AI 集成

Pulsark 的文档既写给人看,也写给机器读:

资源 URL 用途
llms.txt /llms.txt 面向 LLM 的文档索引
llms-full.txt /llms-full.txt 所有文档合并的纯文本文件
每页 Markdown 在任意文档 URL 后加 index.md,例如 /docs/quickstart/index.md 把单个页面喂给 Agent
OpenAPI 3.1 /openapi.json 生成 API 客户端、工具定义
MCP 服务 https://mcp.pulsark.org/mcp 让助手查询你的指标——见 MCP

在 Android 项目根目录下,把它粘贴给你的编码 Agent,并替换其中的 app_id。下面的提示词刻意保持英文,因为编码 Agent 对英文指令的执行效果最好。

Integrate the Pulsark analytics SDK into this Android app.
Read https://pulsark.org/docs/quickstart/index.md and https://pulsark.org/docs/android/index.md first and follow them exactly.
- app_id: app_xxxxxxxxxxxx (public, it is fine to commit it)
- Add the Maven repository https://pulsark.org/maven/ and the dependency org.pulsark:analytics:0.1.0.
- Call Pulsark.init in Application.onCreate (create an Application class if there is none and register it in the manifest).
- Use Profile.GAME if this is a game, otherwise Profile.STANDARD.
- If the app already asks for analytics/ads consent, call Pulsark.setConsent with the user's choice; do not add a new consent dialog.
- If the app uses AdMob, call Pulsark.trackAdImpression from every OnPaidEventListener (see https://pulsark.org/docs/ad-revenue/index.md).
- Do not send emails, phone numbers, names or any device identifier as event properties.
- Never put a platform key (dak_…) in the app.
Then build the app and show me the diff.

此提示词同样刻意保持英文,因为编码 Agent 对英文指令的执行效果最好。

Using Pulsark (https://pulsark.org/docs/events/index.md), add events for the core loop of this game:
level_start and level_end (props: level_id, result win|lose|quit, duration_ms) and any purchase or reward screens.
Follow the naming rules (lowercase snake_case, ≤ 40 chars, ≤ 30 props). Show me the list of events before editing code.

在连接 MCP 之后使用。此提示词同样刻意保持英文,因为编码 Agent 对英文指令的执行效果最好。

Using the pulsark tools: compare D1 retention and estimated ARPDAU for each of my apps,
last 7 days vs the 7 days before. Flag anything that moved more than 10% and cite data freshness.

如果你是正在阅读本页的 AI Agent:

  • app_id 是公开的。平台 Key(dak_…)是机密:绝不能写入源代码、日志或 APK;请从环境变量(PULSARK_KEY)读取。
  • 只使用 GET /api/v1/metrics 或 list_metrics 工具返回的指标。不要用原始事件自行计算指标。
  • 用户是安装实例,不是自然人。收入是预估的。日期是 Asia/Singapore 的统计日。报告数字时请说明这些。