mirror of
https://github.com/HeyPuter/puter.git
synced 2026-09-30 00:56:50 +00:00
Puter.js
The official JavaScript SDK for Puter.com — Free, Serverless, Cloud and AI from the frontend code.
Installation (npm)
npm install @heyputer/puter.js
Importing
ES Modules
import '@heyputer/puter.js';
CommonJS
const puter = require('@heyputer/puter.js');
CDN
Include Puter.js directly in your HTML via CDN in the <head> section:
<script src="https://js.puter.com/v2/"></script>
Usage Example
After importing, you can use the global puter object:
// Print a message
puter.print('Hello from Puter.js!');
// Chat with GPT-5 nano
puter.ai.chat('What color was Napoleon\'s white horse?').then(response => {
puter.print(response);
});