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. A string replaces the token. null omits the parameter; for GAM cust_params, only the containing pair is dropped and the key is omitted if no pair remains. For VAST, the whole cust_params parameter is omitted. undefined leaves an unresolved token literal and sends the parameter. DA-ASSET-MACRO-UNKNOWN reports unresolved built-in or registered macros; DA-ASSET-PARAMETER-OMITTED reports null omissions. 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).