# errorgap for Deno

See [index.md](./index.md) for API details and the placeholder values (`ERRORGAP_API_KEY`, `ERRORGAP_ENDPOINT`, `ERRORGAP_PROJECT_SLUG`).

SDK source: `github.com/errorgaphq/errorgap-deno` · current version: `0.2.0`. Requires Deno 1.40+.

## Install

```ts
import { Errorgap } from "jsr:@errorgap/deno@0.2";
```

Or add it to your import map:

```sh
deno add jsr:@errorgap/deno
```

## Configure

```ts
import { Errorgap } from "@errorgap/deno";

Errorgap.init({
  endpoint:    Deno.env.get("ERRORGAP_ENDPOINT")!,
  projectSlug: Deno.env.get("ERRORGAP_PROJECT_SLUG")!,
  apiKey:      Deno.env.get("ERRORGAP_API_KEY"),
});
```

`init` hooks `globalThis.error` and `globalThis.unhandledrejection`.

Run with `--allow-net=<errorgap-host>` and `--allow-env` to read the env defaults.

## Trigger a test error

```ts
throw new Error("Errorgap test error");
```

## Verify

Run the verification curl from [index.md](./index.md), then throw the test error and confirm the onboarding screen advances.
