Skip to main content
Create project
Reference

Configuration Reference

Complete reference for all SDK configuration options across client, React, and server packages.

Client SDK Configuration (@sheepit-ai/sdk-js)

OptionTypeDefaultDescription
apiKeystring(required)Your publishable key (lp_pub_*)
environmentstring"production"Environment name for flag targeting
apiUrlstring"https://api.goatech.ai"API base URL
flushIntervalnumber5000Milliseconds between event flushes
flushSizenumber20Events per batch
maxQueueSizenumber1000Maximum queued events before dropping
configRefreshIntervalnumber300000Flag config refresh interval (5 min)
retryAttemptsnumber3API request retry attempts
debugbooleanfalseEnable debug logging to console
onEventfunctionCallback for every tracked event
onDiagnosticfunctionSubscribe to diagnostic events
diagnosticBufferSizenumber100Ring buffer size for diagnostics
goatech.ts
import { GoaTech } from "@sheepit-ai/sdk-js";

const gt = GoaTech.create({
  apiKey: "lp_pub_abc_...",
  environment: "production",
  flushInterval: 10_000,
  flushSize: 50,
  maxQueueSize: 2000,
  debug: process.env.NODE_ENV === "development",
  onEvent: (event) => console.log("Event:", event),
});

React Provider Configuration (@sheepit-ai/react)

The React provider accepts the same config as the client SDK, plus:

OptionTypeDefaultDescription
configGoaTechConfig(required)Client SDK configuration object
user{ id: string; traits?: Record<string, unknown> } | nullCurrent user for automatic identity sync

Server SDK Configuration (@sheepit-ai/server)

OptionTypeDefaultDescription
apiKeystring(required)Your secret key (lp_sec_*)
environmentstring"production"Environment name
apiUrlstring"https://api.goatech.ai"API base URL
cacheTtlnumber60000Flag config cache TTL (ms)
flushIntervalnumber5000Event flush interval (ms)
flushSizenumber50Events per batch
maxBufferSizenumber10000Max buffered events (prevents OOM)
debugbooleanfalseEnable debug logging
onDiagnosticfunctionSubscribe to diagnostic events
diagnosticBufferSizenumber100Ring buffer size for diagnostics

Environment Variables (Next.js)

The getGoaTech() helper reads the following environment variables at runtime:

VariableRequiredDescription
GT_SECRET_KEYYesSecret API key (lp_sec_*)
GT_ENVIRONMENTNoEnvironment name (default: "production")
GT_API_URLNoAPI base URL

Client-side environment variables (for React):

VariableDescription
NEXT_PUBLIC_GT_KEYPublishable API key (lp_pub_*)