npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

arlo-api

v1.0.11

Published

Thin API for interacting with Arlo

Downloads

129

Readme

arlo-api

CircleCI

Thin API for interacting with Arlo

Usage

import { Basestation } from './basestation';

const arlo = new Client(config);

// `result` contains necessary information to make further requests
// allowing you to consume just the login result in your library.
const result = await arlo.login();

// Now that arlo has been logged in get the device matching type basestation.
const device = await arlo.getDevice({ deviceType: 'basestation' });

// Construct a new basestation object using our arlo client and the the basestation device.
const basestation = new Basestation(arlo, device);

// Setup event listeners.
basestation.on(ARLO_EVENTS.open, () => {});

basestation.on(ARLO_EVENTS.close, () => {});

// Start event stream.
await basestation.startStream();

Authentication

Currently, email is the only supported MFA method. Caveat I've only tested with Gmail. The library will mark Arlo OTP emails has read. A future release will allow deletion based on a configuration value.

Configuration

{
  arloUser: '[email protected]',
  arloPassword: 'super secret password',
  emailUser: '[email protected]',
  emailPassword: 'another secret password',
  emailServer: 'imap.gmail.com',
  emailImapPort: 993
}

The emailUser must match one of the configured MFA sources in Arlo.

Gmail

Gmail has certain limitations when trying to connect from a third party app using just username and password. As of May 2022 Google blocked "less secure apps" from accessing their email services. You have to manually opt in and then set up a separate password for a third party. Additionally, you must enable IMAP in Gmail.

Tests

Tests make use of dotenv package for providing environment variables to the running process.

Create a .env file at the root of the solution and supply it with whatever your secrets are.

ARLO_USER="[email protected]"
ARLO_PASSWORD="password"
EMAIL_USER="[email protected]"
EMAIL_PASSWORD="password2"

You can also skip the login flow if you've already received a login result object and instead use the following secrets.

SERIAL_NUMBER="serial"
SESSION_EXPIRES="session_expiration"
TOKEN="token"
USER_ID="userId"

And then use the provided _shortCircuitLogin method.

const arlo = new Client(config);

const loginResult: LoginResult = {
  serialNumber: process.env.SERIAL_NUMBER as string,
  sessionExpires: Number.parseInt(process.env.SESSION_EXPIRES as string),
  token: process.env.TOKEN as string,
  userId: process.env.USER_ID as string,
};

arlo._shortCircuitLogin(loginResult);

References

Based on JOHNEPPILLAR's and easton36's great work.