{
  "slug": "sdk/go",
  "title": "Go SDK",
  "description": "Send Cuitty events from Go services with a context-aware client.",
  "url": "https://cuitty.com/docs/sdk/go",
  "markdown_url": "https://cuitty.com/docs/sdk/go.md",
  "json_url": "https://cuitty.com/docs/sdk/go.json",
  "frontmatter": {
    "title": "Go SDK",
    "description": "Send Cuitty events from Go services with a context-aware client.",
    "order": 3,
    "section": "SDK",
    "updatedAt": "2026-04-27"
  },
  "headings": [
    {
      "depth": 1,
      "slug": "go-sdk",
      "text": "Go SDK"
    },
    {
      "depth": 2,
      "slug": "planned-api",
      "text": "Planned API"
    },
    {
      "depth": 2,
      "slug": "wire-protocol-equivalent-today",
      "text": "Wire-protocol equivalent today"
    },
    {
      "depth": 2,
      "slug": "live-performance-numbers",
      "text": "Live performance numbers"
    },
    {
      "depth": 2,
      "slug": "see-also",
      "text": "See also"
    }
  ],
  "body_markdown": "# Go SDK\n\n> **Status: Preview.** The Go SDK is on the Phase 3 roadmap. Use the [wire protocol](/docs/reference/wire-protocol) until then.\n\n## Planned API\n\n```go\nc := cuitty.New(cuitty.Config{\n    PortalURL: \"https://app.cuitty.com\",\n    ProjectID: id,\n    APIKey:    key,\n})\n\nc.Audit(ctx, cuitty.AuditEvent{\n    Actor:    \"alice@example.com\",\n    Action:   \"secret.rotate\",\n    Resource: \"stripe.live_key\",\n})\n```\n\n## Wire-protocol equivalent today\n\n```go\npackage main\n\nimport (\n    \"bytes\"\n    \"crypto/hmac\"\n    \"crypto/sha256\"\n    \"encoding/hex\"\n    \"net/http\"\n    \"os\"\n)\n\nfunc main() {\n    body := []byte(`{\"events\":[{\"type\":\"audit\",\"ts\":\"2026-04-27T12:00:00Z\",\"data\":{\"actor\":\"alice@example.com\",\"action\":\"secret.rotate\",\"resource\":\"stripe.live_key\"}}]}`)\n    mac := hmac.New(sha256.New, []byte(os.Getenv(\"CUITTY_WEBHOOK_SECRET\")))\n    mac.Write(body)\n    sig := hex.EncodeToString(mac.Sum(nil))\n\n    req, _ := http.NewRequest(\"POST\", \"https://app.cuitty.com/api/ingest\",\n        bytes.NewReader(body))\n    req.Header.Set(\"Authorization\", \"Bearer \"+os.Getenv(\"CUITTY_API_KEY\"))\n    req.Header.Set(\"Content-Type\", \"application/json\")\n    req.Header.Set(\"X-Cuitty-Signature\", sig)\n\n    http.DefaultClient.Do(req)\n}\n```\n\n## Live performance numbers\n\nSee live benchmarks at [https://benchmarks.cuitty.com/sdks/go](https://benchmarks.cuitty.com/sdks/go).\n\n## See also\n\n- [Wire protocol](/docs/reference/wire-protocol)\n- [SDK parity & divergence](/docs/sdk/parity)",
  "links_out": [
    "/docs/reference/wire-protocol",
    "https://benchmarks.cuitty.com/sdks/go",
    "/docs/sdk/parity"
  ]
}