# Start from your code

> Paste one prompt into your coding agent and move the places hard-coded in your app into a Spatibase project, with or without an account.

If your app keeps its places in a JSON, GeoJSON or CSV file, or in an array in the code, you can move them behind a Spatibase API in one session. You paste one prompt into your coding agent (Claude Code, Cursor or Codex). It finds your data, asks you once, builds the project, publishes the places, changes the app to read them from the API and checks that it works. You need no account at the start: the email comes at the end.

## The prompt

Open your coding agent inside the project and paste this:

```text
Move this app's location data to Spatibase (a CMS and API for places) and wire the app to its API.
Read the guide first: https://spatibase.com/agents/quickstart.md

1. Find the location data in this repo (JSON, GeoJSON or CSV files, or lat/lng in code).
2. Show me a short report: what you found, the types and fields you would create, the code you would change, and that the data will be public but unlisted. Wait for my OK.
3. Create a temporary Spatibase project, import and publish the data, and check the live API.
4. Change the app to load the data from the API and run its checks.
5. Ask for my email so I can keep the project (it is deleted after 24 hours otherwise).

Finish with the live API URL, what changed in the code and when the project expires.
```

No app yet, and want to start from public data? Every [free dataset](https://spatibase.com/datasets/) has a prompt that does the same with the dataset imported into a temporary project: see [Building on a free dataset](https://spatibase.com/docs/build/build-with-a-coding-agent/#building-on-a-free-dataset).

The agent needs a terminal and Node.js 18.3 or newer, because it runs the [`spatibase` command](https://spatibase.com/docs/build/cli/) with `npx`. Chat-only assistants that cannot run commands or edit your files cannot do this; for those, [connect an assistant](https://spatibase.com/docs/ai/connect-an-assistant/) to a project you made in the app.

## Already have a Spatibase account?

Make the project in the app and hand it to your agent with a one-time code, so nothing is temporary and your key never goes through the chat:

1. In the app choose **New project**, then **Coding agent**, and click **Create and get the prompt**.
2. Copy the prompt (it contains a code like `K7Q-4XM`) into your coding agent, inside your project folder. The code works once and for 15 minutes; a new code replaces the old one. A switch decides whether the agent may publish; by default it may, after your OK on its report.
3. The agent runs `npx spatibase@latest link K7Q-4XM`, which saves a key to your project in `.spatibase/` (git-ignored), then follows the same steps as below, minus the email: no expiry, nothing to keep.
4. The project opens on **Entries** with the **Use your coding agent** window: the prompt to copy and the progress (agent connected, types created, places imported, published); the places appear on the map as the agent adds them. Close it with **Done** at any time; **Use your coding agent** in the empty list opens it again, and an empty project you already made offers the same prompt there.

The key is named "Coding agent link" followed by the date. You see it under **API**, **Access & keys**, and you can revoke it there at any time. It can read and change drafts and the content model and, if you left it on, publish; it can never delete or change who can read your API. The 1,000 places limit of temporary projects does not apply: your plan's limits do. Only owners of a project can make a code.

## What happens

1. **A report and one OK.** The agent scans the repo and shows what it found (for example "`public/stores.json`, 48 stores with name, address, hours and phone"), the type and fields it would create, the files it would change, and that the data will be public but unlisted. It changes nothing until you say OK.
2. **A temporary project.** With no sign-in, the agent creates a [temporary project](https://spatibase.com/docs/build/start-from-your-code/#temporary-projects), builds the types and fields, imports the places (and uploads the images your data points at), publishes them and checks that the live API serves the same number.
3. **Your app on the API.** The agent replaces the local file with a request to the project's Content Delivery API, keeps loading and error states, leaves the old file in place for you to delete, and runs your lint, type check, tests and build.
4. **Keep it.** The agent asks for your email in the terminal. Spatibase sends you **Keep your project**; one click creates your account (or signs you in) and the project is yours, in the app, where your team can edit the places.

The whole run takes a few minutes. After you keep the project, the API address in your code does not change: the project id and the Delivery URLs stay the same.

## Temporary projects

A temporary project is a normal Spatibase project that nobody owns yet. The agent creates it through the `spatibase` command or the [temporary project endpoint](https://spatibase.com/docs/build/cli/#without-the-command), and gives it a secret token that lasts 24 hours.

| | |
|---|---|
| Lifetime | **24 hours** from creation. Once the agent has sent your email address, **72 hours** (from that first email) unless you keep it |
| Reminders | Two emails to that address if you have not kept it: after 24 hours ("Your project is waiting") and after 60 hours ("Deleted in 12 hours") |
| Keeping it | The link in the email, **Keep my project**. It creates your account (a new one needs the Welcome step: your name) and makes you the owner of this very project. Same project id, same API address |
| Places | At most **1,000** per project. A bigger source imports its first 1,000 and the agent tells you |
| Files | At most **50 MB** of uploaded images and files |
| Who can read it | **Public but unlisted.** Anyone who knows the API address can read the published places; it is listed nowhere (no gallery, no sitemap) and answers carry `X-Robots-Tag: noindex`. Nobody can open it in the app until it is kept |
| API keys | Not available while temporary |
| After 24 or 72 hours | The project and its files are deleted. For 30 days the API then answers **410 Gone** with the code `project_expired`: "This temporary project expired because nobody kept it" |
| Creating projects | 3 per client IP address a day, and a global hourly cap |

Public means anyone with the address can read it. If your data should not be reachable that way (people's emails or phone numbers, internal notes), tell the agent: it then asks for your email first, waits until you have kept the project, and only then imports the data. Afterwards you set the project's API to **private** in the app (**API**, **Access & keys**) and create a read key, so [only requests with the key](https://spatibase.com/docs/reference/authentication/) can read it. The agent cannot change access or create keys.

## Several languages

If the repo has one file per language, the agent imports the default language first, turns on the project's languages and imports each other language onto the same entries, so the API answers `?locale=de`. See [Translate your content](https://spatibase.com/docs/content/translations/) and [Languages in the API](https://spatibase.com/docs/reference/delivery-api/#languages).

## What the agent will not do

- It does not touch your repo before your OK, and it never commits.
- It does not copy the token anywhere: the token lives in `.spatibase/project.json`, in a folder that ignores itself.
- It does not delete your original data file.
- Data in a database or another service is not covered yet; the agent says so if it finds only that.

## If something goes wrong

| What you see | What it means |
|---|---|
| The agent stops at "token expired" or `410 project_expired` | The temporary project is more than 24 hours old (or 72 with an email) and was not kept. Paste the prompt again to make a new one |
| "The 1,000 places limit" | A temporary project holds 1,000 places. Keep the project and import the rest in the app, or start with a subset |
| Images were skipped | Uploaded images can be up to 3.5 MB each; larger ones stay out with a warning. Remote image URLs stay links |
| You never got the email | Check spam, then ask the agent to send it again (up to 3 different addresses per project, 5 emails a day per address) |
| `429` on creating the project | Too many temporary projects from your network today; try again tomorrow or [make a project in the app](https://spatibase.com/docs/get-started/create-a-project/) |

## Related

- [The `spatibase` command](https://spatibase.com/docs/build/cli/)
- [Build an app with your content and a coding agent](https://spatibase.com/docs/build/build-with-a-coding-agent/): for a project that already exists
- [Quickstart: a map in ten minutes](https://spatibase.com/docs/build/quickstart/)
- [What AI assistants can do](https://spatibase.com/docs/ai/what-assistants-can-do/)
- The playbook the agent reads: [spatibase.com/agents/quickstart.md](https://spatibase.com/agents/quickstart.md)
