
Research
Node.js Fixes AsyncLocalStorage Crash Bug That Could Take Down Production Servers
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.
@vibe-kit/auth
Advanced tools
OAuth authentication utilities for VibeKit that work in both Node.js and browser environments.
OAuth authentication utilities for VibeKit that work in both Node.js and browser environments.
npm install @vibe-kit/auth
For Node.js applications (CLI tools, servers, etc.), use the Node.js-specific import:
import { ClaudeAuth } from '@vibe-kit/auth/node';
// Start OAuth flow (opens browser automatically)
const token = await ClaudeAuth.authenticate();
// Check if authenticated
const isAuthenticated = await ClaudeAuth.isAuthenticated();
// Get valid token (auto-refresh if needed)
const accessToken = await ClaudeAuth.getValidToken();
// Verify authentication
const isValid = await ClaudeAuth.verify();
// Get authentication status
const status = await ClaudeAuth.getStatus();
// Logout
await ClaudeAuth.logout();
For browser/web applications, use the browser-safe import:
import { ClaudeWebAuth, LocalStorageTokenStorage } from '@vibe-kit/auth/browser';
// OR use the default import which is browser-safe:
// import { ClaudeAuth, LocalStorageTokenStorage } from '@vibe-kit/auth';
// Create storage
const storage = new LocalStorageTokenStorage();
const auth = new ClaudeWebAuth(storage);
// Create authorization URL
const { url, state, codeVerifier } = ClaudeWebAuth.createAuthorizationUrl();
// Open URL in browser for user authentication
window.open(url, '_blank');
// After user authorizes and provides the code#state string:
const authCode = 'code123#state456'; // From user input
const token = await auth.authenticate(authCode, codeVerifier, state);
// Check authentication status
const isAuthenticated = await auth.isAuthenticated();
// Get valid token (auto-refresh if needed)
const accessToken = await auth.getValidToken();
The auth package is completely separate from the SDK. Get your token and pass it as the API key:
import { VibeKit } from '@vibe-kit/sdk';
import { ClaudeAuth } from '@vibe-kit/auth/node'; // For Node.js
// Authenticate and get token
let accessToken = await ClaudeAuth.getValidToken();
if (!accessToken) {
await ClaudeAuth.authenticate();
accessToken = await ClaudeAuth.getValidToken();
}
// Use token with VibeKit
const vibekit = new VibeKit();
const agent = await vibekit.withAgent("claude", {
providerApiKey: accessToken, // Pass OAuth token as API key
model: "claude-sonnet-4-20250514"
});
const result = await agent.generateCode("Create a hello world function");
For browser applications:
import { VibeKit } from '@vibe-kit/sdk';
import { ClaudeWebAuth, LocalStorageTokenStorage } from '@vibe-kit/auth/browser';
const storage = new LocalStorageTokenStorage();
const auth = new ClaudeWebAuth(storage);
// Get token (assumes user is already authenticated)
const accessToken = await auth.getValidToken();
if (!accessToken) {
// Handle authentication flow...
}
// Use with VibeKit
const vibekit = new VibeKit();
const agent = await vibekit.withAgent("claude", {
providerApiKey: accessToken,
model: "claude-sonnet-4-20250514"
});
import { ClaudeAuth } from '@vibe-kit/auth/node';
// Export token in different formats
const envToken = await ClaudeAuth.exportToken('env');
const jsonToken = await ClaudeAuth.exportToken('json');
const fullToken = await ClaudeAuth.exportToken('full');
// Import from various sources
await ClaudeAuth.importToken({ fromEnv: true });
await ClaudeAuth.importToken({ fromFile: './token.json' });
await ClaudeAuth.importToken({ refreshToken: 'your-refresh-token' });
interface OAuthToken {
access_token: string;
token_type: string;
expires_in?: number;
refresh_token?: string;
scope?: string;
created_at: number;
}
@vibe-kit/auth/node for full functionality including file system access and browser launching@vibe-kit/auth/browser or default import for browser-safe functionalityIf you were using the old unified import and experiencing browser compatibility issues:
// Old (caused browser compatibility issues)
import { ClaudeAuth } from '@vibe-kit/auth';
await ClaudeAuth.authenticate(); // Would fail in browser due to Node.js imports
// New - Node.js
import { ClaudeAuth } from '@vibe-kit/auth/node';
await ClaudeAuth.authenticate(); // Works in Node.js
// New - Browser
import { ClaudeWebAuth, LocalStorageTokenStorage } from '@vibe-kit/auth/browser';
const storage = new LocalStorageTokenStorage();
const auth = new ClaudeWebAuth(storage);
const { url, state, codeVerifier } = ClaudeWebAuth.createAuthorizationUrl();
// Handle authentication flow...
The auth package can be used independently for authentication:
// Node.js applications
import { authenticate, getValidToken } from '@vibe-kit/auth/node';
// Browser applications
import { ClaudeWebAuth } from '@vibe-kit/auth/browser';
Note: CLI authentication commands have been moved out of the main VibeKit CLI to keep packages separate and environment-specific.
FAQs
Universal OAuth authentication library for AI providers' MAX subscriptions. Currently supports Claude AI with Gemini, Grok, and ChatGPT Max coming soon.
The npm package @vibe-kit/auth receives a total of 11 weekly downloads. As such, @vibe-kit/auth popularity was classified as not popular.
We found that @vibe-kit/auth demonstrated a healthy version release cadence and project activity because the last version was released less than 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.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.