OptiView Ads SDK
    Preparing search index...

    Interface SessionConfig

    Per-session configuration passed to startSession(); changes per piece of content.

    interface SessionConfig {
        adInsertionType?: AdInsertionType;
        assetParameterMacros?: AssetParameterMacros;
        assetParameters?: Record<string, string>;
        manifestUrl: string;
    }
    Index
    adInsertionType?: AdInsertionType

    Ad insertion type for this content — how breaks relate to the content timeline (DAR vs DAI). replacement replaces a content window; insertion inserts the break and resumes at the exact pre-break position. When omitted, the manifest's resumeOffset drives the resume point. SGAI only — ignored in SSAI mode (the stitcher controls insertion, surfaced via a DA-INSERTION-TYPE-IGNORED-SSAI diagnostic).

    AdInsertionType

    assetParameterMacros?: AssetParameterMacros

    Customer macros for the $NAME$ tokens in asset-parameter values — a fixed string or a zero-argument callback per macro name, e.g. { '$CUSTOM_TEAM$': () => currentTeam() }. Every $NAME$ token inside a manifest / session / update value is replaced when the ad request is built, so "$OPTIVIEW_PLAYER_WIDTH$x$OPTIVIEW_PLAYER_HEIGHT$" becomes "1920x1080". Customer macros are consulted before the built-in $OPTIVIEW_* set, so a built-in can be overridden. $OPTIVIEW_* and registered customer macros without values stay literal; the parameter is sent and DA-ASSET-MACRO-UNKNOWN is raised once per key/macro (context: key, macro). Other unresolved $NAME$ tokens stay literal without a diagnostic. $ without a closing $ is unchanged. Callbacks are evaluated per ad request and cleared when the session ends. Session-scoped parameters are sent to IMA DAI with built-in and customer macros resolved; break-duration macros are omitted.

    OPTIVIEW_ASSET_PARAMETER_MACROS

    assetParameters?: Record<string, string>

    Ad parameters for this session (for GAM: IMA adTagParameters). Per-key precedence is SessionConfig, updateAssetParameters(), manifest session parameters, then asset parameters.

    updateAssetParameters

    manifestUrl: string

    Full break-manifest URL. The SDK fetches exactly this URL and never rewrites it (proxied, signed or opaque endpoints all work).