# Go

Use the Kirora HTTP API from Go while the official client is planned.

The official Go client is planned and has no announced release date. Until it is available, use the HTTP API with the example below. The module path will be confirmed when the client is released.

## What it will cover

The Go client will follow the [SDK conformance](/docs/api/sdk-conformance) checklist and copy the shape of the [Node.js reference library](/docs/sdks/node): one namespace per API tag and one method per `operationId` (`client.Contacts.Identify`, `client.Events.Track`), a single error type carrying the API's `Code`, bounded retries with jitter on 429 and 5xx, an injectable `http.Client`, auto-paginating iterators, caller-supplied idempotency keys, and a constant-time webhook verifier.

## Use the HTTP API today

Call the API directly with your key as a bearer token. [`trackEvent`](/docs/api/reference/trackEvent) requires an `Idempotency-Key`; derive it from your own order or event id so a retry is recorded once. To track an event with `net/http`:

```go
package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
	"os"
	"time"
)

func main() {
	body, _ := json.Marshal(map[string]any{
		"externalId": "cust_1042",
		"eventName":  "Order Completed",
		"properties": map[string]any{"orderId": "1042", "total": 42.5, "currency": "USD"},
	})

	req, _ := http.NewRequest("POST", "https://api.kirora.io/v1/events/track", bytes.NewReader(body))
	req.Header.Set("Authorization", "Bearer "+os.Getenv("KIRORA_API_KEY"))
	req.Header.Set("Idempotency-Key", "order-1042-completed")
	req.Header.Set("Content-Type", "application/json")

	client := &http.Client{Timeout: 30 * time.Second}
	res, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()
	fmt.Println(res.Status)
}
```

See [Errors](/docs/api/errors) and [Idempotency](/docs/api/idempotency) before adding retries.