Recipes

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

Store Data
Learn how to save and load your app's data with Puter.js, stored in each 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 the user updates them from several tabs 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 store a list of up to a few thousand small items with Puter.js, so your app loads it in one read and edits any item in place.
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
Share a List With Someone
Learn how to let users share a list in your app with another Puter user, so both of them can add, change and check off items.
Key-ValuePermissions
Let Someone View Your Data
Learn how to let users give another person read-only access to part of their data in your app, like a workout log they want their coach to see.
Key-ValuePermissions
Send Live Updates to Other Users
Learn how to send live updates from your app to other people, like the score of a game they follow, the moment it changes.
Key-ValueEvents
Store Items by ID
Learn how to store a list where every item has its own ID with Puter.js, so edits from several tabs or devices never change the wrong item.
Key-ValueData Modeling
Manage Who Has Access to Shared Data
Learn how to show users who they shared data with in your app, so they can change or remove anyone's access, and leave data other people shared with them.
Key-ValuePermissions
Build a Group Chat
Learn how to build a group chat where the messages live in your users' own Puter accounts, with live updates and invites, and no server to run.
Key-ValueEventsPermissions
Share Data From Your Backend
Learn how to let your app or its backend share a user's data with other people on its own, after asking the user for permission once.
Key-ValuePermissionsWorkers
Store a Set of Unique Values
Learn how to store a set of unique values with Puter.js, so nothing gets added twice, even when the user adds it from two tabs at once.
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 any number of records with Puter.js, and load them a page at a time or change them one at a time.
Key-ValueData ModelingPerformance
Split a Large Value Across Keys
Learn how to store a history that keeps growing, such as a chat, with Puter.js, so adding to it and loading the latest part stay fast and cheap.
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 filter and sort records with Puter.js, so each view in your app loads only the records it shows.
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 with Puter.js, and keep every lookup correct as records change.
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.
WorkersEmailKey-Value
Store Server-Side Data
Learn how to store data that every user of your app can read and update with Puter.js.
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 with Puter.js without exposing its API key.
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
Make HTTP Requests
Learn how to make HTTP requests from the browser with Puter.js, so your app can call any API or website, even ones that block cross-origin requests.
Networking
Watch for Changes
Learn how to update your app's screen with Puter.js when the user's data changes in another tab, on another device, or in another app.
EventsKey-ValueFile System
Catch Up on Notifications
Learn how to show Puter notifications in your app with Puter.js, including the ones that arrived while your app was closed.
Events
Connect to a Server
Learn how to open TCP and TLS connections from the browser with Puter.js, so your app can talk to any server on any port.
Networking
Keep an Open File in Sync
Learn how to build an editor with Puter.js events that reloads a file when it changes somewhere else, protects unsaved work, and follows the file when it's renamed or deleted.
EventsFile System
Reach a User When Your App Is Closed
Learn how to send push notifications from your app with Puter.js, so users hear about a new message or a finished task after they close it.
Notifications
Add a Notification Settings Switch
Learn how to add a notifications switch to your app's settings, so users can turn push notifications on and off and know what to do when their browser blocks them.
NotificationsUI
Run Code in the Background
Learn how to run your own code with Puter.js events when a user's files change, even while your app is closed, like a webhook or a background job.
EventsFile SystemKey-Value
Notify Chat Members of New Messages
Learn how to send chat members a notification on their phone or computer for each new message, even after they close your app.
NotificationsKey-ValueEvents
Build an RSS Reader
Learn how to build an RSS reader with Puter.js, so users can read the latest headlines from any feed.
NetworkingKey-Value
Clean Up Background Work
Learn how to find and remove background jobs your app no longer needs, so users aren't billed for them.
EventsWorkers
Check Website Uptime
Learn how to check whether a website is up with Puter.js and keep a history of recent checks for each user.
NetworkingKey-Value
Alert Users When Shared Data Changes
Learn how to alert people on their phone or computer when something they follow changes, like the final score of a game, even after they close your app.
NotificationsEventsKey-Value