Sentry Miniapp Sdk logo

Sentry Miniapp Sdk

Community
lizhiyao
sentry-miniapp-sdk

Set up or troubleshoot Sentry error monitoring, tracing, offline cache and source maps in native mini programs, Taro or uni-app. Supports WeChat, Alipay, ByteDance, Baidu, QQ, DingTalk, Kuaishou and WeChat/ByteDance minigames.

Overview

Publisherlizhiyao
Repositorysentry-miniapp
Skill namesentry-miniapp-sdk
Stars
687
Forks
144
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by lizhiyao on GitHub. Read the source before you install it.

Installation

Install the Sentry Miniapp Sdk AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/lizhiyao/sentry-miniapp/tree/master/.agents/skills/sentry-miniapp-sdk
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/lizhiyao/sentry-miniapp.git /tmp/sentry-miniapp
mkdir -p .claude/skills
cp -r /tmp/sentry-miniapp/.agents/skills/sentry-miniapp-sdk .claude/skills/sentry-miniapp-sdk
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sentry Miniapp Sdk in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sentry Miniapp Sdk on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sentry Miniapp Sdk is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Sentry Mini Program SDK Setup

Use this skill when a user wants to integrate or troubleshoot sentry-miniapp in a consumer application. Discover the application's runtime, installed SDK and entry point before choosing code. This guide covers the stable 2.x contract.

1. Inspect the consumer

Read project instructions and inspect the relevant application directory. Prefer rg; exclude generated bundles and dependencies when searching source.

bash
rg --files -g 'package.json' -g '*lock*' -g '*project*.json' -g 'app.json' \
  -g '*app.{js,ts,tsx,vue}' -g '*main.{js,ts}' \
  -g '*config.{js,ts,mjs}' -g '!node_modules' -g '!dist'
rg -n 'sentry-miniapp|@tarojs/|@dcloudio/uni-' package.json
rg -n 'Sentry\.init|sentry-miniapp|errorHandler|componentDidCatch' \
  src app.js app.ts -g '!node_modules' -g '!dist'

Adjust search roots to files that exist; these commands illustrate discovery, not a required directory layout.

Determine:

  • Installed version and package manager. Read the lockfile and installed package metadata; a manifest range alone may not identify the resolved version.
  • Release targets. Read framework configuration and platform globals. WeChat's project.config.json, Alipay's mini.project.json, ByteDance's project.tt.json and Baidu's project.swan.json are useful clues. Confirm QQ, DingTalk and Kuaishou from actual target configuration.
  • Framework and entry. Native apps commonly use app.js/app.ts; Taro uses src/app.tsx or its configured entry; Vue 3 uni-app usually initializes from src/main.js/main.ts.
  • Existing monitoring and privacy policy. Preserve working error handlers, integrations, sampling and consent requirements.
  • Sentry deployment and build pipeline. Version support and final JS/map matching affect which features can be verified.

2. Choose the SDK version and features

An unqualified install selects the current stable release; sentry-miniapp@2 selects the stable 2.x line. Use @next only when the user explicitly chooses a prerelease. Do not silently migrate an existing 1.x application. Use the version and migration guide, including its fixed 1.x documentation archive.

2.0 uses Core v11 and stream spans. Check the target Sentry deployment against the guide's support baseline; successful error ingestion alone does not prove support for spans, Logs, Metrics or Sessions.

Implement the requested coverage. Resolve routine setup choices from the project and user intent; ask only for missing information that affects the result.

CoverageWhen to add itReference
Error monitoring and framework handlersBasic integration or missing errorserror-monitoring.md
HTTP and business tracingLatency measurement or backend trace correlationtracing.md
Offline cache and consentWeak networks or a stated privacy requirementoffline-cache.md
Source Map uploadReadable stacks from deployed buildssourcemap.md

Load only the references needed for the work. Automatic capture depends on available host APIs; optional Performance observers and FPS are not universal platform capabilities.

3. Install and initialize

Use the consumer's existing package manager. For a chosen 2.x release, pin the resolved version and retain the lockfile:

bash
npm install --save-exact sentry-miniapp@2
# Or, in a Yarn project:
yarn add --exact sentry-miniapp@2

