# BestCityToLive integration examples

The public iframe needs no key: /embed/city?city=calgary.
Use the /integrations configurator for a complete copyable iframe.

Every city card uses the same display priority: unemployment rate, ACS median
gross rent, ACS median household income, employment rate, then Crime Severity
Index. Remaining local indicators follow stable metric-name order. Cards show
at most two observations and exclude derived annual-change rows. This display
rule changes no research values, review dates or ranking positions.

node-server.mjs is a server-only ES module for Node 20+.
wordpress-city-brief.php is a minimal WordPress shortcode plugin example.
Install the PHP file in a dedicated plugin directory, activate it and add
[bestcity_city city="calgary"] to a page. Set these server environment variables:

BCTL_GATEWAY_URL: the verified gateway root published at /data/integration-config.json.
BCTL_PARTNER_TOKEN: a separately provisioned partner credential.

Never put the partner credential in a public repository, browser bundle, iframe,
analytics payload, or customer-visible response. These examples do not provision
an account or issue credentials. A protected endpoint works only after the gateway
and a valid partner key have been configured. Public read-only MCP is separate;
use the mcp_url advertised in integration-config.json in a supporting client.

The original sources retain their own terms. These examples grant no additional
licence to editorial text or third-party observations. Retain source attribution,
review dates, observation periods and scope in any permitted reuse. They are not
property valuations, current listing prices, booking availability or official
Civometra results. No customer or listing data is sent to BestCityToLive.

When adapting the examples, authenticate your own administrative routes, bound
request volume and cache successful records. Never expose raw upstream error
bodies or token values. The Node example rejects redirects; the WordPress example
uses the safe HTTP client with redirects disabled and escapes rendered content.
