---
title: Sentry API
description: Generated public TypeScript reference for @relkit/sentry.
search:
  exclude: true
sidebar:
  icon: braces
---

{/* Generated by apps/docs/scripts/generate.ts. Do not edit. */}

For configuration and examples, read [observability](/docs/modules/operations/observability).

## Public imports

- `@relkit/sentry` — 3 exports
- `@relkit/sentry/runtime` — 7 exports

## All exported APIs

Names link to their complete contracts. Re-exports share their original contract; legacy exports keep their separate identity. Examples link to the API's inline sample, a maintained repository usage, or the shared module walkthrough.

| API                                                                                         | Kind  | Import from              | Example                                                                                                   |
| ------------------------------------------------------------------------------------------- | ----- | ------------------------ | --------------------------------------------------------------------------------------------------------- |
| [createSentryExporter](/docs/api/integrations/sentry#createsentryexporter)                  | Value | `@relkit/sentry/runtime` | [Module example](/docs/modules/operations/observability)                                                  |
| [createTelemetryExporter](/docs/api/integrations/sentry#createtelemetryexporter)            | Value | `@relkit/sentry/runtime` | [Module example](/docs/modules/operations/observability)                                                  |
| [runtimeIntegration](/docs/api/integrations/sentry#runtimeintegration)                      | Value | `@relkit/sentry/runtime` | [Module example](/docs/modules/operations/observability)                                                  |
| [sentry](/docs/api/integrations/sentry#sentry)                                              | Value | `@relkit/sentry`         | [Source example](https://github.com/rel-kit/relkit/blob/main/apps/docs/examples/landing/telemetry.ts#L12) |
| [SentryExporter](/docs/api/integrations/sentry#sentryexporter-interface)                    | Type  | `@relkit/sentry/runtime` | [Module example](/docs/modules/operations/observability)                                                  |
| [SentryExporterOptions](/docs/api/integrations/sentry#sentryexporteroptions-interface)      | Type  | `@relkit/sentry/runtime` | [Module example](/docs/modules/operations/observability)                                                  |
| [SentryOptions](/docs/api/integrations/sentry#sentryoptions-interface)                      | Type  | `@relkit/sentry`         | [Module example](/docs/modules/operations/observability)                                                  |
| [SentryScope](/docs/api/integrations/sentry#sentryscope-interface)                          | Type  | `@relkit/sentry/runtime` | [Module example](/docs/modules/operations/observability)                                                  |
| [SentrySdk](/docs/api/integrations/sentry#sentrysdk-interface)                              | Type  | `@relkit/sentry/runtime` | [Module example](/docs/modules/operations/observability)                                                  |
| [SentryTelemetryExporter](/docs/api/integrations/sentry#sentrytelemetryexporter-type-alias) | Type  | `@relkit/sentry`         | [Module example](/docs/modules/operations/observability)                                                  |

## `index.ts`

### "./sentry.js" (namespace export)

Re-exports all named exports from the "./sentry.js" module.

**Signature**

```ts
export * from "./sentry.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/integrations/packages/sentry/src/index.ts#L1)

## `exporter.ts`

### SentryExporter (interface)

**Signature**

```ts
export interface SentryExporter {
  readonly exportRecord: (record: RedactedObservabilityRecord) => void;
  readonly flush: (timeoutMs?: number) => Promise<boolean>;
  readonly close: (timeoutMs?: number) => Promise<boolean>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/integrations/packages/sentry/src/runtime/exporter.ts#L28)

### SentryExporterOptions (interface)

**Signature**

```ts
export interface SentryExporterOptions {
  readonly dsn: string;
  readonly environment?: string;
  readonly release?: string;
  readonly sdk?: SentrySdk;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/integrations/packages/sentry/src/runtime/exporter.ts#L8)

### SentryScope (interface)

**Signature**

```ts
export interface SentryScope {
  readonly setTag: (name: string, value: string) => void;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/integrations/packages/sentry/src/runtime/exporter.ts#L15)

### SentrySdk (interface)

**Signature**

```ts
export interface SentrySdk {
  readonly init: (options: Readonly<Record<string, unknown>>) => void;
  readonly withScope: (callback: (scope: SentryScope) => void) => void;
  readonly captureException: (error: Error) => unknown;
  readonly captureEvent: (event: Readonly<Record<string, unknown>>) => unknown;
  readonly flush: (timeout?: number) => Promise<boolean>;
  readonly close: (timeout?: number) => Promise<boolean>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/integrations/packages/sentry/src/runtime/exporter.ts#L19)

### createSentryExporter

**Signature**

```ts
declare const createSentryExporter: (options: SentryExporterOptions) => Promise<SentryExporter>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/integrations/packages/sentry/src/runtime/exporter.ts#L34)

### createTelemetryExporter

**Signature**

```ts
declare const createTelemetryExporter: (
  context: TelemetryExporterFactoryContext,
) => Promise<TelemetryExporterRuntime>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/integrations/packages/sentry/src/runtime/exporter.ts#L76)

## `index.ts`

### "./exporter.js" (namespace export)

Re-exports all named exports from the "./exporter.js" module.

**Signature**

```ts
export * from "./exporter.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/integrations/packages/sentry/src/runtime/index.ts#L1)

### runtimeIntegration

**Signature**

```ts
declare const runtimeIntegration: Readonly<{
  kind: "runtime-integration";
  integrationId: "sentry";
  registrations: ReadonlyArray<{ capability: string; adapterId: string; protocolVersion: number }>;
}>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/integrations/packages/sentry/src/runtime/index.ts#L3)

## `sentry.ts`

### SentryOptions (interface)

**Signature**

```ts
export interface SentryOptions {
  readonly dsn: TextInput;
  readonly environment?: TextInput;
  readonly release?: TextInput;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/integrations/packages/sentry/src/sentry.ts#L13)

### SentryTelemetryExporter (type alias)

**Signature**

```ts
type SentryTelemetryExporter = TelemetryExporterDescriptor<"sentry", "sentry", SentryOptions>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/integrations/packages/sentry/src/sentry.ts#L19)

### sentry

Declares one statically loaded Sentry telemetry exporter.

**Signature**

```ts
declare const sentry: (options: SentryOptions) => SentryTelemetryExporter;
```

[Source](https://github.com/rel-kit/relkit/blob/main/integrations/packages/sentry/src/sentry.ts#L26)
