diff --git a/src/docs/src/getting-started.md b/src/docs/src/getting-started.md index 3e0dd24f2..f04b7255c 100755 --- a/src/docs/src/getting-started.md +++ b/src/docs/src/getting-started.md @@ -35,6 +35,8 @@ puter.ai.chat(`Why did the chicken cross the road?`).then(console.log); #### Use in Node.js +Initialize Puter.js with your auth token using the `init` function: + ```js import { init } from "@heyputer/puter.js/src/init.cjs"; const puter = init(process.env.puterAuthToken); @@ -43,6 +45,15 @@ const puter = init(process.env.puterAuthToken); puter.ai.chat("What color was Napoleon's white horse?").then(console.log); ``` +If your environment has browser access, you can obtain a token via browser login: + +```js +import { init, getAuthToken } from "@heyputer/puter.js/src/init.cjs"; + +const authToken = await getAuthToken(); // performs browser based auth +const puter = init(authToken); +``` +
diff --git a/src/docs/src/supported-platforms.md b/src/docs/src/supported-platforms.md index 56f04f2d7..ec1b5117f 100644 --- a/src/docs/src/supported-platforms.md +++ b/src/docs/src/supported-platforms.md @@ -87,8 +87,6 @@ The Puter ecosystem hosts over 60,000 live applications, from essential tools li ## **Node.js** -> **Note:** Node.js support is currently in beta. - Puter.js works seamlessly in Node.js environments, allowing you to integrate AI, databases, and cloud storage with your Node.js applications. This makes it ideal for building backend services and APIs, performing server-side data processing, or creating CLI tools and automation scripts. ```js @@ -106,6 +104,8 @@ puter.ai.chat("What color was Napoleon's white horse?").then((response) => { Get started quickly with the [Node.js + Express template](https://github.com/HeyPuter/node.js-express.js). +
If your environment has browser access (e.g. CLI tools), you can use getAuthToken() to obtain a token via web-based login.
+ ## **Serverless Workers** [Serverless Workers](/Workers/) let you run HTTP servers and backend APIs.