Connect to Salesforce CRM with OAuth support. Query, create, and update Salesforce objects seamlessly.
Official Salesforce CRM integration with full API support.
ostack add driver-salesforce
import { SalesforceDriver } from '@objectstack/driver-salesforce';
const sf = new SalesforceDriver({
clientId: process.env.SF_CLIENT_ID,
clientSecret: process.env.SF_CLIENT_SECRET,
redirectUri: 'http://localhost:3000/callback'
});
// Authenticate
await sf.authenticate();
// Query records
const accounts = await sf.query('SELECT Id, Name FROM Account LIMIT 10');
// Create record
const newContact = await sf.create('Contact', {
FirstName: 'John',
LastName: 'Doe',
Email: 'john@example.com'
});
// Update record
await sf.update('Contact', contactId, {
Phone: '555-1234'
});
// Insert multiple records efficiently
const jobs = await sf.bulk.insert('Account', [
{ Name: 'Company A' },
{ Name: 'Company B' },
{ Name: 'Company C' }
]);
MIT © ObjectStack Team