API Reference
Hyperstone
Section titled “Hyperstone”| Method | Description |
|---|---|
Initialize(appId, appSecret, logLevel?) | Initialize the SDK with your credentials. |
Initialize(appId, appSecret, apiUrl, logLevel?) | Initialize with a custom API endpoint. |
WatchConfig(callback) | Subscribe to config updates. Safe to call before Initialize. |
UnwatchConfig(callback) | Unsubscribe from config updates. |
LogAdImpression(platform, network, format, revenueUsd) | Track an ad impression with revenue. |
LogAdRequest(platform, format) | Track an ad request. |
LogAdError(platform, network, format, failReason?) | Track an ad error. |
LogIapTransactionSuccess(productId, currency, price) | Track a successful in-app purchase. |
LogIapTransactionError(productId, failReason) | Track a failed in-app purchase. |
IncrementCustomMetric(name, value) | Increment a custom numeric metric. |
IncrementCustomMetric(name, value, labels...) | Increment a custom metric with labels. |
LogCustomEvent(name, labels...) | Log a custom event (equivalent to incrementing by 1). |
ClearData() | Clear all locally stored SDK data. |
LogLevel | Get or set the current log verbosity. |
HyperstoneConfig
Section titled “HyperstoneConfig”| Method | Description |
|---|---|
GetIntOrDefault(key, default) | Get an integer config value. |
GetLongOrDefault(key, default) | Get a long config value. |
GetFloatOrDefault(key, default) | Get a float config value. |
GetDoubleOrDefault(key, default) | Get a double config value. |
GetBoolOrDefault(key, default) | Get a boolean config value. |
GetStringOrDefault(key, default) | Get a string config value. |
TryGetInt(key, out value) | Try to get an int. Returns false if missing. |
TryGetLong(key, out value) | Try to get a long. Returns false if missing. |
TryGetFloat(key, out value) | Try to get a float. Returns false if missing. |
TryGetDouble(key, out value) | Try to get a double. Returns false if missing. |
TryGetBool(key, out value) | Try to get a bool. Returns false if missing. |
TryGetString(key, out value) | Try to get a string. Returns false if missing. |
TryGetValueAsJson(key, out json) | Get the raw JSON string for a key. |
TryGetValueAsObject<T>(key, out obj) | Deserialize a nested value to T. |
AsObject<T>() | Deserialize the entire config to T. |
OverwriteObject(obj) | Overwrite fields on an existing object. |
Keys | Enumerate all config keys. |
ToString() | Returns the raw JSON string. |
// Constructornew Label(string name, string value)A readonly struct used to attach metadata to metrics. Labels help Hyperstone segment and analyze measurements.