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

# Connect your app to Salesforce

> Connect your app to Salesforce, a CRM platform, to read and manage Accounts, Contacts, Cases, and other records.

export const connector_0 = "Salesforce"

[Salesforce](https://www.salesforce.com/) is a CRM platform for managing customer relationships, sales pipelines, and support cases. The Salesforce connector lets your Lovable app query and update CRM records through your own Salesforce org. It's designed for internal tools, customer portals, and support dashboards that need live access to Salesforce data.

With Salesforce, your app can:

* Query Accounts, Contacts, Leads, Cases, and other standard objects using SOQL.
* Display and filter CRM records in dashboards and internal tools.
* Create and update records via the Salesforce REST API.
* Run custom SOQL queries for reporting and data exports.

It's a good fit for sales ops tools, support portals, and any app that surfaces Salesforce data to your team.

## Common use cases and example apps

| Example app            | Example prompt                                                                                 | Description                                                                                                                                                                             |
| :--------------------- | :--------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Support case dashboard | *Use Salesforce and build a dashboard showing open Cases by priority and status.*              | **A live view of your support queue, organized by priority.**<br />The app pulls Cases from Salesforce and groups them so agents can see what needs attention first.                    |
| Account health tracker | *Use Salesforce and build an internal tool showing Account health scores and recent activity.* | **A per-account summary with activity history and key fields.**<br />The app runs SOQL queries to surface contact counts, open opportunities, and recent case history for each account. |
| Lead pipeline viewer   | *Use Salesforce and build a pipeline board showing Leads by stage and owner.*                  | **A Kanban-style board of your Leads, organized by sales stage.**<br />The app queries Salesforce Leads and renders them by status so reps can track progress across their pipeline.    |
| Contact directory      | *Use Salesforce and build a searchable directory of Contacts with their account and role.*     | **A filterable contact list tied to your Salesforce org.**<br />The app fetches Contact records and lets users search by name, account, or role without leaving the tool.               |
| Case detail view       | *Use Salesforce and build a support portal where users can look up their Cases by email.*      | **A self-service portal for customers to check their open Cases.**<br />The app queries Cases by supplied email and displays status, subject, and latest update for each one.           |
| Sales activity report  | *Use Salesforce and build a weekly report of closed opportunities by rep.*                     | **An automated report of won opportunities, grouped by owner.**<br />The app runs a SOQL query against Opportunities and renders a summary table for your weekly sales review.          |

## How to connect Salesforce

Workspace **admins** and **owners** can connect Salesforce. You can create multiple Salesforce connections using different orgs or Connected Apps, which is useful for separating production and sandbox environments.

When the connection is created, Salesforce becomes available across all projects in the workspace. Anyone building in a project can ask Lovable in chat to link their project to it.

### Prerequisites

Before connecting Salesforce, make sure you have:

* A Salesforce org (Developer Edition, production, or sandbox)
* A Salesforce Connected App with OAuth enabled (see Step 1 below)
* Lovable workspace **owner** or **admin** role

<Note>
  All API requests made through this connector count against your Salesforce org's API limits. Billing and quota are handled directly by Salesforce, not Lovable.
</Note>

### Step 1: Create a Salesforce Connected App

Salesforce uses Connected Apps to authorize third-party access via OAuth. You need to create one to get a Client ID and Client Secret for Lovable.

<Steps>
  <Step title="Open Setup in Salesforce">
    Sign in to your Salesforce org. Click the gear icon in the top-right corner and select **Setup**.
  </Step>

  <Step title="Navigate to App Manager">
    In the left sidebar, search for **App Manager** and select it under **Apps**.
  </Step>

  <Step title="Create a new Connected App">
    Click **New Connected App** in the top-right corner.

    Fill in the required fields:

    * **Connected App Name**: for example, `Lovable Integration`
    * **API Name**: auto-populated from the name
    * **Contact Email**: your email address
  </Step>

  <Step title="Enable OAuth settings">
    Under **API (Enable OAuth Settings)**, check **Enable OAuth Settings**.

    Set the **Callback URL** to:

    ```text theme={null}
    https://lovable.dev/oauth/callback
    ```

    Under **Selected OAuth Scopes**, add:

    * **Access and manage your data (api)**
    * **Perform requests at any time (refresh\_token, offline\_access)**

    Leave all other settings at their defaults.
  </Step>

  <Step title="Save and retrieve your credentials">
    Click **Save**, then **Continue**.

    Salesforce may take a few minutes to provision the app. Once ready, open the Connected App and click **Manage Consumer Details** to view your credentials:

    * **Consumer Key**: this is your **Client ID**
    * **Consumer Secret**: this is your **Client Secret**

    Copy both values and store them securely.
  </Step>
</Steps>

<Warning>
  Your Client Secret functions like a password. Keep it secure and never share it publicly. You'll need it in the next step.
</Warning>

See [Salesforce Connected Apps documentation](https://help.salesforce.com/s/articleView?id=sf.connected_app_create.htm) for more detail.

### Step 2: Connect Salesforce to Lovable

<Steps>
  <Step title="Open Salesforce in Connectors">
    Go to **Connectors → App connectors** and select **Salesforce**.
  </Step>

  <Step title="Add a connection">
    Click **Add connection**.
  </Step>

  <Step title="Enter your credentials">
    Fill in the connection fields:

    * **Display name**: name the connection, for example `Salesforce Prod`. This name is only used inside Lovable to identify the connection.
    * **Environment**: select **Production** for production orgs and Developer Edition. Select **Sandbox** only if your org is a `test.salesforce.com` sandbox.
    * **Account URL**: your org's My Domain URL, for example `https://acme.my.salesforce.com`. Find this in **Setup → My Domain**.
    * **Client ID**: the Consumer Key from your Connected App.
    * **Client Secret**: the Consumer Secret from your Connected App.
  </Step>

  <Step title="Choose who can access this connection">
    Under **Who can access this connection**, decide who in your workspace can use the connection:

    * **Only you** (default): only the person creating the connection can use it and its associated data.
    * **Invite specific people**: only you and explicitly added workspace members can use the connection and its associated data.
    * **Invite entire workspace**: click **Invite entire workspace** to make the connection available to everyone in your Lovable workspace.

    See [Who can manage connections](/integrations/introduction#who-can-manage-connections) for more information.
  </Step>

  <Step title="Authorize with Salesforce">
    Click **Connect**. The Salesforce authorization window opens, so make sure your browser doesn't block pop-ups. If it does, Lovable redirects you instead.

    Sign in to Salesforce if prompted, review the requested permissions, and click **Allow**.

    You'll be redirected back to Lovable with a confirmation.
  </Step>
</Steps>

When connected, anyone building in a project can ask Lovable in chat to link their project to Salesforce (based on configured connection-level access). Your Lovable apps can then query and update CRM records through your Salesforce org.

## Limitations

The Salesforce connector cannot:

* Support per-end-user Salesforce login. Each connection represents a single Salesforce org shared across all projects linked to it.
* Access orgs outside the `*.salesforce.com` domain.
* Use Salesforce Bulk API or Streaming API endpoints.

If Salesforce authorization is revoked from the Salesforce side (for example, if the Connected App is deleted or the authorized user's permissions change), you'll need to reconnect the integration in Lovable before API calls can succeed again.

## How to unlink projects from a {connector_0} connection

Editors and above can remove specific projects from a connection without deleting the connection entirely. The connection will remain available for other projects.

To unlink projects:

<Steps>
  <Step title="Open Connectors">
    Open **Connectors**, then go to **App connectors**, and select **{connector_0}**.
  </Step>

  <Step title="Open the connection">
    Open the connection you want to manage.
  </Step>

  <Step title="Select projects">
    Under **Linked projects**, check the projects you want to unlink.
  </Step>

  <Step title="Confirm">
    Click **Unlink projects** and confirm.
  </Step>
</Steps>

When unlinked, those projects will no longer have access to {connector_0} through this connection. If a project needs {connector_0} again, you can link it to any available connection.

## How to delete a {connector_0} connection

Workspace admins and owners can delete {connector_0} connections. Other members can delete a connection if they created it, or if they have been explicitly granted access to it.

<Warning>
  Deleting a connection is permanent and cannot be undone. It will remove the credentials from all linked projects, and any apps using this connection will stop working until a new connection is added.
</Warning>

Before deleting, review the **Linked projects** section to see which projects are currently using the connection.

To delete a connection:

<Steps>
  <Step title="Open Connectors">
    Open **Connectors**, then go to **App connectors**, and select **{connector_0}**.
  </Step>

  <Step title="Open the connection">
    Open the connection you want to remove.
  </Step>

  <Step title="Review linked projects">
    Review the **Linked projects** section.
  </Step>

  <Step title="Delete">
    Under **Delete this connection**, click **Delete** and confirm.
  </Step>
</Steps>
