モニタリング
独自のボタンを使う
インストール feedbackWidget: false + Blipit.openReport()
ブラウザ SDK はすべてのページの隅に「不具合を報告」ボタンを表示します。アプリにヘルプメニューやヘッダーのボタンがすでにある場合は、フローティングボタンをオフにして、そこから同じレポーターを開けます。スクリーンショット、注釈、要素ピッカー、録画、コンテキストはすべて同じように動作します。
2任意の要素からレポーターを開く
attachReport(element) は要素がクリックされたときにレポーターを開きます。openReport() は、メニュー項目やキーボードショートカットなど独自のコードから開きます。
<button id="report-bug">Report a bug</button>
<script>
Blipit.attachReport(document.getElementById("report-bug"));
</script>menu.on("report", () => Blipit.openReport());3React と Next.js
@blipit/nextjs と @blipit/browser は openReport と attachReport をエクスポートします。Blipit コンポーネントに feedbackWidget={false} を渡し、任意のクライアントコンポーネントから openReport() を呼び出します。
"use client";
import { Blipit, openReport } from "@blipit/nextjs";
export function Monitoring() {
return <Blipit publicKey={process.env.NEXT_PUBLIC_BLIPIT_KEY!} feedbackWidget={false} />;
}
export function ReportBug() {
return <button onClick={() => openReport()}>Report a bug</button>;
}知っておくと便利
- レポーター本体(blipit-report.js)は初回に開いたとき blipit.js と同じフォルダから読み込まれます。サイトに Content Security Policy がある場合は script-src に https://blipit.io を追加してください。
- ダッシュボードでボタンを非表示にすると、そのキーを使うすべてのサイトで非表示になります。その場合も openReport() と attachReport() は動作します。
お困りですか?support@blipit.io までメールしてください。各プロジェクトのキーと正確な DSN は app.blipit.io の「APIキー」にあります。
