owlet-client
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Owlet Client

Unofficial package for interacting with owlet's smart sock api. Note that this only works in the US. If you want to use this and are in a different country, create an issue and I will implement support for other regions.

Installation

yarn add owlet-api

Example Usage

In order for the authentication to work, the package expects two environment variables to be present: OWLET_EMAIL and OWLET_PASSWORD. The token returned from the authentication calls is valid for 24 hours.

  const token = await login();
  const devices = await getDevices(token);
  const sock = await getDeviceAsSmartSock(devices[0].device.dsn, token);
  console.log(sock);
  /* Prints:
    {
      baseStationOn: 0,
      batteryLevel: 94,
      chargeStatus: 0, // Is 1 if fully charged, 2 if charging
      heartRate: 124,
      movement: 0,
      oxygenLevel: 98
    }
  */
  await setBaseStationOn(true, sock, token);

Readme

Keywords

none

Package Sidebar

Install

npm i owlet-client

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

13.3 kB

Total Files

12

Last publish

Collaborators

  • hesto2-deploy