/salesforce-pack:salesforce-install-authfrom salesforce-pack
Installs jsforce or simple-salesforce and configures OAuth 2.0 authentication (username-password, JWT bearer, or web server flow) for Salesforce connectivity.
Ships in salesforce-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Set up Salesforce connectivity using jsforce (Node.js) or simple-salesforce (Python), and configure one of three OAuth 2.0 authentication flows.
api, refresh_token, offline_access# Node.js — jsforce (most popular SF client, 3M+ weekly downloads)
npm install jsforce
# Python — simple-salesforce
pip install simple-salesforce
# Salesforce CLI (for metadata, deployment, scratch orgs)
npm install -g @salesforce/cli
| Flow | Use Case | Requires Browser? |
|---|---|---|
| Username-Password | Dev/test scripts | No |
| JWT Bearer | CI/CD, server-to-server | No |
| Web Server (Authorization Code) | User-facing apps | Yes |
# .env (NEVER commit — add .env to .gitignore)
SF_LOGIN_URL=https://login.salesforce.com
[email protected]
SF_PASSWORD=yourpassword
SF_SECURITY_TOKEN=yourtoken
SF_CLIENT_ID=your_connected_app_consumer_key
SF_CLIENT_SECRET=your_connected_app_consumer_secret
# For sandbox orgs, use:
# SF_LOGIN_URL=https://test.salesforce.com
import jsforce from 'jsforce';
const conn = new jsforce.Connection({
loginUrl: process.env.SF_LOGIN_URL || 'https://login.salesforce.com',
});
await conn.login(
process.env.SF_USERNAME!,
process.env.SF_PASSWORD! + process.env.SF_SECURITY_TOKEN!
);
console.log('Connected to:', conn.instanceUrl);
console.log('User ID:', conn.userInfo?.id);
console.log('Org ID:', conn.userInfo?.organizationId);
import jsforce from 'jsforce';
import fs from 'fs';
const conn = new jsforce.Connection({
loginUrl: process.env.SF_LOGIN_URL,
// JWT requires a Connected App with a digital certificate
});
await conn.authorize({
grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',
client_id: process.env.SF_CLIENT_ID!,
username: process.env.SF_USERNAME!,
privateKeyFile: './server.key', // RSA private key from your certificate
});
import jsforce from 'jsforce';
const oauth2 = new jsforce.OAuth2({
loginUrl: process.env.SF_LOGIN_URL,
clientId: process.env.SF_CLIENT_ID!,
clientSecret: process.env.SF_CLIENT_SECRET!,
redirectUri: 'https://yourapp.com/oauth/callback',
});
// Step A: Redirect user to authorization URL
const authUrl = oauth2.getAuthorizationUrl({ scope: 'api refresh_token' });
// Step B: Handle callback — exchange code for tokens
const conn = new jsforce.Connection({ oauth2 });
await conn.authorize(authorizationCode);
// conn.accessToken and conn.refreshToken are now set
// Quick verification — query org info
const identity = await conn.identity();
console.log('Username:', identity.username);
console.log('Display Name:', identity.display_name);
// Check API version
const versions = await conn.request('/services/data/');
console.log('Latest API version:', versions[versions.length - 1].version);
from simple_salesforce import Salesforce
import os
# Username-Password flow
sf = Salesforce(
username=os.environ['SF_USERNAME'],
password=os.environ['SF_PASSWORD'],
security_token=os.environ['SF_SECURITY_TOKEN'],
domain='test' if os.environ.get('SF_SANDBOX') else None # 'test' for sandbox
)
# Verify connection
print(f"Connected to: {sf.sf_instance}")
result = sf.query("SELECT Id, Name FROM Organization")
print(f"Org: {result['records'][0]['Name']}")
| Error | Cause | Solution |
|---|---|---|
INVALID_LOGIN | Wrong username/password/token | Verify credentials; reset security token in Setup > My Personal Information |
INVALID_CLIENT_ID | Wrong Connected App consumer key | Check Setup > App Manager > your app |
INVALID_GRANT | JWT cert mismatch or user not pre-authorized | Upload cert to Connected App; pre-authorize user profile |
LOGIN_MUST_USE_SECURITY_TOKEN | Missing security token | Append token to password or whitelist your IP in Setup |
API_DISABLED_FOR_ORG | API not enabled | Requires Enterprise, Unlimited, Developer, or Performance edition |
REQUEST_LIMIT_EXCEEDED | Daily API limit hit | Check Setup > Company Information for remaining calls |
After successful auth, proceed to salesforce-hello-world for your first SOQL query.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub flight505/skill-forge --plugin salesforce-pack30 skills in this plugin
/salesforce-advanced-troubleshootingApply Salesforce advanced debugging with debug logs, SOQL query plans, and EventLogFile analysis.
Use when standard troubleshooting fails, investigating SOQL performance issues,
or analyzing Apex governor limit violations.
Trigger with phrases like "salesforce hard bug", "salesforce debug log",
"salesforce governor limit", "salesforce query plan", "salesforce deep debug", "SOQL slow".
/salesforce-architecture-variantsChoose and implement Salesforce integration architecture patterns for different scales.
Use when designing new Salesforce integrations, choosing between polling/event-driven/Heroku Connect,
or planning migration paths for Salesforce applications.
Trigger with phrases like "salesforce architecture", "salesforce integration pattern",
"how to structure salesforce integration", "salesforce event-driven", "salesforce Heroku Connect".
/salesforce-ci-integrationConfigure Salesforce CI/CD with GitHub Actions, SFDX deployments, and Apex testing.
Use when setting up automated testing, configuring CI pipelines for metadata deployment,
or integrating Salesforce tests into your build process.
Trigger with phrases like "salesforce CI", "salesforce GitHub Actions",
"salesforce automated tests", "CI salesforce", "sfdx deploy CI".
Other plugins' skills for the same job