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

@blazeo.com/calendar-client

v1.0.56

Published

Blazeo Calendar / Appointment API client with MobX State Tree models

Readme

@blazeo.com/calendar-client

Private package – for Blazeo internal teams only. JavaScript client for the Blazeo Calendar / Appointment API. Use it in React (or any JS app) to call calendar and event endpoints via MobX State Tree models.

Install

From your npm registry (internal teams; ensure you're logged in to the scope):

npm install @blazeo.com/calendar-client

Or link locally:

cd calendar-client && npm run build && npm link
cd your-app && npm link @blazeo.com/calendar-client

Usage

Configure once at app startup, then use models and their methods:

import {
  configure,
  setAccessToken,
  setGetAccessToken,
  CalendarModel,
  createRootStore,
} from '@blazeo.com/calendar-client';

configure({
  baseUrl: 'https://your-appointment-api.example.com',
  consumer: 'my-app', // optional Consumer header
  accessToken: yourIdpAccessToken, // JWT from your identity provider
  expiresAtUtc: '2026-05-21T12:00:00Z', // optional — used before auto-refresh
  getAccessToken: async () => yourIdp.getAccessToken(), // optional refresh callback
});

// Calendar static methods (no store needed)
const timezones = await CalendarModel.getTimeZones();
const calendar = await CalendarModel.get('calendar-guid');

// Or use RootStore with models
const store = createRootStore();
const cal = store.addCalendar({ calendarId: 'my-cal', name: 'My Calendar' });
await cal.create(); // POST to backend

JWT authentication

The Appointment API validates Bearer JWTs from your identity provider (Authentication:Jwt:Authority on the server). This package does not exchange api keys for tokens — pass the JWT your app already has.

| Function | Purpose | |----------|---------| | setAccessToken(token, expiresAtUtc?) | Store JWT from your IdP | | setGetAccessToken(fn) | Async callback to refresh when missing/near expiry | | ensureValidAccessToken() | Resolve token before a request (uses callback if needed) | | clearAuth() | Clear token and refresh callback |

All reqGet / reqPost calls attach Authorization: Bearer … when a token is configured.

setAccessToken(session.accessToken, session.expiresAt);
setGetAccessToken(() => authService.acquireTokenSilent());
await LeadModel.requestExport('company-key', { userEmail: '[email protected]' });

API overview

  • CalendarModel (static): get, getByCompany, getTimeZones, getTimeZone, getParticipants, getMonth, getEvents, etc.
  • EventModel (instance): get, create, cancel, delete, getCancellable, getAvailability, setReminder
  • EventModel (static): get, cancel, delete, getCancellable, createEvent, reschedule, updateEvent, …
  • FlowModel: Same pattern as Calendar — FlowModel.create({}, { env }) with no fields; static get, getRaw, list, createFlow, updateFlow, delete, duplicate, appearance/embed/public/preview helpers; instance methods mirror those using flowId on the snapshot
  • LeadModel: LeadModel.create({}, { env }); static get, getRaw, getByEmail, getByPhone, getByCompany, saveColumnSelection, getColumnSelection, allowedColumns, requestExport; instance get, getByEmail, getByPhone, getByCompany, saveColumnSelection, getColumnSelection, requestLeadExport. Pass userId in getByCompany(companyKey, { userId }) to return only columns saved for that user. For requestExport, pass userEmail (or rely on JWT email claim) so the server can publish a NotificationGenerated message when export completes.
  • ParticipantModel: static get, getByEmail, getByIds, getAll, …; instance getByEmail uses email + companyKey on the snapshot (see GET /participant/getbyemail)
  • AuthModel (calendar OAuth / Connect Calendar): getCalendarProviders, getAuthorizationUrl, getAuthorizationStatus, openOAuthPopup, onCalendarAuthMessage — see Calendar authorization flow
  • RootStore: addCalendar, addEvent

Calendar authorization (direct UI)

When the user connects Google or Outlook from the Scheduling modal:

import {
  configure,
  AuthModel,
  CalendarEmailProvider,
  CALENDAR_AUTH_MESSAGE_TYPE,
} from '@blazeo.com/calendar-client';

configure({ baseUrl: 'https://your-appointment-api.example.com' });

const participantId = '...'; // logged-in participant GUID

// Optional: already connected?
const statusRes = await AuthModel.getAuthorizationStatus(participantId);
if (statusRes.status === 'success' && statusRes.data?.isAuthorized) {
  // show connected UI
}

// Load provider cards (Google / Gmail, Microsoft Outlook)
const providersRes = await AuthModel.getCalendarProviders();
const providers = providersRes.data; // [{ key: 'google', displayName: 'Google / Gmail', ... }, ...]

// User clicks Google
const urlRes = await AuthModel.getAuthorizationUrl(participantId, 'google');
const popup = AuthModel.openOAuthPopup(urlRes.data.authorizationUrl);

const unsubscribe = AuthModel.onCalendarAuthMessage(async (payload) => {
  if (payload.status === 'success') {
    const check = await AuthModel.getAuthorizationStatus(participantId);
    if (check.data?.isAuthorized) {
      // close modal, show success
    }
  }
});

// On modal unmount: unsubscribe(); popup?.close();

email_provider for getAuthorizationUrl: google, gmail, 1, outlook, microsoft, or 2.

All methods return Promise<{ status, data?, message? }>. Check response.status === 'success' and use response.data.

Samples

  • sample/ – Uses the package via file:.. for local development (run npm run build in parent first).
  • sample-npm/ – Uses the package from npm: npm i @blazeo.com/calendar-client. For testing the published package.