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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bailaya/core

v1.3.1

Published

A TypeScript client for accessing the BailaYa public API

Readme

@bailaya/core

A TypeScript client for accessing the BailaYa public API

Overview

This package provides an easy-to-use wrapper around the BailaYa API, allowing developers to fetch studio profiles, instructors, classes, and more with TypeScript support and built-in parsing.

Features

  • Type-safe API responses
  • Automatic date parsing
  • Optional studio ID configuration
  • Graceful JSON fallback
  • Supports querying by date and class type

Installation

npm install @bailaya/core

or with Yarn:

yarn add @bailaya/core

Usage

Basic Setup

import { BailayaClient } from '@bailaya/core';

const client = new BailayaClient({
  studioId: 'your-studio-id', // Optional: can be set per call, or in environment variable `BAILAYA_STUDIO_ID`
});

Get Studio Profile

const profile = await client.getStudioProfile();
console.log(profile.name);

Get User Profile

const user = await client.getUserProfile('user-123');
console.log(user.bio.en);

Get Instructors

const instructors = await client.getInstructors();
instructors.forEach(instr => console.log(instr.name));

Get Upcoming Classes

const classes = await client.getClasses(new Date());

Get Classes by Dance Type

const bachataClasses = await client.getClassesByType('bachata', new Date());

API Reference

new BailayaClient(options)

Creates a new instance of the client.

Parameters:

  • options.baseUrl?: string(Optional) Custom API base URL. Defaults to the official BailaYa API endpoint.
  • options.studioId?: string(Optional) Default studio ID used for methods that require it.

getStudioProfile(overrideId?: string): Promise<StudioProfile>

Fetches a single studio's profile, including metadata and supported dance types.

Parameters:

  • overrideId?: string(Optional) Overrides the default studio ID.

Returns:

  • A Promise that resolves to a StudioProfile object with fields such as name, description, address, businessHours, and more.

getUserProfile(userId: string): Promise<UserProfile>

Fetches a specific user's profile, including their bio, image, and dance specialities.

Parameters:

  • userId: string — The unique ID of the user to retrieve.

Returns:

  • A Promise that resolves to a UserProfile object.

getInstructors(overrideId?: string): Promise<Instructor[]>

Retrieves all instructors linked to a studio.

Parameters:

  • overrideId?: string(Optional) Overrides the default studio ID.

Returns:

  • A Promise that resolves to an array of Instructor objects with parsed bio fields.

getClasses(from?: Date, overrideId?: string): Promise<StudioClass[]>

Fetches all upcoming classes in a 7-day window, starting from the given date.

Parameters:

  • from?: Date(Optional) Starting date for the 7-day window. Defaults to today.
  • overrideId?: string(Optional) Overrides the default studio ID.

Returns:

  • A Promise that resolves to an array of StudioClass objects. Dates are parsed as Date instances.

getClassesByType(typeName: string, from?: Date, overrideId?: string): Promise<StudioClass[]>

Fetches upcoming classes for a specific dance type (e.g., "Salsa", "Bachata") within a 7-day window.

Parameters:

  • typeName: string — Name of the dance type to filter classes by.
  • from?: Date(Optional) Starting date for the 7-day window. Defaults to today.
  • overrideId?: string(Optional) Overrides the default studio ID.

Returns:

  • A Promise that resolves to an array of filtered StudioClass objects.

Types

All responses conform to typed interfaces like StudioProfile, Instructor, UserProfile, and StudioClass, defined in the types export.

License

ISC