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

@frenchbaas/js

v0.1.1

Published

SDK JavaScript officiel pour FrenchBaas

Readme

@frenchbaas/js

SDK JavaScript officiel pour FrenchBaas — le BaaS français.

Installation

npm install @frenchbaas/js

Démarrage rapide

import { FrenchBaas } from '@frenchbaas/js'

const client = new FrenchBaas({
  url:    'https://app.frenchbaas.com',
  apiKey: 'votre-clé-api',
})

Auth

// Inscription
const { user } = await client.auth.signUp({ email: '[email protected]', password: 'secret' })

// Connexion
const { user } = await client.auth.login({ email: '[email protected]', password: 'secret' })

// Déconnexion
await client.auth.logout()

// État
client.auth.getUser()     // { id, email } | null
client.auth.isLoggedIn()  // boolean

Collections (documents)

const col = client.collection('collection-uuid')

// Lire (paginé)
const { data, meta } = await col.get({ page: 1, perPage: 20 })

// Créer
const doc = await col.create({ title: 'Hello', published: true })

// Mettre à jour
const doc = await col.update('doc-id', { title: 'Modifié' })

// Supprimer
await col.delete('doc-id')

// Schéma de la collection
const schema = await col.schema()

Gestion des erreurs

import {
  AuthError,
  ValidationError,
  NotFoundError,
  QuotaError,
  RateLimitError,
  NetworkError,
  ServerError,
} from '@frenchbaas/js'

try {
  await client.collection('col-id').create({ title: 'Test' })
} catch (e) {
  if (e instanceof AuthError)       console.error('Non connecté ou session expirée')
  if (e instanceof ValidationError) console.error('Données invalides', e.errors)
  if (e instanceof NotFoundError)   console.error('Introuvable')
  if (e instanceof QuotaError)      console.error('Quota dépassé')
  if (e instanceof RateLimitError)  console.error('Trop de requêtes, réessayez dans quelques instants')
  if (e instanceof NetworkError)    console.error('Hors ligne')
  if (e instanceof ServerError)     console.error('Erreur interne du serveur')
}

Options

// Persister la session dans localStorage (rechargement de page)
const client = new FrenchBaas({
  url:     'https://app.frenchbaas.com',
  apiKey:  'votre-clé-api',
  storage: 'localStorage', // défaut : 'memory'
})

Fonctionnalités automatiques

  • Refresh token transparent — access token rafraîchi automatiquement avant expiration
  • Retry sur 401 — relance la requête après refresh sans intervention du développeur
  • Déduplication — plusieurs requêtes simultanées ne déclenchent qu'un seul refresh
  • Erreurs typées — chaque erreur HTTP a sa classe TypeScript dédiée
  • Zero dépendance — aucune dépendance runtime
  • TypeScript — types inclus

License

MIT

frenchbaas-js