Skip to content

Update ring-client-api to use v3 location/devices REST endpoints#1749

Open
tsightler wants to merge 1 commit into
dgreif:mainfrom
tsightler:v3_location_device_endpoints
Open

Update ring-client-api to use v3 location/devices REST endpoints#1749
tsightler wants to merge 1 commit into
dgreif:mainfrom
tsightler:v3_location_device_endpoints

Conversation

@tsightler

Copy link
Copy Markdown
Collaborator

This is the first in a series of PRs to bring ring-client-api on par with modern Ring API specs. While I have tested these changes with ring-mqtt, these are changes in core functions that have remained largely unchaged for many years so this PR has more risk than many.

This PR updates the Ring client library to use the latest REST API endpoints for location and device discovery. I've tried to keep the changes to the minimum and not break anything for API consumers. The new locations endpoint provides roughly the same information and format of the previous, however, the new devices endpoint is quite different.

I've tested this with my account which has the following devices:

Doorbell Pro
Floodlight (1st gen)
Stickup Cams (various)
Floodlight Pro
Chime
Alarm (1st gen) with many devices

The most likely risks to the change are around shared locations as there are some differences in how discovery of location devices works, but I don't have a shared account to test.

Important Note: This code was written 99% by Claude Code. I have manually reviewed the code, applying a few minor tweaks, mostly for style, and also performed manual functional testing.

@changeset-bot

changeset-bot Bot commented May 25, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f349b49

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes ring-client-api’s core discovery flow by switching location and device discovery to Ring’s newer location_info/v3 and device_info/v3 REST endpoints, aiming to preserve existing consumer-facing behavior while adapting to the new response shapes.

Changes:

  • Added deviceInfoApi() and locationInfoApi() URL helpers and corresponding base URLs in the REST client.
  • Updated RingApi.fetchRingDevices() to consume device_info/v3/devices and re-bucket devices into the library’s existing categories.
  • Expanded UserLocation typings to accommodate additional fields and updated coordinate value types from the new locations endpoint.
Show a summary per file
File Description
packages/ring-client-api/ring-types.ts Updates UserLocation type shape for v3 location payload compatibility.
packages/ring-client-api/rest-client.ts Adds v3 base URLs and helper functions for the new endpoints.
packages/ring-client-api/api.ts Switches device + location discovery to v3 endpoints and updates device classification logic.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 1

Comment on lines +129 to +132
for (const device of devices) {
const kind = device.kind as string

if (doorbellKinds.has(kind)) {

@tbaron tbaron left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making these changes! Did you find any documentation for the v3 APIs, or were these changes reverse engineered? I didn't see them in the official docs.

Comment on lines +51 to +60
const doorbellKinds: Set<string> = new Set(
Object.values(RingCameraKind).filter(
(k) =>
k.startsWith('doorbot') ||
k.startsWith('doorbell') ||
k.startsWith('lpd_') ||
k.startsWith('jbox_') ||
k.startsWith('cocoa_doorbell'),
),
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be cleaner to encapsulate in an exported predicate in ring-types.ts, similar to isWebSocketSupportedAsset that's already implemented there. If placed in proximity to the RingCameraKind type, it would also improve maintenance discoverability. E.g.,

export type RingCameraKind = ...

export function isDoorbellKind({ kind }: { kind: RingCameraKind }) {
    return kind && (kind.startsWith( ... ) || ... );
}

Or more tersely with a bound regex .test():

export const isDoorbellKind =
RegExp.prototype.test.bind(/^(?:(cocoa_)?doorb(ell|ot)|lpd_|jbox_)/) as
(kind: RingCameraKind) => boolean

Comment on lines 57 to 59
export function deviceApi(path: string) {
return deviceApiBaseUrl + path
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the remaining /devices/v1/ usages be deprecated in favor of /device_info/v3/?

Comment on lines +440 to +445
operation_set?: string
entitlements?: {
business_command_center?: boolean
business_role_management?: boolean
vm_virtual_security_guard?: boolean
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious - why are these required for the broader change? Could the type spec be generalized to allow flexible parsing of future changes (e.g., key-value map)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants