Skip to content
IForevents Docs
IForevents Docs
HomeDashboardGitHubPrivacyTermsSecurityIntroduction
Support and SLA

Go SDK

Install iforevents-go, identify users, track events and add adapters from Go

go get github.com/innovafour/iforevents-sdks/go
import iforevents "github.com/innovafour/iforevents-sdks/go"

api := iforevents.MustAPIIntegration(iforevents.APIConfig{ProjectKey: os.Getenv("IFOREVENTS_PROJECT_KEY")})
client := iforevents.New(iforevents.WithIntegrations(api))
client.Init(ctx)
defer client.Shutdown(ctx)

client.Identify(ctx, "user_123", iforevents.Properties{"email": "[email protected]", "plan": "pro"})
client.Track(ctx, "invoice_paid", iforevents.Properties{"amount": 120, "currency": "USD"})
client.Page(ctx, "/pricing", nil, iforevents.PageOptions{})

No dependencies outside the standard library. Every call returns []IntegrationResult; errors are typed (*AuthError, *QuotaExceededError, *RateLimitedError, *APIError) and detected with errors.As.

Adapters (separate modules, so the core stays dependency-free)

import "github.com/innovafour/iforevents-sdks/go/integrations/mixpanel"

client := iforevents.New(iforevents.WithIntegrations(api, mixpanel.New(mixpanel.Config{Token: "..."})))

Available: integrations/mixpanel, integrations/amplitude, integrations/segment, integrations/posthog.

APIConfig

BaseURL, BatchSize (20, max 500), FlushInterval (10s), Timeout, MaxRetries / RetryDelay, DisableRequeue, Storage / PersistQueue (NewFileStorage), ReturnErrors, OnQuotaExceeded, OnError, HTTPClient.

Source: iforevents-sdks/go.

On this page

Adapters (separate modules, so the core stays dependency-free)APIConfig