Prism ARDocsGet the SDK
ReferenceSDK API Reference

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.

PropertyTypeDefaultDescription
enableGazeAnalyticsBoolfalseEnable eye-tracking gaze metrics (visionOS only, requires entitlement).
enableDimensionalBoolfalseEnable scene understanding for dimensional placements (requires camera permission).
enableOcclusionBooltrueHide dimensional ads behind real-world objects.
minPlaneAreaFloat (m²)0.5Minimum plane area to consider for dimensional anchoring.
preferredSurfaceSurfaceType.anyBias plane scoring toward a specific surface type.

Swift API

SymbolReturnsDescription
PrismAR.initialize(appId:environment:config:)VoidInitialize the SDK. Call once at app launch before any ad requests.
PrismAdView(placementId:adSize:)ViewSwiftUI view that requests and renders an ad for the given placement.
PrismAR.addDimensionalPlacement(to:placementId:surfaceType:)async VoidAttach a dimensional ad anchor to a RealityKit content object.
.onAdLoaded(_:)View modifierView modifier. Called with an Impression when an ad successfully renders.
.onAdFailed(_:)View modifierView modifier. Called with a PrismError when no ad is returned.
.onAdClicked(_:)View modifierView modifier. Called when the user taps or selects the ad.

Kotlin API

SymbolReturnsDescription
PrismAR.initialize(context, appId, environment, config)UnitInitialize the SDK. Call from Application.onCreate().
PrismAdView(placementId, adSize, modifier, onAdLoaded, onAdFailed)@ComposableComposable that requests and renders an ad.
PrismAR.dimensionalManager(activity, placementId, surfaceType)DimensionalAdManagerReturns a DimensionalAdManager that manages AR lifecycle for dimensional ads.
DimensionalAdManager.resume()UnitResume AR session. Call from Activity.onResume().
DimensionalAdManager.pause()UnitPause AR session. Call from Activity.onPause().

Enumerations

Environment
.production.test

Controls whether live or test ads are served. Use .test during development.

SurfaceType
.wall.floor.table.any

Surface preference for dimensional placement scoring.

AdSize
.banner.mrec.fullPanel.video

Overlay ad size. Maps to standard IAB dimensions.