# reactjs-gyroscope

> Get gyroscope data with permission access

Latest version **1.1.1** (published 2023-03-11) · LGPL license · 0 weekly downloads

## Install

```sh
npm install reactjs-gyroscope
pnpm add reactjs-gyroscope
yarn add reactjs-gyroscope
bun add reactjs-gyroscope
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2023-03-11 |
| First published | 2023-03-11 |
| Weekly downloads | 0 |
| License | LGPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Batuhan Sahin |
| Maintainers | baturox |
| Keywords | react, gyroscope |

## Links

- npm: https://www.npmjs.com/package/reactjs-gyroscope
- Repository: https://github.com/baturox/reactjs-gyroscope
- Homepage: https://github.com/baturox/reactjs-gyroscope#readme
- Issues: https://github.com/baturox/reactjs-gyroscope/issues
- npm.io page: https://npm.io/package/reactjs-gyroscope

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2023-03-11
- 1.1.0 — 2023-03-11
- 1.0.9 — 2023-03-11
- 1.0.8 — 2023-03-11
- 1.0.7 — 2023-03-11
- 1.0.6 — 2023-03-11
- 1.0.5 — 2023-03-11
- 1.0.4 — 2023-03-11
- 1.0.3 — 2023-03-11
- 1.0.2 — 2023-03-11
- 1.0.1 — 2023-03-11

## README

# reactjs-gyroscope

This package allows to read gyroscope data [Gyroscope](https://developer.mozilla.org/en-US/docs/Web/API/Gyroscope).

## Installation
```sh
yarn add reactjs-gyroscope
```

## Usage

```jsx
import { useEffect, useState } from 'react'
import { getGyroscope, gyroscopePermission } from 'reactjs-gyroscope';

function App() {
  const [start, setStart] = useState(false);

  useEffect(() => {
    if (start) {
      getGyroscope((event) => {
        console.log(event)
      });
    }
  }, [start]);

  return (<>
    <button onClick={() => {
      gyroscopePermission().then(response => {
        if (response) {
          setStart(true);
        }
      });
    }}>Start</button>
  </>);
}

export default App;
```

## Notes

Needs permission for deviceorientation event.  (a.k.a. only using HTTPS).

## License

LGPL-3.0

---
_Source: https://npm.io/package/reactjs-gyroscope · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
