examples

command
v1.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 5 Imported by: 0

README

smplkit SDK Examples

Runnable examples demonstrating the smplkit Go SDK.

Note: These examples require valid smplkit credentials and a live environment — they are not self-contained demos.

Prerequisites

  1. Go 1.24+
  2. A valid smplkit API key (create one in the smplkit console).
  3. At least one config created in your smplkit account (every account comes with a common config by default).

Config Showcase

File: config_showcase.go

An end-to-end walkthrough of the Smpl Config SDK covering:

  • Client initializationsmplkit.NewClient(apiKey)
  • Management-plane CRUD — create, update, list, get by key, and delete configs
  • Environment overridesSetValues() and SetValue() for per-environment configuration
  • Multi-level inheritance — child → parent → common hierarchy setup
  • Runtime value resolutionConnect(), Get(), typed accessors (GetString, GetInt, GetBool)
  • Real-time updates — WebSocket-driven cache invalidation with change listeners
  • Manual refresh and cache diagnosticsRefresh(), Stats()
Running
export SMPLKIT_API_KEY="sk_api_..."
go run examples/config_showcase.go

The script creates temporary configs, exercises all SDK features, then cleans up after itself.

Documentation

Overview

Config Showcase — end-to-end walkthrough of the Smpl Config Go SDK.

Demonstrates the full SDK surface:

  • Client initialization
  • Management-plane CRUD: create, update, list, delete
  • Environment-specific overrides (SetValues, SetValue)
  • Multi-level inheritance
  • Runtime value resolution: Connect, Get, typed accessors, Exists
  • Real-time updates via WebSocket and change listeners
  • Manual refresh and cache diagnostics
  • Environment comparison
  • Cleanup

Prerequisites:

  • A valid smplkit API key exported as SMPLKIT_API_KEY
  • At least one config in your account (every account has "common" by default)

Usage:

export SMPLKIT_API_KEY="sk_api_..."
go run examples/config_showcase.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL