Skip to content
Nuxie
Esc
navigateopen⌘Jpreview
On this page

Configuration

Initialize the iOS SDK with the current configuration surface

Call setup(with:) once near app launch. NuxieConfiguration is a mutable builder; setup snapshots its values, so later builder mutations do not reconfigure the running SDK.

Minimal setup

// nuxie-doc-snippet: minimal-configuration
import Nuxie

let config = NuxieConfiguration(apiKey: "your_api_key")
try NuxieSDK.shared.setup(with: config)

Find the publishable API key for the selected app and environment under Settings > API Keys.

Complete setup example

// nuxie-doc-snippet: complete-configuration
import Nuxie

let config = NuxieConfiguration(apiKey: "your_api_key")

config.environment = .production
config.logLevel = .warning
config.enableConsoleLogging = true
config.redactSensitiveData = true

config.localeIdentifier = nil

// Lifecycle moments ($app_installed, $app_updated, $app_opened,
// $app_backgrounded) are always captured; filter them with beforeSend.
config.beforeSend = { event in
    event.name.hasPrefix("debug_") ? nil : event
}

// Native StoreKit checkout, receipt sync, and finishing are the defaults.
config.purchaseHandlingMode = .full

try NuxieSDK.shared.setup(with: config)

Configuration options

Core and network

Property Type Default Description
apiKey String Required Publishable key for the selected Nuxie app and environment.
environment Environment .production .production or .development.

The endpoint follows the environment: https://i.nuxie.ai for production and https://dev-i.nuxie.ai for development. Network delivery policy (batching, retries, queue limits) is owned by the SDK and is not configurable.

Logging

Property Type Default Description
logLevel LogLevel .warning .verbose, .debug, .info, .warning, .error, or .none.
enableConsoleLogging Bool true Emit SDK logs to the console.
redactSensitiveData Bool true Mask sensitive identifiers and credentials in logs.

Events

Property Type Default Description
beforeSend (@Sendable (NuxieEvent) -> NuxieEvent?)? nil Transform an event or return nil to drop it.

Lifecycle moments ($app_installed, $app_updated, $app_opened, $app_backgrounded) are always captured because experiences can be triggered from them; use beforeSend to drop the ones you do not want. Delivery is durable and offline-first, and the SDK owns its own storage location.

Locale

Property Type Default Description
localeIdentifier String? nil Initial profile locale; nil follows the device locale.

Purchases

Property Type Default Description
purchaseHandlingMode PurchaseHandlingMode .full .full makes Nuxie the native StoreKit sync/finish owner; .observer leaves finishing to the app or provider.
purchaseDelegate NuxiePurchaseDelegate? nil Optional outcome-only RevenueCat, Superwall, or custom checkout seam. nil uses native StoreKit.
testStoreEnabled Bool false Enable the isolated iOS Test Store. Accepted only with .development and a pk_test_ key.

Configuring a purchase delegate does not silently change StoreKit ownership. Select .observer explicitly when RevenueCat, Superwall, or your app owns transaction finishing. See Purchases for complete examples.

Runtime changes

Use the explicit runtime controls after setup. Mutating the original configuration object has no effect:

// nuxie-doc-snippet: runtime-purchase-control
import Nuxie

func selectProviderCheckout(
    _ delegate: any NuxiePurchaseDelegate
) throws {
    try NuxieSDK.shared.setPurchaseHandlingMode(.observer)
    try NuxieSDK.shared.setPurchaseDelegate(delegate)
}

_ = try await NuxieSDK.shared.setLocaleIdentifier("es_ES")

setup(with:) is intentionally one-shot. To replace core configuration such as the API key or environment, restart the app and construct a new configuration.

Next steps

Last updated on August 24, 2026

Was this page helpful?