Forking Projects
fork_project clones a project into a new one owned by the caller. There are two modes,
chosen automatically based on who owns the source.
Forking your own project
When the source project belongs to you, the fork is a full clone: code, the complete database (all rows) and storage references are duplicated. Cloning from HEAD also auto-creates a restore-point version in the source.
fork_project({ source_project_id: "my-app", new_project_id: "my-app-copy", description: "..." })
Optionally clone from a specific version with source_version.
Forking another user's project (public fork)
When the source belongs to another user, the fork only works if that user has enabled public forking on it. A public fork copies:
- code (all files), and
- database schema — table/index/constraint structure only, no rows, and
- public assets (shared by reference).
A public fork does NOT copy: database rows, private uploads, or environment secrets
(set_env values). The new project starts with an empty-but-structured database and its own
fresh set of secrets.
fork_project({ source_project_id: "someones-app", new_project_id: "my-fork", description: "..." })
If the source doesn't exist or its owner hasn't enabled public forking, this returns
FORK_NOT_ALLOWED. Every fork counts against the caller's project limit like any normal
project.
Letting others fork YOUR project
Use set_project_public_fork to allow or disallow public forking of one of your projects.
Pass an optional description shown on the app's fork page and gallery card:
set_project_public_fork({ project_id: "my-app", enabled: true, description: "A todo app with reminders" })
Once enabled, the app is forkable immediately via its page at /fork/my-app (anyone with the
link). To also be featured in the public gallery at /forkable, it needs a one-time admin
approval — mention this so the user knows the gallery listing isn't automatic.
Security warning to relay to the user before enabling: code and SQL definitions (function
bodies, views, column defaults) are copied to forkers verbatim. Any secret hardcoded in the
source or schema WILL be exposed. Tell the user to move secrets into environment variables
(set_env) and remove any hardcoded keys before enabling public forking. Data rows, private
uploads and set_env values are never shared.
Adding a "fork me" button to an app
Each forkable project has a public page at https://<app-domain>/fork/<project_id> (for
onvibe.run apps: https://onvibe.run/fork/<project_id>). It shows what a fork includes and how
to fork it. When a user asks to add a fork button, link or ribbon to their app, just write the
HTML yourself in their app's pages (a normal anchor pointing at that fork page, styled however
the user wants) — there's no special API.
Only suggest this for projects the user has actually made forkable (set_project_public_fork);
the fork page returns a neutral "not available" message otherwise.