> ## Documentation Index
> Fetch the complete documentation index at: https://docs.joinmarkt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Scriptable widget (iOS)

> Example iOS Scriptable medium widget using the merchant analytics API.

## Prerequisites

1. Create an API key with **widget:read** (and optionally **store:read**) on **Account → Developers**.
2. Copy your **Shop ID** from the same page.
3. Install [Scriptable](https://scriptable.app/) on iPhone.

## Environment variables in Scriptable

Edit the script and set:

```javascript theme={null}
const API_KEY = 'mk_live_...'
const STORE_ID = 'your_store_cuid'
const BASE_URL = 'https://dash.joinmarkt.com/api/merchant/v1'
```

## Example script

Download or copy from the repository: `examples/scriptable/markt-widget.js`.

The script calls:

* `GET /stores/{storeId}` for the shop name
* `GET /stores/{storeId}/analytics` for revenue, orders, and customer stats

## Security

* Never embed dashboard session cookies in Scriptable.
* Use a restricted key with only the scopes you need.
* Revoke the key from Developers if it leaks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.