For native WeChat projects, run Tools → Build npm in the developer tools after installation or updates. Check the package.json/miniprogramRoot layout against the native installation guide; framework projects use their own build pipeline.

Copy the complete DSN from the target Sentry project; do not construct its hostname. Configure the exact envelope request host as a legal request domain, or configure the chosen tunnel's host. Verify with device debugging and domain-check bypass disabled.

Initialize once, as early as practical, before native App() registration and business requests. In framework projects, put initialization in a dedicated module imported before the application module. Do not put init() inside a temporary scope or an unfinished async span.

js
// Native app.js
const Sentry = require('sentry-miniapp');

Sentry.init({
  dsn: 'YOUR_DSN', // Copy the complete project DSN.
  release: 'my-miniapp@1.0.0',
  environment: 'production',
});

App({
  // Existing application configuration.
});

For Taro and uni-app, follow their actual entry and preserve existing framework error handling:

H5 needs the official browser/framework SDK through target-specific imports. sentry-miniapp does not provide browser DOM or fetch/XHR instrumentation.

Platform labels and minigames

Runtime APIs come from the detected host. Set miniappPlatform only to correct an ambiguous event label; it does not switch the host API. Values are wechat, alipay, bytedance, qq, swan, dingtalk and kuaishou. The event's top-level platform stays javascript.

WeChat/ByteDance minigames have no App/Page model. Automatic Session tracking requires both native show/hide listeners to register successfully; missing capabilities produce diagnostics. First frame measures SDK installation to the first rAF, not full cold start. FPS/jank defaults off; opt in with enableMinigameFrameRate: true only when needed. See the minigame guide.

Configuration decisions

Use the configuration reference for the complete option list. Apply these boundaries when choosing settings:

  • Errors use sampleRate; traces use tracesSampleRate or tracesSampler and are off until configured.
  • Network body collection and console breadcrumbs default off. Do not copy demo full sampling, body capture or per-click fingerprints into production.
  • tracePropagationTargets defaults to an empty list. Add anchored URL allowlists only for backends the application controls.
  • dataCollection governs automatic fields. userInfo: false stops automatic error IP inference, but does not erase explicit setUser fields or arbitrary business logs.
  • Use beforeSend, beforeSendLog and beforeSendMetric for their respective data. beforeSendSpan edits streamed spans; ignoreSpans filters them.
  • requireConsent gates sending, not collection. See the offline/consent reference before changing that policy.
  • Integration factories create per-client instances. Keep default SpanStreaming when enabling tracing; replacing the full default set requires installing it explicitly.

4. Verify the result

Run the consumer's relevant checks and build the actual target. Verify progressively:

  1. Capture a new known error and record its event ID, release and runtime diagnostics.
  2. Check request errors and HTTP responses, then find the same event in the intended Sentry project/environment.
  3. For framework errors, test the framework handler as well as direct capture.
  4. For Source Maps, check the final runtime filename and event coordinates against the same build's JS/map.
  5. For enabled tracing, Logs, Metrics, Sessions or consent, check each feature's own payload and backend result.
  6. When device behavior is in scope, verify foreground/background, network restoration and domain checks on the actual target.

An event ID means capture was attempted. flush() returning true is not a backend receipt or proof of symbolication. Local tests do not establish survival across host freezing or process termination.

Report which version, build, runtime and backend were actually verified. Keep untested capabilities explicit, and include concise remaining steps only when they require user access or a real-device action.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Sentry Miniapp Sdk AI skill do?

Set up or troubleshoot Sentry error monitoring, tracing, offline cache and source maps in native mini programs, Taro or uni-app. Supports WeChat, Alipay, ByteDance, Baidu, QQ, DingTalk, Kuaishou and WeChat/ByteDance minigames.

Why use Sentry Miniapp Sdk on TypingMind?

Because you install it once and use it with any model. Sentry Miniapp Sdk is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sentry Miniapp Sdk in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/lizhiyao/sentry-miniapp/tree/master/.agents/skills/sentry-miniapp-sdk. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Sentry Miniapp Sdk?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sentry Miniapp Sdk?

As many as you like. As long as a model supports skills, you can use Sentry Miniapp Sdk with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sentry Miniapp Sdk AI skill free?

Yes. It is published on GitHub by lizhiyao under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