---
title: DeviceMotion
description: A library that provides access to a device's motion and orientation sensors.
sourceCodeUrl: https://github.com/expo/expo/tree/sdk-53/packages/expo-sensors
packageName: expo-sensors
iconUrl: /static/images/packages/expo-sensors.png
platforms: ["android", "ios", "web"]
---
import {
ConfigReactNative,
ConfigPluginExample,
ConfigPluginProperties,
} from '~/ui/components/ConfigSection';
`DeviceMotion` from `expo-sensors` provides access to the device motion and orientation sensors. All data is presented in terms of three axes that run through a device. According to portrait orientation: X runs from left to right, Y from bottom to top and Z perpendicularly through the screen from back to front.
## Installation
## Configuration in app config
You can configure `DeviceMotion` from `expo-sensor` using its built-in [config plugin](/config-plugins/introduction/) if you use config plugins in your project ([EAS Build](/build/introduction) or `npx expo run:[android|ios]`). The plugin allows you to configure various properties that cannot be set at runtime and require building a new app binary to take effect.
```json app.json
{
"expo": {
"plugins": [
[
"expo-sensors",
{
"motionPermission": "Allow $(PRODUCT_NAME) to access your device motion."
}
]
]
}
}
```
If you're not using Continuous Native Generation ([CNG](/workflow/continuous-native-generation/)) or you're using native **ios** project manually, then you need to configure `NSMotionUsageDescription` key in your native project to access `DeviceMotion` stats:
```xml ios/[app]/Info.plist
<key>NSMotionUsageDescription</key>
<string>Allow $(PRODUCT_NAME) to access your device motion</string>
```
## API
```js
```
## Permissions
### iOS
The following usage description keys are used by this library: