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: CallsGET /client-api/v1/sites/{siteId}/todaywith Basic Auth, then displays any visitors withstatus == "signed_in".
$item['name']) and shows only those signed in.curl extension enabled in PHPwhos-in.php). $baseUrl = 'https://backend.signinapp.com/client-api/v1';
$key = 'YOUR_API_KEY';
$secret = 'YOUR_API_SECRET';
$siteId = 'YOUR_SITE_ID';
// Optional IP restriction
$limitIpAddress = true; // set to false to disable
$allowedIPs = array('1.2.3.4','5.6.7.8');https://yourdomain/whos-in.php).baseUrl: API base URL (keep as default unless Sign In App advises otherwise).key and secret: Client API credentials from Sign In App.siteId: Your specific site’s ID.limitIpAddress (bool): If true, only requests from allowedIPs will be served.allowedIPs (array): List of IPv4 addresses allowed to access the page.To avoid committing secrets in source code, load credentials from environment variables.
Example using PHP’s getenv():
$key = getenv('SIA_CLIENT_KEY');
$secret = getenv('SIA_CLIENT_SECRET');
$siteId = getenv('SIA_SITE_ID');
On Linux with Apache, set in your vhost or .htaccess:
SetEnv SIA_CLIENT_KEY "xxxx"
SetEnv SIA_CLIENT_SECRET "yyyy"
SetEnv SIA_SITE_ID "12345"
On Nginx with PHP‑FPM, set in the php-fpm.conf pool or systemd unit:
; php-fpm pool
env[SIA_CLIENT_KEY] = xxxx
env[SIA_CLIENT_SECRET] = yyyy
env[SIA_SITE_ID] = 12345
Or use a .env loader library if your framework supports it.
base64(key:secret).php-curl extension and restart web server.limitIpAddress or add your client IP to allowedIPs.photo_url is loaded from the API response; consider caching or a placeholder.$response to diagnose API or network errors.This example is provided "as is" without warranty. Adapt and integrate into your own project as needed. Check your Sign In App agreement and API terms before production use.