# Okapi install guide — Spring Boot

Okapi speaks the Sentry ingest wire format: this is the standard `sentry-spring-boot-starter-jakarta` SDK, pointed at your own Okapi instance instead of Sentry's.

The DSN in this generic guide is a placeholder. Get the real DSN from Project → Settings → DSN Keys. An agent with an admin Okapi MCP credential can also call `get_dsn`. Do not invent a DSN.

Do not run the Sentry wizard or any setup that signs in to Sentry's hosted service; nothing in this setup should contact it.

## 1. Install

### `build.gradle`

```groovy
// Spring Boot 3 (Jakarta), inside dependencies
implementation 'io.sentry:sentry-spring-boot-starter-jakarta:8.62.0'
```

## 2. Initialize

### `src/main/resources/application.properties`

```properties
sentry.dsn=http://YOUR_PUBLIC_KEY@YOUR_OKAPI_HOST/YOUR_PROJECT_ID
sentry.environment=production
```

Use this plain dependency for Spring Boot 3; Boot 2 uses sentry-spring-boot-starter, Boot 4 uses sentry-spring-boot-4. Do not add Sentry's Gradle or Maven plugin. For Kotlin DSL, add this dependency inside build.gradle.kts instead:

```kotlin
implementation("io.sentry:sentry-spring-boot-starter-jakarta:8.62.0")
```

For Maven, add this dependency inside pom.xml's dependencies instead:

```xml
<dependency>
  <groupId>io.sentry</groupId>
  <artifactId>sentry-spring-boot-starter-jakarta</artifactId>
  <version>8.62.0</version>
</dependency>
```

A short-lived main should call Sentry.flush(2000) before exiting; a running Spring app needs no flush.

## 3. Send a test event

```java
io.sentry.Sentry.captureException(new RuntimeException("Okapi test event"));
```

## 4. Verify

Open the instance's dashboard → Issues. The test event should appear within a few seconds as a new issue. If the instance's MCP server exposes a `verify_installation` tool, call that instead of checking by hand — it reports the SDK name/version and whether only a synthetic test event has arrived yet.

## More

- Structured logs (same DSN, no separate shipper) and source map uploads: https://useokapi.app/docs/sdk-setup
- Connect over MCP once the SDK is wired up: https://useokapi.app/docs/mcp-agents
