# The app icon

The icon is the first thing people see of the app, on a phone's Home Screen next to every other app. Give it the same care as a screen. The owner's app page shows the live icon beside the one in your preview and tells them to ask you for changes, so expect "make the icon a green tent" as a request of its own.

## Three ways to set it, from quickest to best

1. **A library icon by name.** `"icon": "LuTent"`. Search the ~38,000 icons (the react-icons sets: Lucide `Lu`, Phosphor `Pi`, Tabler `Tb`, Material `Md`, Heroicons `Hi` and more) with `GET https://nerdout.com/api/apps/v1/icons?q=tent`, then look at the candidates with `?names=LuTent,PiTent,TbTent`, which returns their SVG. It is drawn in one color on the theme's accent. Fine for a first preview; plain next to real apps.
2. **A library icon you color in (better).** Take the SVG from `?names=`, give its shapes their own fills and strokes, put a background behind it, and upload the result. Use two to four colors that belong to the app: a tent in orange with a dark-green door on a pale sky beats a white outline on a flat square. Replace every `currentColor` with a real color, since nothing sets it for you.
3. **Artwork of your own (best when you can).** Draw the SVG yourself, or, if you can generate images, generate a picture and upload it. Ask for a simple, bold subject with no lettering, centered, filling a square.

## Uploading

`POST https://nerdout.com/api/apps/v1/apps/{appId}/icon` with your token and either `{ "svg": "<svg ...>" }` or `{ "image": "<base64 PNG, JPEG or WebP>" }`. The reply is `{ "icon": "custom:..." }`; set that exact value as `manifest.icon` and push a preview. Nothing changes for anyone until the owner publishes. To go back, set `icon` to a library name again.

## Rules for uploaded artwork

- **Square, and filled to the edges.** Use a square `viewBox` (`0 0 512 512` is a good canvas) or a square picture of 512 px or more (1024 is ideal, 2 MB at most). Start with a background `<rect>` covering the whole canvas. Phones round the corners themselves, so do not draw rounded corners, a border or a drop shadow.
- **Keep the subject in the middle 70%.** Launchers crop the edges, and the subject should still be whole at 60 px.
- **SVG is shapes only:** `path`, `rect`, `circle`, `ellipse`, `line`, `polyline`, `polygon`, `g`, `defs`, gradients, `clipPath`, `mask` and `use` with `href="#id"`. No `<text>` (there are no fonts: draw letters as paths), no `<image>`, no `style` attributes or `<style>` (use `fill="..."` and `stroke="..."`), no comments, nothing that points outside the file, 64 KiB at most. A refusal says which rule and how to fix it.
- **One icon for light and dark.** Choose colors with enough contrast between subject and background to read on either wallpaper. Transparent areas are filled with the theme's background.
- **Tell the owner what you made** in one plain sentence ("I gave it an orange tent on a pale sky"), and that a phone keeps the old icon until they add the app to the Home Screen again.

## Example: a library icon, colored in

```json
{ "svg": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect width='24' height='24' fill='#DDEBF2'/><g transform='translate(4.8 4.8) scale(0.6)' fill='none' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3.5 21 14 3' stroke='#C2571A'/><path d='M20.5 21 10 3' stroke='#C2571A'/><path d='M15.5 21 12 15l-3.5 6' stroke='#1F4D3A'/><path d='M2 21h20' stroke='#1F4D3A'/></g></svg>" }
```

# The sharing image

When someone pastes the app's link into a message or a post, a picture comes with it. You do not have to do anything: we draw one from the app's name, summary, icon and theme, and it changes when they do. So the best thing you can do for it is a good icon and a clear one-sentence summary.

Make your own only when the owner asks, or when you can generate images and a picture would sell the app better than the standard card. If you do:

- **1200 by 630 pixels** (1.91 to 1), as PNG, JPEG or WebP, 2 MB at most. SVG works too, with the same shapes-only rules as the icon and `viewBox="0 0 1200 630"`.
- **Readable at a glance, small.** One subject, the app's name in large letters if you can render text well (leave it out if you cannot), strong contrast. Keep everything important inside the middle 80%: some apps crop the edges or show a square from the center.
- **Nothing private.** The picture is public to anyone who sees the link. No real names, data or screenshots of someone's records.
- **Upload it** with `POST https://nerdout.com/api/apps/v1/apps/{appId}/share-image` and `{ "image": "<base64>" }` (or `{ "svg": "..." }`). The reply is `{ "shareImage": "custom:..." }`; set that as `manifest.shareImage` and push a preview. It reaches people when the owner publishes. Their app page does not show it, so show them the picture yourself.
- **To go back** to the drawn card, remove `shareImage` from the manifest.

Only an app the owner has opened to anyone with the link shows its picture. A private app's link shows a plain card with no name or details, whatever you upload. Tell the owner that messaging apps keep the old picture for a link they have already shown, sometimes for days.

Guide: https://nerdout.com/workshop/sdk/guide.md
