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

# Salesforce

> Connect Salesforce orgs and sync a metadata catalog — the foundation for coverage, doc generation, impact analysis, and the workspace agent.

The Salesforce connection is the heart of LivingContext. It builds a **metadata catalog** of your org — the objects, code, and automation that make up your business logic — and keeps it fresh on a schedule. That catalog is what grounds every agent, coverage score, and impact analysis in the product.

## Connect

Salesforce connects through **your own Connected Apps** — your credentials, your org's policies, no platform-wide app in between. Production and each sandbox are different Salesforce orgs, so each environment gets its own app:

<Steps>
  <Step title="Add a Connected App per environment">
    In each Salesforce org you want to connect, create a Connected App (enable OAuth, paste in the callback URL shown on the Connections page). Then, on the **Connections** page, add it to the Salesforce card's **Connected Apps** panel: a name (say, *Production* or *UAT sandbox*), its **login URL**, and its **consumer key** and **consumer secret**.
  </Step>

  <Step title="Set the login URL">
    Use `https://login.salesforce.com` for production, `https://test.salesforce.com` for sandboxes, or your org's **My Domain** URL. LivingContext authorizes and refreshes tokens against this host.
  </Step>

  <Step title="Connect each environment">
    Every registered app has its own **Connect** button. Connect as many orgs as you need, side by side — each connection remembers which app authorized it.
  </Step>

  <Step title="Authorize with OAuth">
    LivingContext requests the `api`, `refresh_token`, and `web` scopes — enough to read metadata and stay connected, nothing more.
  </Step>

  <Step title="The first sync starts itself">
    Connecting automatically kicks off the first metadata sync — no button to find. Progress and history are visible on the Sync page, and each connection card offers **Fetch latest metadata** for a manual run any time.
  </Step>
</Steps>

## What syncs

The catalog covers your org's structural metadata, with **source bodies where available**:

* Apex classes and triggers
* Custom objects and fields
* Flows
* Page layouts
* Pages
* …and more component types

<Note>
  Sync reads **metadata only** — the shape and source of your org. It never syncs your records or business data.
</Note>

### Ingest settings

The catalog itself — every metadata entity in your org — is always fully synced. Each connection's **Ingest settings** page controls what additionally gets embedded for AI search and grounding:

| Setting          | What it controls                                                         |
| ---------------- | ------------------------------------------------------------------------ |
| Component types  | Which types are chunked and embedded for the agents' semantic search     |
| Managed packages | Ignore all (the default), include all, or include only specific packages |

These pair with **Settings → Documentation eligibility**, which decides which components count toward [Coverage](/guides/coverage) — and a **Browse ingested metadata** link on each connection lets you inspect exactly what's in the catalog.

## Sync schedules

Choose an **Auto-fetch frequency** per connection: **Manual only**, **Hourly**, **Every 6 hours**, or **Daily**.

* Failed runs **retry automatically**.
* Every run appears in a **run history** with status and timing.
* When a component changes between syncs, LivingContext captures **before/after versions**, powering change diffs and freshness detection.

## What the connection powers

| Feature                                      | How Salesforce data is used                                |
| -------------------------------------------- | ---------------------------------------------------------- |
| [Coverage](/guides/coverage)                 | Which components are documented, which aren't              |
| Doc generation                               | Agents ground drafts in real component metadata and source |
| Impact analysis                              | Usages and dependencies across the org                     |
| [API reference](/guides/api-reference)       | Inbound and outbound API surface derived from metadata     |
| [Schema diagrams](/guides/schema-diagrams)   | Interactive ER diagram of your objects and relationships   |
| [Workspace agent](/agents/workspace-agent)   | The full org-intelligence tool set                         |
| [Coverage auditor](/agents/coverage-auditor) | Candidates for brand-new docs                              |

## Live reads

A few capabilities query your org **live** rather than from the synced catalog, using your connection's token:

* **Setup Audit Trail** — recent configuration changes
* **Security health check** — your org's current security posture
* **Field utilization** — how populated fields are, as **counts only**

<Warning>
  Live reads never touch record contents. Field utilization runs count queries and returns numbers — no field values, no records, ever.
</Warning>

## Managing connections

* Connect additional orgs (production and sandboxes side by side) from the Connections page.
* Assign connections to [spaces](/admin/spaces-and-repos) to scope which surfaces see which org.
* Disconnecting revokes LivingContext's access; the synced catalog stops updating.
