Ashkar for JavaScript
Install the SDK, connect your project and see your first test error.
Ready in: About 5 minutes1. Install the package
Run this command from your project directory.
npm install @ashkarhq/browser2. Connect Ashkar to your project
Copy the public project key from Setup and run this once when your app starts.
import { init } from "@ashkarhq/browser";
export const ashkar = init({
dsn: "https://app.ashkarhq.ir/api/v1/events",
projectKey: "YOUR_PUBLIC_KEY",
environment: "production",
release: "web@1.0.0",
});3. Send a test error
Run this once for verification, then remove it after the error arrives.
await ashkar.captureException(
new Error("Ashkar JavaScript test"),
);
await ashkar.flush();4. Find the error in Ashkar
Open the dashboard, enter your project and look for “Ashkar JavaScript test” in Issues. When it appears, the connection is ready.
Your project should be connected now.
Open Issues and confirm the test error arrived. You can add the rest when you need it.