
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
firebase-auth-cfworkers
Advanced tools
Firebase/Admin Auth Javascript Library for Cloudflare Workers
npm i firebase-auth-cfworkers
Firebase tries to use the same method names and return values as the official Firebase/Admin SDK. Sometimes, the method signature are slightly different.
Create FirebaseAuth
import { FirebaseAuth } from 'firebase-auth-cfworkers';
const auth = new FirebaseAuth({
apiKey: 'Firebase api key',
projectId: 'Firebase project id',
privateKey: 'Firebase private key or service account private key',
serviceAccountEmail: 'Firebase service account email',
});
Sign-in with email/pass
//Sign in with username and password
const { token, user } = await auth.signInWithEmailAndPassword(
'my@email.com',
'supersecurepassword'
);
const userEmail = user.email;
const refreshToken = token.refreshToken;
Sign-up with email/pass
//Sign up with username and password
const { token, user } = await auth.signUpWithEmailAndPassword(
'my@email.com',
'supersecurepassword'
);
const userEmail = user.email;
const refreshToken = token.refreshToken;
Set Custom User Claims
//Set Custom User Claims
const res = await auth.setCustomUserClaims(uid,
{'admin':true}
);
Create session cookies
//Create a new session cookie from the user idToken
const { token, user } = await auth.signInWithEmailAndPassword(
'my@email.com',
'supersecurepassword'
);
const sessionCookie = await auth.createSessionCookie(token.idToken);
Verify session cookies
auth
.verifySessionCookie(sessionCookie)
.then((token) => useToken(token))
.catch((e) => console.log('Invalid session cookie'));
Cache OAuth tokens with CloudflareKv KV
import { FirebaseAuth, CloudflareKv } from 'firebase-auth-cfworkers';
const auth = new FirebaseAuth({
apiKey: 'Firebase api key',
projectId: 'Firebase project id',
privateKey: 'Firebase private key or service account private key',
serviceAccountEmail: 'Firebase service account email',
cache: new CloudflareKv(NAMESPACE),
});
FAQs
Firebase/Admin auth SDK for Cloudflare Workers
The npm package firebase-auth-cfworkers receives a total of 0 weekly downloads. As such, firebase-auth-cfworkers popularity was classified as not popular.
We found that firebase-auth-cfworkers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.