omnidxi

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 5 Imported by: 0

README

OmniDXI

Go CI Go Lint Go SAST Go Report Card Docs Visualization License

Batteries-included Digital Experience Intelligence (DXI) client for Go.

Overview

omnidxi provides a unified interface for product analytics platforms like Amplitude, Mixpanel, Heap, and Pendo. It re-exports types from omnidxi-core and includes utilities for working with multiple providers.

Installation

go get github.com/plexusone/omnidxi

Quick Start

package main

import (
    "context"

    "github.com/plexusone/omnidxi"
    "github.com/plexusone/omni-amplitude/omnidxi/amplitude"
    "github.com/plexusone/omni-mixpanel/omnidxi/mixpanel"
)

func main() {
    ctx := context.Background()

    // Create provider trackers
    amp := amplitude.New(omnidxi.WithAPIKey("amp-key"))
    mix := mixpanel.New(omnidxi.WithAPIKey("mix-token"))

    // Combine into multi-tracker
    tracker := omnidxi.NewMultiTracker(amp, mix)
    defer tracker.Close()

    // Track events to all providers
    event := omnidxi.NewEvent(omnidxi.EventTypePageView, "Home Viewed").
        WithUserID("user_123").
        WithProperty("source", "direct")

    tracker.Track(ctx, event)

    // Identify user across all providers
    user := omnidxi.NewUser("user_123").
        WithTraits(omnidxi.UserTraits{
            Email: "user@example.com",
            Name:  "Jane Doe",
        })

    tracker.Identify(ctx, user)

    // Flush before exit
    tracker.Flush(ctx)
}

Multi-Tracker

Send events to multiple providers simultaneously:

tracker := omnidxi.NewMultiTracker(amplitude, mixpanel, heap)

// All providers receive the event
tracker.Track(ctx, event)

No-op Tracker

For testing or when tracking should be disabled:

tracker := omnidxi.NewNoopTracker()

Provider Packages

Provider Package Status
Amplitude github.com/plexusone/omni-amplitude/omnidxi Planned
Mixpanel github.com/plexusone/omni-mixpanel/omnidxi Planned
Heap github.com/plexusone/omni-heap/omnidxi Future
Pendo github.com/plexusone/omni-pendo/omnidxi Future

Architecture

┌─────────────────────────────────────────────────────┐
│                    Application                      │
└─────────────────────────┬───────────────────────────┘
                          │
                          ▼
┌─────────────────────────────────────────────────────┐
│                     omnidxi                         │
│              (batteries-included)                   │
│                                                     │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐  │
│  │ MultiTracker│  │ NoopTracker │  │  Re-exports │  │
│  └─────────────┘  └─────────────┘  └─────────────┘  │
└─────────────────────────┬───────────────────────────┘
                          │
                          ▼
┌─────────────────────────────────────────────────────┐
│                   omnidxi-core                      │
│           (interfaces, types, schema)               │
└─────────────────────────┬───────────────────────────┘
                          │
        ┌─────────────────┼─────────────────┐
        ▼                 ▼                 ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│omni-amplitude │ │ omni-mixpanel │ │   omni-heap   │
│   /omnidxi    │ │   /omnidxi    │ │   /omnidxi    │
└───────────────┘ └───────────────┘ └───────────────┘
        │                 │                 │
        ▼                 ▼                 ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ analytics-go  │ │ mixpanel-go   │ │   heap SDK    │
│  (official)   │ │  (official)   │ │  (official)   │
└───────────────┘ └───────────────┘ └───────────────┘

License

MIT

Documentation

Overview

Package omnidxi provides a batteries-included Digital Experience Intelligence (DXI) client with support for multiple analytics providers.

This package re-exports core types from omnidxi-core and provides convenience functions for working with multiple providers simultaneously.

For individual provider usage, import the provider packages directly:

import "github.com/plexusone/omni-amplitude/omnidxi"
import "github.com/plexusone/omni-mixpanel/omnidxi"

Index

Constants

View Source
const (
	EventTypePageView    = core.EventTypePageView
	EventTypePageLeave   = core.EventTypePageLeave
	EventTypeUIClick     = core.EventTypeUIClick
	EventTypeUIInput     = core.EventTypeUIInput
	EventTypeUIScroll    = core.EventTypeUIScroll
	EventTypeUISubmit    = core.EventTypeUISubmit
	EventTypeStateChange = core.EventTypeStateChange
	EventTypeAPIRequest  = core.EventTypeAPIRequest
	EventTypeAPIResponse = core.EventTypeAPIResponse
	EventTypeJourneyStep = core.EventTypeJourneyStep
	EventTypeError       = core.EventTypeError
	EventTypePerformance = core.EventTypePerformance
	EventTypeCustom      = core.EventTypeCustom
)

