# Open Valstorm Salesforce CRM & OpenCTI Plugin (`valstorm-plugin-salesforce`) Connects **Salesforce CRM (SOQL, Composite sObject CRUD, Bulk API 2.0, `ContentVersion` File Uploads, and ValPhone/ValRM for Salesforce OpenCTI)** to Open Valstorm (`platform.salesforce` & `platform.integrations.salesforce`). --- ## 🤖 Agent-Assisted Quick Setup (Let the Valstorm Agent Set It Up) ### 1. Minimal Human Prerequisite Install the Salesforce CLI and authenticate to your org: ```bash brew install sf sf org login web --alias my-sfdc ``` ### 2. Copy-Paste Prompt for Your Valstorm Agent ```text Set up the Salesforce plugin (`valstorm-plugin-salesforce`) for my workspace using `plugins/valstorm-plugin-salesforce/README.md`: 1. Retrieve the active `instanceUrl` and `accessToken` via `sf org display --target-org my-sfdc --json`. 2. Save the credentials via `salesforce_save_credentials`. 3. Verify SOQL connectivity via `salesforce_verify_connection`. ``` --- ## 🛠️ End-to-End DIY Setup Guide ### Step 1: Create a Salesforce Connected App 1. In **Salesforce Setup -> App Manager -> New Connected App**, enable **OAuth Settings**. 2. Set the **Callback URL** to `https:///v1/salesforce/auth/callback`. 3. Add OAuth Scopes: `Manage user data via APIs (api)` and `Perform requests at any time (refresh_token, offline_access)`. 4. Copy the **Consumer Key** (`client_id`) and **Consumer Secret** (`client_secret`). ### Step 2: Save Credentials in Valstorm ```python await platform.salesforce.save_credentials( instance_url="https://yourdomain.my.salesforce.com", client_id="YOUR_CONNECTED_APP_KEY", client_secret="YOUR_CONNECTED_APP_SECRET", access_token="00D...", refresh_token="5Aep...", ) ``` ### Step 3: Run Tests ```bash uv run --project apps/open-api pytest apps/open-api/tests/test_plugin_salesforce_and_pdf.py -v ```