Files
puter/src/puter-js

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 puter from '@heyputer/puterjs';

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

// 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);
});

Documentation & Community