Skip to content

Configuration

The SDK reads its configuration from window.serviceDiscoveryConfig. Define this object in a <script> block before loading the SDK scripts.

Required fields

<script>
    var serviceDiscoveryConfig = {
        accessKey: 'csl_em_YOUR_KEY_HERE'
    };
</script>
Field Type Required Description
accessKey string Yes Your LightPane access key. Starts with csl_em_ (embed), csl_ak_ (API), or csl_dm_ (demo).

Optional fields

<script>
    var serviceDiscoveryConfig = {
        accessKey: 'csl_em_YOUR_KEY_HERE',
        apiUrl: 'https://api.lightpane.cloud/discovery',
        showLastUpdated: true,
        showServiceLabel: true,
        tableClass: 'table table-sm'
    };
</script>
Field Type Default Description
apiUrl string https://api.lightpane.cloud/discovery Discovery API endpoint. Override for self-hosted deployments or staging.
showLastUpdated boolean true Show a timestamp below each table indicating when data was fetched.
showServiceLabel boolean true Show the service name as a heading above each table.
tableClass string 'sd-table' CSS class applied to rendered tables. Set to 'table table-sm' if using Bootstrap.

Access key types

The access key determines what data the SDK can fetch and from where. Keys are created in the LightPane application.

Prefix Type Typical use
csl_em_ Embed Web pages viewed by people who are not logged into LightPane
csl_ak_ API key Scripts, CI/CD pipelines, Excel/Power Query
csl_dm_ Demo Public demo pages with restricted scope

All key types work with the SDK. The key's constraints (allowed origins, IP restrictions, service scope) are enforced server-side on every request.

Access keys are visible in page source

Embed keys appear in your HTML. This is by design — security comes from server-side constraints (origin restrictions, service scoping, rate limits), not from key secrecy. See Access Keys & Constraints for the full security model.

Self-hosted API URL

If you run LightPane in your own AWS account (Enterprise or Partner tier), point the SDK at your deployment:

<script>
    var serviceDiscoveryConfig = {
        accessKey: 'csl_em_YOUR_KEY_HERE',
        apiUrl: 'https://lightpane.internal.acmecorp.com/discovery'
    };
</script>

Verifying configuration

Open the browser developer console. The SDK logs configuration status at boot:

[LightPane] Config loaded: apiUrl=https://api.lightpane.cloud/discovery, requests=3
[LightPane] Fetching 3 service(s)...

If the access key is missing or invalid, you will see:

[LightPane] Error: No accessKey in serviceDiscoveryConfig