# Index10 Examples These examples assume an app has already been created through the JmpKit gateway and the caller has an owner or linked-agent bearer token. ```bash export GATEWAY="https://jmpkit.com" export APP_ID="abcde" export APP_HOST="$APP_ID.jmpkit.app" export BEARER="..." ``` ## Add The Current App To The Index ```bash curl -sS -X POST "$GATEWAY/api/apps/$APP_ID/index10/items" \ -H "authorization: Bearer $BEARER" \ -H "content-type: application/json" \ --data-binary @samples/create-ziphost-item.json ``` ## Add An App-Free Global Index Item Use this when the record belongs to the bearer entity, not to one specific app. ```bash curl -sS -X POST "$GATEWAY/api/index10/items" \ -H "authorization: Bearer $BEARER" \ -H "content-type: application/json" \ --data '{ "kind": "note", "url": "https://jmpkit.com/docs/", "title": "JmpKit docs", "description": "Global app-free index record for the docs.", "tags": ["docs", "jmpkit"] }' ``` ## Search Public Items ```bash curl -sS "$GATEWAY/api/index10/search?q=todo&kind=ziphost10" ``` From inside a hosted app: ```js const result = await fetch('/api/index10/search?q=todo').then((r) => r.json()); console.log(result.items); ``` ## Set The Owner Entity Profile ```bash curl -sS -X PUT "$GATEWAY/api/apps/$APP_ID/index10/entities/me" \ -H "authorization: Bearer $BEARER" \ -H "content-type: application/json" \ --data-binary @samples/entity-profile.json ``` ## Hide An Item From Public Search ```bash curl -sS -X PATCH "$GATEWAY/api/apps/$APP_ID/index10/items/$ITEM_ID" \ -H "authorization: Bearer $BEARER" \ -H "content-type: application/json" \ --data '{"indexed":false}' ``` ## Browser App: Publish Its Own Public Record Most browser apps should not hold owner bearer tokens. Let an agent or trusted owner-side flow create index records. Public browser code can still search: ```js async function searchExamples(query) { const params = new URLSearchParams({ q: query, limit: '20' }); const response = await fetch(`/api/index10/search?${params}`); if (!response.ok) throw new Error(`index10 search failed: ${response.status}`); return response.json(); } ``` ## Local Dev With the gateway running locally on port 8000: ```bash curl -sS \ "http://127.0.0.1:8000/_jmpkit-dev/host/$APP_HOST/api/index10/search?q=todo" ```