Browser-Based Auth Has Arrived to Puter.js Node Integration
We're happy to announce that browser-based authentication is now available in the Puter.js Node integration.
This means you no longer need to explicitly set up or pass an auth token when using Puter.js in Node.js. Simply call the new getAuthToken() function and it will handle the authentication for you.
How It Works
When you call getAuthToken(), it opens a browser window and asks you (or users of your app) to log in to Puter. Once authenticated, you get back an authToken which can then be used to initialize Puter.js:
import { init, getAuthToken } from "@heyputer/puter.js/src/init.cjs";
const authToken = await getAuthToken(); // opens browser for login
const puter = init(authToken);
// You're ready to go!
puter.ai.chat("What is the meaning of life?").then(console.log);
No more manually copying tokens or setting up environment variables — just run your script and authenticate through the browser.
Build CLI Tools with Puter.js
With browser-based auth, building terminal apps, CLI tools, and scripts with Puter.js is now easier than ever. Your users can simply run your app and authenticate through their browser, no setup required.
Get started with Puter.js today, and build powerful Node.js applications with browser-based auth!
Related:
Free, Serverless AI and Cloud
Start creating powerful web applications with Puter.js in seconds!
Get Started Now