Recipes

Build specific Puter.js features with recipes from Puter and the community.

Store Data
Learn how to store data in the Puter.js key-value database. Every entry lives inside the user's own Puter account.
Key-ValueAuthData Modeling
Store Files
Learn how to store binary files in Puter.js object storage. Every file lives inside the user's own Puter account.
File SystemAuth
Add Counters
Learn how to add counters to your app with Puter.js that stay accurate even when many updates happen at once.
Key-Value
Store Temporary Data
Learn how to store data that deletes itself after a set time with Puter.js, so your app needs no cleanup code.
Key-ValuePerformance
Store a Small List
Learn how to keep a list in one Puter.js key-value entry, so your app loads it with a single read and edits any item in place. It fits a few thousand small items.
Key-ValueData Modeling
Save User Settings
Learn how to save user settings with Puter.js so they follow the user to every device, with defaults and per-setting resets.
Key-ValueData Modeling
Run Code Only Once
Learn how to make sure something runs only once with Puter.js, even when two tabs or requests try it at the same time.
Key-ValueWorkers
Ask for Access
Learn how to request permissions with Puter.js to let your app use the user's folders, apps, subdomains and email address.
PermissionsAuth
Ask for Access to Multiple Resources
Learn how to request permission for multiple Puter resources at once, so users approve everything your app needs in a single prompt.
PermissionsAuth
Share Data Between Apps
Learn how to let one Puter.js app read and write another app's key-value data with the user's permission, and how to keep some entries private.
Key-ValuePermissions
Store Items by ID
Learn how to keep a list in one Puter.js key-value entry with each item stored under a unique ID, so you can edit or delete any item by its ID. It fits a few thousand small items.
Key-ValueData Modeling
Store a Set of Unique Values
Learn how to store a set of unique values, like liked posts or tags, in one Puter.js key-value entry so nothing gets added twice.
Key-ValueData Modeling
Build a Shopping Cart
Learn how to build a shopping cart with Puter.js that keeps the right quantities across tabs and clears itself when abandoned.
Key-ValueData Modeling
Store a Large Collection
Learn how to store a large collection of data in the Puter.js key-value database. It fits any number of records and you can read or change one at a time.
Key-ValueData ModelingPerformance
Split a Large Value Across Keys
Learn how to split a growing value, like a chat history, across several Puter.js key-value entries, and why large entries cost more.
Key-ValueData ModelingPerformance
Export or Delete Data
Learn how to let users export, import and delete their data in the Puter.js key-value database.
Key-ValueData Modeling
Query a Collection
Learn how to perform queries on a collection of records in the Puter.js key-value database.
Key-ValueData ModelingPerformance
Keep a Version History
Learn how to save every version of a document with Puter.js so users can look back and restore an older one.
Key-ValueData Modeling
Keep an Index in Sync
Learn how to look up records by more than one field in the Puter.js key-value database, and keep those extra keys up to date.
Key-ValueData ModelingPerformance
Build an API with a Worker
Learn how to build a backend API for your app with Puter.js serverless workers.
WorkersKey-ValueAuth
Add a Contact Form
Learn how to add a contact form to your app or website with Puter.js, so every message a visitor sends lands in your email inbox.
WorkersEmail
Store Server-Side Data
Learn how to store data that every user of your app can read and update, instead of each user only accessing their own storage.
WorkersKey-ValueAuth
Handle Errors in a Worker
Learn how to handle errors in a Puter.js serverless worker, so your app can show users what went wrong.
Workers
Deploy Workers Programmatically
Learn how to deploy serverless workers from your app with Puter.js, so each user or project gets its own backend.
Workers
Keep an API Key Secret
Learn how to call a third-party API from your app without exposing its API key, by keeping the key in a Puter.js serverless worker.
WorkersKey-ValueAuth
Add a Backend to Your Website
Learn how to add a backend to a website hosted on Puter, so the site can save data and run code on the server without a separate deploy.
WorkersHosting
Share a File
Learn how to add file sharing to your app with Puter.js, so users can share files in their Puter account with other people.
File SystemAuth
Work With a Large Directory
Learn how to list a directory with thousands of files in Puter.js, so your app can load and show it one page at a time.
File SystemPerformance
Host Files Online
Learn how to host files from the user's Puter filesystem online and give them a public URL that anyone can open.
File SystemHosting
Add Website Publishing
Learn how to let users publish websites from your app with Puter.js.
HostingFile System
Manage Websites
Learn how to list, look up, repoint and delete the websites your app has published with Puter.js.
Hosting
Build a Multi-Page Website
Learn how to publish a website with several pages, a shared assets folder and a custom 404 page with Puter.js, with links that work on every page.
HostingFile System
Add Team Support
Learn how to add team support with Puter.js, so your app can get the user's team and its members.
TeamsAuth
Share a File with a Team
Learn how to share files with a user's team using Puter.js, so colleagues can open them without anyone typing a username.
TeamsFile SystemAuth
Add a Team Admin Page
Learn how to check if a user owns their team with Puter.js, so your app can show an admin page to the team owner only.
TeamsAuth