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

@facilio/vibe-sdk

v0.1.5

Published

Browser SDK for Vibe — login/logout against Facilio identity-service, scoped to the vibe service.

Readme

@facilio/vibe-sdk

Browser SDK for Vibe. Wraps the Facilio identity-service redirect flow (?service=vibe) so product apps can drop in login() / logout() without re-implementing the dance.

The SDK is designed for the multi-tenant Vibe deployment, where every product subdomain routes to the same vibe-server, and /identity/* on that origin is served by a co-deployed identity-service. As a result there's no identity URL to configure — the SDK just talks to the current origin.

Install

npm i @facilio/vibe-sdk

Or via CDN in plain HTML:

<script src="https://unpkg.com/@facilio/vibe-sdk"></script>

Usage

Modern bundler (Vite / webpack / Next.js)

import { createVibe } from '@facilio/vibe-sdk';

const vibe = createVibe();   // serverURL defaults to window.location.origin

document.querySelector('#login')!.addEventListener('click',  () => vibe.login());
document.querySelector('#logout')!.addEventListener('click', () => vibe.logout());

const me = await vibe.getCurrentUser();  // null if not signed in
if (!me) vibe.login();

Plain HTML

<script src="https://unpkg.com/@facilio/vibe-sdk"></script>
<script>
  const vibe = VibeSDK.createVibe();
  document.getElementById('login').onclick  = () => vibe.login();
  document.getElementById('logout').onclick = () => vibe.logout();
</script>

API

createVibe(config?) / new Vibe(config?)

| Field | Type | Required | Default | Notes | |-------------|----------|----------|---------------------------|------------------------------------------------------------------------------------------------| | serverURL | string | no | window.location.origin | Override vibe-server base URL. Rarely needed — only for testing against a different env. | | service | string | no | 'vibe' | service= query param sent to identity-service. |

vibe.login(redirectTo?)

Redirects the browser to ${serverURL}/identity/login?service=vibe&redirect=.... After login, identity-service redirects back to redirectTo (defaults to window.location.href).

vibe.logout(redirectTo?)

Same shape as login, hits /identity/logout.

vibe.getCurrentUser<T>() : Promise<T | null>

GETs ${serverURL}/api/runtime/getCurrentUser with cookies. Returns null on 401.

vibe.isAuthenticated() : Promise<boolean>

Convenience wrapper around getCurrentUser.

vibe.fetch(path, init?) : Promise<Response>

Convenience fetch that auto-attaches credentials: 'include' and triggers login() on 401. Pass a relative path (/api/...) or full URL.

How it works

  1. login() / logout() window.location.assign() to ${serverURL}/identity/${action}?....
  2. Tomcat routes /identity/* to the co-deployed identity-service WAR.
  3. Identity-service authenticates the user, sets a session cookie on the current host, and redirects back to redirectTo.
  4. The session cookie is same-origin with vibe-server, so it auto-flows on vibe.fetch() / vibe.getCurrentUser() calls.

Server requirements

The vibe-server backing this SDK must:

  • Be deployed in a Tomcat that also hosts identity.war at the /identity context. (See vibe-server's Dockerfile / compile_copy.sh for the build recipe.)
  • Expose GET /api/runtime/getCurrentUser → user payload (200) or 401.

No CORS is required for the supported deployment model (SDK page and vibe-server share an origin).

Build

npm install
npm run build      # produces dist/ — ESM + CJS + IIFE + .d.ts
npm run dev        # watch mode
npm run typecheck  # tsc --noEmit