pub struct Config {
pub api_key: String,
pub base_url: String,
pub log_level: LogLevel,
pub app_version: Option<String>,
pub platform: Option<String>,
pub environment: Option<String>,
}Fields§
§api_key: String§base_url: String§log_level: LogLevel§app_version: Option<String>Host app’s user-facing version string (CFBundleShortVersionString on iOS,
PackageInfo.versionName on Android). Forwarded into session-event
telemetry payloads. None is serialized as "" to preserve the
pre-0.7 wire format.
platform: Option<String>Runtime platform the SDK is running on (ios / android / web),
supplied by the native façade. Sent as the X-Rovenue-Platform header
so the backend can record it as the subscriber’s first-install platform
on create. None omits the header entirely.
environment: Option<String>Remote Config environment (prod / staging / development). Sent as
the X-Rovenue-Env header on the /v1/config request so the backend
serves the matching flag/experiment set. None omits the header, which
the backend treats as prod.
Implementations§
Source§impl Config
impl Config
pub fn new(api_key: String, base_url: String) -> RovenueResult<Self>
Sourcepub fn with_app_version(self, app_version: Option<String>) -> Self
pub fn with_app_version(self, app_version: Option<String>) -> Self
Builder-style setter for the host app version.
Sourcepub fn with_platform(self, platform: Option<String>) -> Self
pub fn with_platform(self, platform: Option<String>) -> Self
Builder-style setter for the runtime platform.
Sourcepub fn with_environment(self, environment: Option<String>) -> Self
pub fn with_environment(self, environment: Option<String>) -> Self
Builder-style setter for the Remote Config environment.
Sourcepub fn normalized(self) -> RovenueResult<Self>
pub fn normalized(self) -> RovenueResult<Self>
Normalize + validate a Config built directly from the UniFFI
dictionary. The FFI path constructs the struct field-by-field and
bypasses new, so this is where the base-URL rules get enforced over
the FFI boundary. Empty base_url falls back to the hosted default.