Main SDK class for ABSmartly.
Provides context creation methods:
create_context/3: Synchronous - fetches data from API, blocks until completecreate_context_async/3: Async - starts context immediately, fetches data in backgroundcreate_context_with/4: Uses pre-fetched data directly
Summary
Functions
Create context with synchronous data fetching (blocks until HTTP fetch completes).
Create context with async data fetching (non-blocking).
Create context with pre-fetched data (synchronous).
Create a new SDK instance using keyword list configuration.
Set custom retry count for the SDK instance (pipe-friendly).
Set custom timeout for the SDK instance (pipe-friendly).
Types
@type t() :: %ABSmartly.SDK{config: ABSmartly.Types.SDKConfig.t()}
Functions
Create context with synchronous data fetching (blocks until HTTP fetch completes).
Use create_context_async/3 for non-blocking context creation.
Create context with async data fetching (non-blocking).
The context is created immediately and data is fetched in the background.
Use Context.wait_until_ready/2 to block until data is available.
Create context with pre-fetched data (synchronous).
Create a new SDK instance using keyword list configuration.
Required Parameters
:endpoint- The URL to your API endpoint (e.g., "https://your-company.absmartly.io/v1"):api_key- Your API key from the Web Console:application- The name of your application:environment- The environment name (e.g., "production", "development")
Optional Parameters
:timeout- Connection timeout in milliseconds (default: 3000):retries- Number of retry attempts for failed requests (default: 5)
Set custom retry count for the SDK instance (pipe-friendly).
Set custom timeout for the SDK instance (pipe-friendly).