> ## Documentation Index
> Fetch the complete documentation index at: https://repost.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure the Kotlin Client

> Configure the Repost Kotlin client with the trailing-lambda DSL: credential precedence, timeouts, retries, and transport options.

The trailing-lambda constructor configures the client through the same validated options as Java — a `null` property keeps the default:

```kotlin theme={"languages":{"custom":["/languages/repost.json"]}}
RepostClient {
    apiKey = System.getenv("REPOST_SEND_API_KEY")
    operationTimeout = Duration.ofSeconds(30)
    maxAttempts = 4
    maxInFlightOperations = 128
}
```

## Credential and endpoint precedence

**Credential precedence**, highest first: an `apiKeyProvider` → a fixed `apiKey` → the `REPOST_SEND_API_KEY` environment variable → the `REPOST_TOKEN` environment variable. With none set, the first send fails with a `CONFIGURATION` error and never touches the network. **Base URI**: an explicit `baseUri` → `REPOST_API_URL` → the default `https://api.repost.sh`. Plain `http://` is accepted only for loopback hosts.

## Defaults

The defaults match the [Java SDK](/docs/send/java/configuration): 120s operation deadline, 30s per attempt, 4 attempts, 256 in-flight operations, a 64 MiB byte budget. The config object never prints your credential.

## Proxy, TLS, and mTLS

Build `HttpTransportOptions` and set it via the `httpTransportOptions` property: an explicit proxy with an optional credentials provider, a borrowed `SSLContext` for a custom truststore or mutual TLS, and an allowlisted TLS protocol (TLS 1.2/1.3) and cipher list. HTTP redirects are disabled.

## Continue

<Columns cols={3} className="gap-y-4">
  <Card title="Reliability" icon="shield-check" href="/docs/send/kotlin/reliability" cta="Outcomes" arrow="true">
    Idempotency, the five delivery states, and coroutine cancellation.
  </Card>

  <Card title="Observability" icon="activity" href="/docs/send/kotlin/observability" cta="Observe" arrow="true">
    Diagnostics, lifecycle observers, Micrometer, and OpenTelemetry.
  </Card>

  <Card title="Frameworks" icon="boxes" href="/docs/send/kotlin/frameworks" cta="Inject" arrow="true">
    Spring Boot properties, Jakarta CDI config, and container lifecycle.
  </Card>
</Columns>