Re-export event types.

Variables

View Source
var (
	NewEvent   = core.NewEvent
	NewUser    = core.NewUser
	NewGroup   = core.NewGroup
	NewAlias   = core.NewAlias
	NewConfig  = core.NewConfig
	WithAPIKey = core.WithAPIKey
	WithLogger = core.WithLogger
	WithDebug  = core.WithDebug
)

Re-export constructors.

View Source
var (
	ErrDisabled         = core.ErrDisabled
	ErrNoAPIKey         = core.ErrNoAPIKey
	ErrInvalidUserID    = core.ErrInvalidUserID
	ErrInvalidEventName = core.ErrInvalidEventName
	ErrFlushFailed      = core.ErrFlushFailed
	ErrClosed           = core.ErrClosed
)

Re-export errors.

View Source
var (
	// NewAmplitudeTracker creates an Amplitude tracker.
	NewAmplitudeTracker = amplitude.New

	// NewMixpanelTracker creates a Mixpanel tracker.
	NewMixpanelTracker = mixpanel.New
)

Provider constructors for convenience.

Functions

This section is empty.

Types

type Alias

type Alias = core.Alias

Re-export core types for convenience.

type Config

type Config = core.Config

Re-export core types for convenience.

type Event

type Event = core.Event

Re-export core types for convenience.

type EventContext

type EventContext = core.EventContext

Re-export core types for convenience.

type EventType

type EventType = core.EventType

Re-export core types for convenience.

type Group

type Group = core.Group

Re-export core types for convenience.

type MultiTracker

type MultiTracker struct {
	// contains filtered or unexported fields
}

MultiTracker sends events to multiple providers simultaneously.

func NewMultiTracker

func NewMultiTracker(trackers ...core.Tracker) *MultiTracker

NewMultiTracker creates a new MultiTracker with the given trackers.

func (*MultiTracker) Add

func (m *MultiTracker) Add(t core.Tracker)

Add adds a tracker to the multi-tracker.

func (*MultiTracker) Alias

func (m *MultiTracker) Alias(ctx context.Context, alias core.Alias) error

Alias sends alias to all trackers.

func (*MultiTracker) Close

func (m *MultiTracker) Close() error

Close closes all trackers.

func (*MultiTracker) Flush

func (m *MultiTracker) Flush(ctx context.Context) error

Flush flushes all trackers.

func (*MultiTracker) Group

func (m *MultiTracker) Group(ctx context.Context, group core.Group) error

Group sends group association to all trackers.

func (*MultiTracker) Identify

func (m *MultiTracker) Identify(ctx context.Context, user core.User) error

Identify sends user identification to all trackers.

func (*MultiTracker) Track

func (m *MultiTracker) Track(ctx context.Context, event core.Event) error

Track sends an event to all trackers.

type NoopTracker

type NoopTracker struct{}

NoopTracker is a tracker that does nothing. Useful for testing or when tracking should be disabled.

func NewNoopTracker

func NewNoopTracker() *NoopTracker

NewNoopTracker creates a new no-op tracker.

func (*NoopTracker) Alias

func (n *NoopTracker) Alias(ctx context.Context, alias core.Alias) error

func (*NoopTracker) Close

func (n *NoopTracker) Close() error

func (*NoopTracker) Flush

func (n *NoopTracker) Flush(ctx context.Context) error

func (*NoopTracker) Group

func (n *NoopTracker) Group(ctx context.Context, group core.Group) error

func (*NoopTracker) Identify

func (n *NoopTracker) Identify(ctx context.Context, user core.User) error

func (*NoopTracker) Track

func (n *NoopTracker) Track(ctx context.Context, event core.Event) error

type Option

type Option = core.Option

Re-export core types for convenience.

type Tracker

type Tracker = core.Tracker

Re-export core types for convenience.

type TrackerInfo

type TrackerInfo = core.TrackerInfo

Re-export core types for convenience.

type User

type User = core.User

Re-export core types for convenience.

type UserTraits

type UserTraits = core.UserTraits

Re-export core types for convenience.

Jump to

Keyboard shortcuts

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