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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@letsparky/api-v2-client

v1.0.7

Published

TypeScript client for the LetsParky API V2

Readme

Letsparky API V2 Client

TypeScript toolkit for working with the Letsparky API v2. It wraps every published endpoint with typed helpers, sensible validation, and Node/Browser support.

Installation

npm i @letsparky/api-v2-client

Quick Start

import LetsParkyClient, { Environment } from '@letsparky/api-v2-client';

const client = new LetsParkyClient({
  apiKey: process.env.LETSPARKY_API_KEY!,
  environment: Environment.PRODUCTION,
});

const profile = await client.getProfile();
console.log(`Hello ${profile.first_name}!`);

Authentication

  • API key: pass apiKey as shown above.
  • Email/password: provide email & password and the client will authenticate automatically (client.authenticate() is also available).

Usage Examples

Devices

// List paginated devices
const devicePage = await client.devices.listPaginated({ page: 1, limit: 20 });

// Search public catalogue by coordinates (GET /devices/search/location)
const search = await client.devices.searchByLocation({ lat: 40.74, lng: -73.99, radius: 750 });
console.log(`Found ${search.data.total} devices in range`);

// Attach device to a parking area
await client.devices.assignToParkingArea(devicePage.data[0].id, {
  parking_area_id: '9b1a6c89-5ddf-4e80-91f0-e3b46c379999',
  association_type: 'ENTRY',
});

// Unblock a device
await client.devices.unblock(device_id)

Parking Areas

// List areas visible to the current user
const areasResponse = await client.parkingAreas.list({ page: 1, limit: 10 });
const names = areasResponse.data.data.map((area) => area.name);

// Create a new area (POST /parking-areas)
const created = await client.parkingAreas.create({
  name: 'Downtown Garage - Level 3',
  type: 'AREA',
  total_spots: 120,
  is_public: false,
});
console.log(created.data.id);

Device Logs & Monitoring

const deviceSnapshot = await client.devices.listPaginated({ page: 1, limit: 1 });
const [firstDevice] = deviceSnapshot.data;
if (!firstDevice) throw new Error('No devices available');

const logs = await client.deviceLogs.list({ device_id: firstDevice.id, limit: 50 });
console.log(`Fetched ${logs.data.pagination.total} log entries`);

const analytics = await client.deviceLogs.getAnalytics(firstDevice.id, {
  start_time: new Date(Date.now() - 7 * 86400000).toISOString(),
  end_time: new Date().toISOString(),
});

Payments & Memberships

const payments = await client.payments.list({ status: 'CAPTURED', limit: 10 });
const publicMemberships = await client.memberships.getPublic({ page: 1, limit: 5 });

License

ISC