Reference
SDK API Reference
Public API surface for the Prism AR SDK — Swift (visionOS) and Kotlin (Android XR).
PrismConfig
Optional configuration struct passed to PrismAR.initialize. All fields are optional; omit to use defaults.
| Property | Type | Default | Description |
|---|---|---|---|
| enableGazeAnalytics | Bool | false | Enable eye-tracking gaze metrics (visionOS only, requires entitlement). |
| enableDimensional | Bool | false | Enable scene understanding for dimensional placements (requires camera permission). |
| enableOcclusion | Bool | true | Hide dimensional ads behind real-world objects. |
| minPlaneArea | Float (m²) | 0.5 | Minimum plane area to consider for dimensional anchoring. |
| preferredSurface | SurfaceType | .any | Bias plane scoring toward a specific surface type. |
Swift API
| Symbol | Returns | Description |
|---|---|---|
| PrismAR.initialize(appId:environment:config:) | Void | Initialize the SDK. Call once at app launch before any ad requests. |
| PrismAdView(placementId:adSize:) | View | SwiftUI view that requests and renders an ad for the given placement. |
| PrismAR.addDimensionalPlacement(to:placementId:surfaceType:) | async Void | Attach a dimensional ad anchor to a RealityKit content object. |
| .onAdLoaded(_:) | View modifier | View modifier. Called with an Impression when an ad successfully renders. |
| .onAdFailed(_:) | View modifier | View modifier. Called with a PrismError when no ad is returned. |
| .onAdClicked(_:) | View modifier | View modifier. Called when the user taps or selects the ad. |
Kotlin API
| Symbol | Returns | Description |
|---|---|---|
| PrismAR.initialize(context, appId, environment, config) | Unit | Initialize the SDK. Call from Application.onCreate(). |
| PrismAdView(placementId, adSize, modifier, onAdLoaded, onAdFailed) | @Composable | Composable that requests and renders an ad. |
| PrismAR.dimensionalManager(activity, placementId, surfaceType) | DimensionalAdManager | Returns a DimensionalAdManager that manages AR lifecycle for dimensional ads. |
| DimensionalAdManager.resume() | Unit | Resume AR session. Call from Activity.onResume(). |
| DimensionalAdManager.pause() | Unit | Pause AR session. Call from Activity.onPause(). |
Enumerations
Environment
.production.testControls whether live or test ads are served. Use .test during development.
SurfaceType
.wall.floor.table.anySurface preference for dimensional placement scoring.
AdSize
.banner.mrec.fullPanel.videoOverlay ad size. Maps to standard IAB dimensions.