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

@mayurajs/auth-facebook

v1.2.0

Published

Facebook Login access tokens (checked with Facebook) and Limited Login tokens as Mayura server identities, and a preset for better-auth's Facebook sign-in.

Readme

@mayurajs/auth-facebook

Facebook sign-in for Mayura, on any runtime, with no dependency:

  • facebookAuthenticator: Facebook Login user access tokens sent straight to Mayura's server, checked with Facebook, and iOS Limited Login tokens, checked with Facebook's keys;
  • facebookSignIn: Facebook as a better-auth social login (with mayura/auth/better-auth), reading no more of the profile than signing in needs.
npm install mayura @mayurajs/auth-facebook
import { principalId } from 'mayura/auth';
import { facebookAuthenticator, facebookSignIn } from '@mayurajs/auth-facebook';

const authenticate = facebookAuthenticator({
  appId: process.env.FACEBOOK_APP_ID!,
  appSecret: process.env.FACEBOOK_APP_SECRET!,
  requiredScopes: ['email'],
  identity: session => ({
    principalId: principalId('facebook', session.userId),
    projectId: 'acme',
    agentIds: ['support'],
    capabilities: ['runs:submit', 'runs:read'],
  }),
});

// Or sign people in with better-auth:
// betterAuth({ socialProviders: { facebook: facebookSignIn({ clientId, clientSecret }) }, ... })
  • Access tokens are opaque, so each one is checked with Facebook's debug_token (Graph API v26.0 unless graphVersion), using your app's token (appId|appSecret, which never leaves your server and never appears in an error). A token passes only when Facebook says it is valid, a user's, for your app, unexpired, and holds every requiredScopes permission. That is a call to Facebook per request: cacheTtlMs (up to 5 minutes, 0 by default) keeps Facebook's answer for that long, so a token the user revokes then works for that long more. A call takes at most timeoutMs (5 s); when Facebook cannot answer, the server answers that authentication is unavailable.
  • Limited Login (with limitedLogin: true): iOS Limited Login tokens are OIDC JWTs, checked with no call per request: RS256 with Facebook's keys, issued by https://www.facebook.com, for your app. Check the token's nonce in your app, which made it.
  • What you get. identity receives kind (access_token or limited_login), userId (app-scoped: the same person has a different id in each of your apps), scopes, email and name (Limited Login), and expiresAtMs. Nothing is granted unless identity grants it.
  • facebookSignIn gives better-auth's socialProviders.facebook reading only id, name and email (picture if asked), with no permissions beyond better-auth's email and public_profile unless you add scopes.
  • Options: facebookAuthenticator({ appId, appSecret, identity, requiredScopes, limitedLogin, cacheTtlMs, timeoutMs, graphVersion, clockSkewMs, maxIdentityMs, fetch }), facebookSignIn({ clientId, clientSecret, picture, scopes }).

See Authentication and API keys. Apache-2.0.