A simple PHP page that shows who is currently signed in at a given site using the [Sign In App Client API]. It fetches today's sign‑ins for a site, groups them, and renders each signed‑in person as a tile with their photo and name.
> What this does: Calls GET /client-api/v1/sites/{siteId}/today with Basic Auth, then displays any visitors with status == "signed_in".
---
---
---
$item['name']) and shows only those signed in.
- Sorts names alphabetically within each group.
- Optional IP allow‑list to restrict page visibility.
- Simple, readable tile layout with circular avatar images.curl extension enabled in PHP
- A web server (Apache, Nginx, IIS) capable of running PHP
- Sign In App Client API credentials:
- API Key
- API Secret
- Site IDwhos-in.php).
2. Edit the configuration at the top of the file:
php $key = getenv('SIA_CLIENT_KEY'); $secret = getenv('SIA_CLIENT_SECRET'); $siteId = getenv('SIA_SITE_ID');$baseUrl = 'https://backend.signinapp.com/client-api/v1'; $key = 'YOUR_API_KEY'; $secret = 'YOUR_API_SECRET'; $siteId = 'YOUR_SITE_ID';baseUrl// Optional IP restriction $limitIpAddress = true; // set to false to disable $allowedIPs = array('1.2.3.4','5.6.7.8'); ``
3. Ensure your server can make outbound HTTPS requests. 4. Browse to the page (e.g.https://yourdomain/whos-in.php).If credentials and site ID are valid, you’ll see groups with tiles for each signed‑in person.
Configuration
The top of the script contains these settings: -: API base URL (keep as default unless Sign In App advises otherwise). -keyandsecret: Client API credentials from Sign In App. -siteId: Your specific site’s ID. -limitIpAddress(bool): Iftrue, only requests fromallowedIPswill be served. -allowedIPs(array): List of IPv4 addresses allowed to access the page.getenv()Environment Variables (recommended)
To avoid committing secrets in source code, load credentials from environment variables.Example using PHP’s
:
apacheconf SetEnv SIA_CLIENT_KEY "xxxx" SetEnv SIA_CLIENT_SECRET "yyyy" SetEnv SIA_SITE_ID "12345"On Linux with Apache, set in your vhost or.htaccess:
ini ; php-fpm pool env[SIA_CLIENT_KEY] = xxxx env[SIA_CLIENT_SECRET] = yyyy env[SIA_SITE_ID] = 12345 `On Nginx with PHP‑FPM, set in thephp-fpm.confpool or systemd unit:
Or use a
.env loader library if your framework supports it.Security Notes
- Never commit API keys/secrets to source control.
- Prefer environment variables or a secrets manager (e.g., 1Password, Azure Key Vault).
- If exposing on a public URL, consider additional protections:
- IP allow‑list (already included)
- Basic Auth at the web server level
- Network restrictions (VPN, internal only)
- Validate/escape output if you expand the template (current data fields are assumed safe from the API, but sanitise as good practice).Error Handling & Troubleshooting
- Empty page or no groups shown: Verify site ID is correct and there are sign‑ins today.
- Auth errors: Check API key/secret values; ensure Basic Auth header is built as base64(key:secret).
- cURL not installed/enabled: Enable php-curl extension and restart web server.
- IP blocked message: Disable limitIpAddress or add your client IP to allowedIPs.
- Slow image loads: The photo_url is loaded from the API response; consider caching or a placeholder.
- JSON decode issues: Log $response` to diagnose API or network errors.---