files/en-us/web/api/deviceorientationevent/index.md
{{apiref("Device Orientation Events")}}{{securecontext_header}}
The DeviceOrientationEvent interface of the {{domxref("Device Orientation Events", "", "", "nocode")}} provides web developers with information from the physical orientation of the device running the web page.
{{InheritanceDiagram}}
DeviceOrientationEvent."granted" or "denied".DeviceOrientationEvent.webkitCompassHeading {{Non-Standard_Inline}} {{ReadOnlyInline}}
DeviceOrientationEvent.webkitCompassAccuracy {{Non-Standard_Inline}} {{ReadOnlyInline}}
window.addEventListener("deviceorientation", (event) => {
console.log(`${event.alpha} : ${event.beta} : ${event.gamma}`);
});
{{Specifications}}
{{Compat}}