Skip to main content

Overview

Add shipd to a Go 1.23+ service with one client per environment. Flag checks run in memory against a snapshot and make no network calls per request. This SDK uses polling for updates. Define flags in TypeScript or Go and sync them with the CLI. Use a server SDK key for the environment.

Install

Create the client

main.go
The client is safe to share across goroutines. Pass an evaluation context per request. Supply country or other location traits yourself when needed. Identify sends traits to shipd for audience insights and does not set a process-wide identity.

Updates and failure handling

The client fetches a snapshot at startup and polls every 30 seconds using ETags. Network failures, malformed snapshots, and unsupported schema versions keep the last valid snapshot. Before any snapshot loads, configured defaults apply. Use a bounded context with Ready, Refresh, and Shutdown. LastError exposes request failures. To stop, stop accepting new requests and drain in-flight handlers within a deadline before calling Shutdown(ctx). Shutdown attempts to flush pending events, then closes the client even if delivery fails. Close stops immediately without delivering them. This release has no WebSocket stream, disk cache, or remote identity overlay lookup. Pass traits on each evaluation context.

Next

Definitions and generated accessors

Author definitions with config.ShipdConfig from github.com/alasti-company/useshipd.com/sdks/go/config in shipd.config.go. The shared CLI reads this Go source directly and generates Go accessors by default after push and pull, unless typesLanguage overrides it. Run shipd types gen to regenerate locally. See Define flags in code and Generate Go accessors.