# Salesforce

To use Salesforce with PixieBrix, you’ll need to set up an integration.

### Create an OAuth2 App in Salesforce

Follow the [Enable OAuth Settings for API Integration](https://help.salesforce.com/s/articleView?id=sf.connected_app_create_api_integration.htm\&type=5) in the Salesforce documentation. Some notes:

* Add the following **Callback URLs**:&#x20;
  * PixieBrix: `https://mpjjildhmpddojocokjkgmlkkkfjnepo.chromiumapp.org/oauth2`
  * PixieBrix BETA: `https://mpapkmgkphbggmlekkfnoilmafnbfile.chromiumapp.org/oauth2`
* Select **Require Proof Key for Code Exchange (PKCE) Extension for Supported Authorization Flows**
* Deselect **Require Secret for Web Server Flow**
* Your OAuth2 settings should look similar to the image below but catered to your use case

<figure><img src="https://2274778196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq123bF1HPQPV35s5vHa1%2Fuploads%2FjAcC2payJmYcIhICUijJ%2FScreenshot%202024-01-22%20at%209.10.22%E2%80%AFPM.png?alt=media&#x26;token=d9098e55-4c43-413a-85a3-0926ed214ee6" alt=""><figcaption></figcaption></figure>

### Create a Salesforce Integration in PixieBrix

{% hint style="info" %}
To set up a cloud integration that your team can access, head to the [Admin Console](https://app.pixiebrix.com/). *If you'd rather set up something locally, use the Extension Console. Learn more in* [configuring-integrations](https://docs.pixiebrix.com/integrations/configuring-integrations "mention").
{% endhint %}

From the **Integrations** section in the Admin or Extension Console, click the **+** **Add Integration** button in the top right corne&#x72;**.**

Search for and select one of the following Salesforce integrations:

* [Salesforce OAuth2 PKCE](https://www.pixiebrix.com/marketplace/a676c1e9-cac7-4897-b880-c99d2555dcdd/) (recommended because requests are made directly to Salesforce instead of having to route through the PixieBrix API gateway)
* [Salesforce OAuth2](https://www.pixiebrix.com/marketplace/8b3d6921-6ed3-4e8f-be4a-36a39829ead6/)

<figure><img src="https://2274778196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq123bF1HPQPV35s5vHa1%2Fuploads%2FbZE58MVqnmU3SHa58eSn%2FScreenshot%202024-01-22%20at%209.32.35%E2%80%AFPM.png?alt=media&#x26;token=de737d41-72b9-4443-8c70-a8d6056cb292" alt=""><figcaption></figcaption></figure>

Name your configuration something clear to you and fill out the rest of the form with values provided when registering your Salesforce application. Some notes:

* To get the client id, follow the [Salesforce documentation](https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_web_server_flow.htm\&type=5):

> To access the consumer key, from the App Manager, find the connected app, and select View from the dropdown. Then click Manage Consumer Details. You’re sometimes prompted to verify your identity before you can view the consumer key.

<figure><img src="https://2274778196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fq123bF1HPQPV35s5vHa1%2Fuploads%2F7qBCSxwrao6JoFXZr0WD%2FScreenshot%202024-01-22%20at%209.52.06%E2%80%AFPM.png?alt=media&#x26;token=4af1ec91-8229-47ad-b96c-405f7a6679a3" alt=""><figcaption></figcaption></figure>

Click **Save,** and your integration will be ready for use in any [Salesforce mods](https://www.pixiebrix.com/marketplace/search/?tags=salesforce) and bricks. Notable bricks include:

* [Get Salesforce Cases](https://www.pixiebrix.com/marketplace/e6132467-834d-49a9-889b-2b990e1d7669/)
* [Create Salesforce Case](https://www.pixiebrix.com/marketplace/d9f3842d-c782-4c94-be41-d8cb6fd07853/)
