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

# Connect Salesforce

> Connect your own Salesforce login to build and run apps in Wisty.

In the Wisty web app, open **Connected orgs** and click **Connect Salesforce org**. Your connection lets Wisty read the metadata used for generation and access live data when you run an app.

## Before you connect

You need a Salesforce login for the org. Wisty supports production orgs, sandboxes, developer orgs, and Trailhead playgrounds.

The org must have the Wisty package installed. If it doesn't, ask a Salesforce admin to [install Wisty](/docs/salesforce-setup/install). The connection dialog also links to the installer. Once setup is complete, connect with your own Salesforce login.

These steps are for the Wisty web app. To make Wisty available inside Salesforce, follow [Connect a host org](/docs/salesforce-setup/connect-host-org).

## Connect your org

<Steps>
  <Step title="Open the connection dialog">
    Open **Connected orgs** in the sidebar, then click **Connect Salesforce org**.

    The dialog shows **Install the Wisty package** and **Connect your org**. Skip the install step if the package is already installed in this org.
  </Step>

  <Step title="Enter the connection details">
    Enter a **Label** you can recognize, such as “Sales sandbox”. Choose the **Environment** that matches your Salesforce login:

    | Option                                 | When to use it                                         |
    | -------------------------------------- | ------------------------------------------------------ |
    | **Production / Developer / Trailhead** | You sign in through `login.salesforce.com`.            |
    | **Sandbox / Scratch Org**              | You sign in through `test.salesforce.com`.             |
    | **Custom Domain**                      | Your company uses a dedicated Salesforce login domain. |

    For **Custom Domain**, enter the part before `.my.salesforce.com` in **Organization Domain**.

    Leave **Keep me logged in with a refresh token** selected to let Wisty renew the connection when the access token expires.

    <Frame caption="Choose the login environment for your org before continuing to Salesforce.">
      <img src="https://mintcdn.com/wisty/p0KgmgXmvqDkXTFQ/images/connect-salesforce.png?fit=max&auto=format&n=p0KgmgXmvqDkXTFQ&q=85&s=aba6d94621079defa78f2c85aedb0e3f" alt="Connect Salesforce org dialog with the ACME Prod label, production environment, and refresh token option selected." width="1040" height="924" data-path="images/connect-salesforce.png" />
    </Frame>
  </Step>

  <Step title="Authorize on Salesforce">
    Click **Continue to Salesforce**. Sign in to the intended org and approve the requested access.

    You'll return to **Connected orgs**. Check that the org and username are correct and the row shows **Connected**.
  </Step>
</Steps>

If Wisty asks you to **Install the Wisty package**, click **Install package** and complete the Salesforce setup. Then return to Wisty and click **Connect again**. The form remembers your details.

<Info>
  Connecting your first eligible org starts the [30-day
  trial](/docs/billing/credits-and-plans), with 50 credits and no card required.
</Info>

## Choose the org you build against

On **Home**, use the org picker below the message box before starting a project. Creating the project selects that connection for you in this workspace.

In an open project, click the current org's name in the header above the preview, beside **View App**, and choose another [connected org](/docs/getting-started/key-concepts#connected-org). In narrower desktop windows, this control appears as a **Switch org** icon.

To change the selected connection from **Connected orgs**, open an org, click the three-dot **Org actions** menu, and choose **Set as default**. The org is then marked **Default**.

<Warning>
  These controls change your selected connection in this workspace, including
  other projects you open there. Projects created from your Wisty account don't each
  retain an independent org selection. Check the org shown in the header before
  generating or testing, especially when switching between orgs with different
  custom fields.
</Warning>

## Reconnect an org

When an org shows **Connection error**, open it and read the explanation. Click **Org actions**, then **Reconnect**, and complete Salesforce authorization again.

<Frame caption="Connected orgs shows each connection's status. An expired session shows Connection error until you reconnect.">
  <img src="https://mintcdn.com/wisty/p0KgmgXmvqDkXTFQ/images/connected-orgs.png?fit=max&auto=format&n=p0KgmgXmvqDkXTFQ&q=85&s=5717a729393dda135f482a7f82a1203f" alt="Connected orgs page with two orgs. ACME Prod is Connected and marked Default. ACME Sandbox shows Connection error with the message Salesforce session expired. Reconnect this org." width="2000" height="700" data-path="images/connected-orgs.png" />
</Frame>

If an admin has removed your Salesforce access, they may need to restore it before reconnecting will work. See [Fix common problems](/docs/help/troubleshooting) for other connection issues.

## What the connection allows

Wisty's Salesforce integration supplies object and field metadata to the generating AI. It doesn't retrieve Salesforce records for generation. The preview and published app access records through your Salesforce connection, subject to your Salesforce permissions and the app's [access settings](/docs/building/salesforce-access).

Salesforce credentials stay encrypted on Wisty's servers. They aren't passed to generated code. See [How Wisty uses your data](/docs/security/data-handling).
