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

# Go SDK

> Install fact0-go v1.0.4 for native Go services and sidecars.

# Go SDK

|              |                                                                                                 |
| ------------ | ----------------------------------------------------------------------------------------------- |
| **Module**   | [`github.com/fact0-ai/fact0/sdk/go`](https://github.com/fact0-ai/fact0/tree/main/sdk/go) v1.0.4 |
| **API**      | `https://api.fact0.io`                                                                          |
| **Requires** | Go 1.23+                                                                                        |

```bash theme={null}
go get github.com/fact0-ai/fact0/sdk/go
```

```go theme={null}
package main

import (
    "context"
    "log"
    "os"

    fact0 "github.com/fact0-ai/fact0/sdk/go"
)

func main() {
    client := fact0.NewClient(fact0.Config{
        APIKey: os.Getenv("FACT0_API_KEY"),
        // BaseURL defaults to https://api.fact0.io; set for local dev only.
    })

    err := client.Audit.Log(context.Background(), fact0.AuditEventInput{
        Actor:    fact0.Actor{ID: "svc-1", Type: "system"},
        Action:   "config.update",
        Resource: fact0.Resource{ID: "cfg_1", Type: "config"},
        Outcome:  "success",
    })
    if err != nil {
        log.Fatal(err)
    }
}
```

## Packages

* `fact0.AuditClient` - `/v1/*` audit surface
* `fact0.TelemetryClient` - `/api/v1/*` execution tracing

Both support context cancellation, retries on 429/5xx, and configurable timeouts.
