diff --git a/src/puter-js/README.md b/src/puter-js/README.md index 8d018d57..0ebc8964 100644 --- a/src/puter-js/README.md +++ b/src/puter-js/README.md @@ -1,29 +1,43 @@ -# Puter.js +

Puter.js

-The official JavaScript SDK for [Puter.com](https://puter.com) — Free, Serverless, Cloud and AI from the frontend code. +

The official JavaScript SDK for Puter.com

+

Free, Serverless, Cloud and AI from the frontend code.

---- +

+ Learn More + · + Docs + · + Tutorials + · + Examples + · + X +

-## Installation (npm) +
+ +## Installation + + +### NPM: ```sh npm install @heyputer/puter.js ``` -### Importing +### CDN: -### Node.js (with Auth Token) +Include Puter.js directly in your HTML via CDN in the `` section: -```js -const {init} = require("@heyputer/puter.js/src/init.cjs"); // NODE JS ONLY -// or -import {init} from "@heyputer/puter.js/src/init.cjs"; - -const puter = init(process.env.puterAuthToken); // uses your auth token -const puter2 = init(process.env.puterAuthToken2); // use some other auth token +```html + ``` +
-### Browser (without Auth Token) +## Usage + +### Browser #### ES Modules @@ -45,14 +59,19 @@ const puter = require('@heyputer/puter.js'); require('@heyputer/puter.js'); // puter will be available globally ``` -#### CDN +### Node.js (with Auth Token) -Include Puter.js directly in your HTML via CDN in the `` section: +```js +const {init} = require("@heyputer/puter.js/src/init.cjs"); // NODE JS ONLY +// or +import {init} from "@heyputer/puter.js/src/init.cjs"; -```html - +const puter = init(process.env.puterAuthToken); // uses your auth token +const puter2 = init(process.env.puterAuthToken2); // use some other auth token ``` +
+ ## Usage Example After importing, you can use the global `puter` object: @@ -67,7 +86,7 @@ puter.ai.chat('What color was Napoleon\'s white horse?').then(response => { }); ``` ---- +
## Documentation & Community @@ -77,4 +96,8 @@ puter.ai.chat('What color was Napoleon\'s white horse?').then(response => { - [Puter.com](https://puter.com) - [Discord](https://discord.com/invite/PQcx7Teh8u) - [Reddit](https://reddit.com/r/puter) -- [X (Twitter)](https://twitter.com/HeyPuter) \ No newline at end of file +- [X (Twitter)](https://twitter.com/HeyPuter) + +## License + +Apache-2.0 \ No newline at end of file