Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The XRReferenceSpaceEventInit dictionary is used when calling the XRReferenceSpaceEvent() constructor to provide the values for its properties. Since the properties are read-only, this is the only opportunity available to set their values.

You will not usually need to use this, since these events are created by the WebXR infrastructure.


The XRReferenceSpace from which the event originated.
An XRRigidTransform which maps the old coordinate system (from before the changes indicated by this event) to the new coordiante system.

Usage notes

All of this dictionary's properties must have valid values set on them before calling the XRReferenceSpaceEvent() constructor.


This simple snippet calls the constructor to create a new reference space event of type reset.

let refSpaceEvent = new XRReferenceSpaceEvent("reset", {
      referenceSpace: myRefSpace,
      transform: myTransform


Specification Status Comment
WebXR Device API
The definition of 'XRReferenceSpaceEventInit' in that specification.
Working Draft Initial definition.

Browser compatibility

No compatibility data found. Please contribute data for "api.XRReferenceSpaceEventInit" (depth: 1) to the MDN compatibility data repository.