XRSessionInit

Draft
This page is not complete.

The WebXR Device API dictionary XRSessionInit specifies required and/or optional features when requesting a new XRSession by calling the XR.requestSession() method.

Properties

The following parameters are all optional. If none are included, the device will use default settings for all options.

optionalFeatures Optional
An array of values identifying features which the returned XRSession may optionally support. At this time, all features are identified using strings from the XRReferenceSpaceType enumeration, but future updates to the WebXR standard may expand this.
requiredFeatures Optional
An array of values which the returned XRSession must support. These values currently must come from the enumerated type XRReferenceSpaceType.

Default options

Immersive sessions

All immersive (both immersive-vr and immersive-ar)  sessions support both the viewer and local reference spaces.

Because immersive sessions are required to support the local reference space, any request to open an immersive XRSession is required to obtain explicit or implicit user consent.

Inline sessions

All inline WebXR sessions support the viewer reference space.

Security requirements

Each reference space or feature type has minimum safety requirements. By session type, those are:

Reference space type User consent rquirement Feature policy requirement
bounded-floor Always required xr-spatial-tracking
local Always required for inline sessions xr-spatial-tracking
local-floor Always required xr-spatial-tracking
unbounded Always required xr-spatial-tracking
viewer Always required

See also