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

# HealthResource: Service Status Check

> Use the HealthResource to verify that a Figranium server is running and reachable. No authentication is required.

The `HealthResource` on `client.health` provides a lightweight liveness probe for any Figranium instance. Call `check()` to confirm the server is up, read its version, and verify that your SDK install and network path are working. No API key is required.

## Client setup

```swift HealthResource.swift theme={null}
import Figranium

let client = Figranium()
```

## Methods

<AccordionGroup>
  <Accordion title="`check`">
    ```swift theme={null}
    check(options: RequestOptions = .init()) async throws -> HealthStatus
    ```

    Performs a `GET /api/health` request and returns the server's health status. This is the fastest way to verify connectivity and SDK configuration.

    ### Returns

    `HealthStatus` with these fields:

    * `status`: a human-readable status string such as `"ok"`
    * `version`: the running Figranium server version

    ### Example: verify connectivity

    ```swift health_check.swift theme={null}
    let status = try await client.health.check()
    print(status.status)   // "ok"
    print(status.version)  // "0.14.4"
    ```

    ### Example: no authentication needed

    Because `check()` requires no authentication, you can call it before the user has signed in or provided an API key:

    ```swift health_no_auth.swift theme={null}
    let client = Figranium(baseURL: "https://figranium.example")
    let status = try await client.health.check()
    print(status.status)
    ```

    ### Example: handle transport failures

    Wrap `check()` in a `do/catch` to detect network or DNS issues. Transport failures surface as [`FigraniumError`](/docs/sdk/swift/errors) with `code: "NETWORK_ERROR"`:

    ```swift health_transport.swift theme={null}
    let client = Figranium(baseURL: "https://figranium.example")

    do {
        let status = try await client.health.check()
        print("Server is up:", status.status)
    } catch let error as FigraniumError {
        if error.code == "NETWORK_ERROR" {
            print("Cannot reach the Figranium server. Check the baseURL and network.")
        }
        throw error
    }
    ```

    <Note>
      The `check()` method accepts the standard `RequestOptions` as its `options` argument, so you can pass custom `headers` or a per-request `timeout` when needed.
    </Note>
  </Accordion>
</AccordionGroup>

## Related resources

<CardGroup cols={2}>
  <Card title="Errors" icon="alert-triangle" href="/docs/sdk/swift/errors">
    Handle `FigraniumError` responses, including `NETWORK_ERROR`.
  </Card>

  <Card title="Request options" icon="http-get" href="/docs/sdk/swift/request-options">
    Pass custom `headers` and per-request `timeout` overrides.
  </Card>

  <Card title="Client configuration" icon="user-cog" href="/docs/sdk/swift/client-configuration">
    Configure `baseURL`, timeouts, and default headers.
  </Card>
</CardGroup>
