---
name: eligapris-store-developer-api
description: >-
  Manage Eligapris Store developer accounts and publish/update apps via the
  Developer API (egk_ API keys, developer mode, unlisted visibility). Existing
  apps: upload APK + What's new only — omit icon/feature/screenshots unless
  user asks to replace or add. Use when publishing an APK, updating a listing,
  or setting public/unlisted visibility.
---

# Eligapris Store Developer API

Canonical docs: https://store.eligapris.com/developers  
Human contract: https://store.eligapris.com (see `/developers`)

Install this skill (Cursor):

```bash
mkdir -p ~/.cursor/skills/eligapris-store-developer-api
curl -fsSL "https://store.eligapris.com/skills/eligapris-store-developer-api/SKILL.md" \
  -o ~/.cursor/skills/eligapris-store-developer-api/SKILL.md
```

## Environment

Create a key at https://store.eligapris.com/account/developer (instant after email verify + developer mode), then persist it:

```bash
mkdir -p ~/.config/eligapris
cat > ~/.config/eligapris/store.env <<'EOF'
export ELIGAPRIS_STORE_BASE_URL="https://store.eligapris.com"
export ELIGAPRIS_STORE_API_KEY="egk_…"
EOF
# Load in new shells (bash):
grep -q 'eligapris/store.env' ~/.bashrc 2>/dev/null || \
  echo 'source ~/.config/eligapris/store.env' >> ~/.bashrc
source ~/.config/eligapris/store.env
```

Never commit API keys.

## Account setup

1. Register + verify email → `/account`
2. Enable **developer mode**
3. `/account/developer` → Create API key (copy once) → persist with the block above

## API capabilities

| Action | How |
|--------|-----|
| List public apps | `GET /api/v1/catalog` → `{ items, count }` |
| Get app (incl. unlisted) | `GET /api/v1/catalog/:id` → `{ item }` |
| List my apps | `GET /api/v1/apps/mine` + Bearer key |
| Create / update | `POST /api/v1/publish` multipart |
| Unlisted (link-only) | meta `visibility: "unlisted"` |
| Unpublish | meta `{ "slug", "unpublish": true }` |

**Auto-confirm:** verified publishers get keys instantly; listings go `published` immediately (blocked stays blocked).

## Media on publish

Server keeps existing icon / feature / screenshots when those multipart parts are **omitted**.

| App state | Multipart parts | Notes |
|-----------|-----------------|--------|
| **Existing** (default update) | `meta` + `apk` | Include `whatsNew`. Do **not** send media. |
| **First publish** | `meta` + `apk` + `icon` + `featureGraphic` + ≥3 `screenshots` | |
| Replace / add media | only the parts the user asked to change | |

## Publish workflow

```
Progress:
- [ ] APK ready (+ media if first publish)
- [ ] ELIGAPRIS_STORE_API_KEY set
- [ ] POST /api/v1/publish
- [ ] Confirm status `published` and visibility
```

### curl — existing app (APK + What's new)

Use `--form-string` for `meta` so `;` inside JSON is not treated as a multipart separator.

```bash
BASE="${ELIGAPRIS_STORE_BASE_URL:-https://store.eligapris.com}"
KEY="$ELIGAPRIS_STORE_API_KEY"
APK="./my-app.apk"

jq -c -n \
  --arg whats $'- bullet one\n- bullet two' \
  '{
    slug:"my-app",
    name:"My App",
    whatsNew:$whats,
    visibility:"public"
  }' > /tmp/meta.json

curl -sS -X POST "$BASE/api/v1/publish" \
  -H "Authorization: Bearer $KEY" \
  --form-string "meta=$(cat /tmp/meta.json)" \
  -F "apk=@${APK};type=application/vnd.android.package-archive"
```

### curl — first publish (full packet)

```bash
curl -sS -X POST "$BASE/api/v1/publish" \
  -H "Authorization: Bearer $KEY" \
  --form-string "meta=$(cat /tmp/meta.json)" \
  -F "apk=@./my-app.apk;type=application/vnd.android.package-archive" \
  -F "icon=@./icon-512.png;type=image/png" \
  -F "featureGraphic=@./feature.jpg;type=image/jpeg" \
  -F "screenshots=@./01.png;type=image/png" \
  -F "screenshots=@./02.png;type=image/png" \
  -F "screenshots=@./03.png;type=image/png"
```

Verify:

```bash
curl -s -H "Authorization: Bearer $KEY" "$BASE/api/v1/apps/mine" | jq .
```

## Hard rules

1. Prefer `egk_` over any legacy publish token.
2. Do not print full API keys in chat after the user has them saved — refer to env var name.
3. versionCode must increase on new APK; What's New required on bumps.
4. Images: png/jpg/webp only — and only on first publish or when replacing/adding.
5. Always prefer `--form-string` for the `meta` field.
