ABSmartly (ABSmartly v1.0.0)

Copy Markdown View Source

ABSmartly SDK for Elixir.

Official Elixir SDK for the ABSmartly experimentation platform.

Usage

# Configure SDK with keyword list
{:ok, sdk} = ABSmartly.new(
  endpoint: "https://your-company.absmartly.io/v1",
  api_key: "YOUR-API-KEY",
  application: "website",
  environment: "development"
)

# Create context
{:ok, context} = ABSmartly.create_context(sdk, %{"session_id" => "abc123"})

# Get treatment
variant = ABSmartly.Context.treatment(context, "exp_test")

# Track goal
ABSmartly.Context.track(context, "purchase", %{amount: 99.99})

# Publish events
ABSmartly.Context.publish(context)

# Finalize and release the context process
ABSmartly.Context.dispose(context)

Pipe-friendly API

{:ok, sdk} = ABSmartly.new(endpoint: "...", api_key: "...", ...)
  |> ABSmartly.with_timeout(5000)
  |> ABSmartly.with_retries(3)

Summary

Functions

create_context(sdk, units, options \\ %{})

See ABSmartly.SDK.create_context/3.

create_context_async(sdk, units, options \\ %{})

See ABSmartly.SDK.create_context_async/3.

create_context_with(sdk, units, data, options \\ %{})

See ABSmartly.SDK.create_context_with/4.

new(opts)

See ABSmartly.SDK.new/1.

version()

with_retries(sdk, retries)

See ABSmartly.SDK.with_retries/2.

with_timeout(sdk, timeout)

See ABSmartly.SDK.with_timeout/2.