۱. بسته‌ها را نصب کن

SDK مرورگر و اتصال Vue را با هم نصب کن.

npm install @ashkarhq/browser @ashkarhq/vue

۲. آشکار را به Vue وصل کن

قبل از mount شدن اپ، client را بساز و اتصال Vue را فعال کن.

import { createApp } from "vue";
import { init } from "@ashkarhq/browser";
import { installVue } from "@ashkarhq/vue";
import App from "./App.vue";

const app = createApp(App);
export const ashkar = init({
  dsn: "https://app.ashkarhq.ir/api/v1/events",
  projectKey: "YOUR_PUBLIC_KEY",
  environment: "production",
  release: "web@1.0.0",
});

installVue(app, ashkar);
app.mount("#app");

۳. یک خطای آزمایشی بفرست

این خطا را یک‌بار بفرست تا مطمئن شوی پروژه درست وصل شده است.

await ashkar.captureException(
  new Error("Ashkar Vue test"),
);
await ashkar.flush();

۴. نتیجه را در Issues ببین

در Issues دنبال «Ashkar Vue test» بگرد. بعد از آن، خطاهای Vue همراه با اطلاعات component در همان پروژه ثبت می‌شوند.