@orchestree/crm
v1.0.0
Published
CRM module — Contacts, companies, deals, pipelines, activities
Maintainers
Readme
@orchestree/crm
CRM module — Contacts, companies, deals, pipelines, and activities for Orchestree.
Installation
npm install @orchestree/crmQuick Start
import { CRMClient } from '@orchestree/crm';
const client = new CRMClient({
apiKey: 'your-api-key',
});
// Create a contact
const contact = await client.createContact({
firstName: 'Jane',
lastName: 'Doe',
email: '[email protected]',
status: 'lead',
});
// Create a deal
const deal = await client.createDeal({
title: 'Enterprise License',
value: 50000,
currency: 'USD',
contactId: contact.id,
pipelineId: 'default',
});
// Log an activity
await client.logActivity({
type: 'call',
subject: 'Discovery call with Jane',
contactId: contact.id,
dealId: deal.id,
});API Reference
CRMClient
listContacts(params)
List contacts with optional filters.
const contacts = await client.listContacts({ status: 'lead' });getContact(contactId)
Get contact by ID.
const contact = await client.getContact('contact-id');createContact(contactDef)
Create a new contact.
const contact = await client.createContact({
firstName: 'John',
lastName: 'Smith',
email: '[email protected]',
});updateContact(contactId, updates)
Update contact fields.
await client.updateContact('contact-id', { status: 'customer' });deleteContact(contactId)
Delete a contact.
await client.deleteContact('contact-id');listCompanies(params) / getCompany(companyId) / createCompany(companyDef)
Manage companies.
const companies = await client.listCompanies();
const company = await client.createCompany({ name: 'Acme Corp', industry: 'Technology' });listDeals(params) / getDeal(dealId) / createDeal(dealDef) / updateDealStage(dealId, stage)
Manage deals and pipeline stages.
const deals = await client.listDeals({ status: 'open' });
await client.updateDealStage('deal-id', 'negotiation');listPipelines() / getPipeline(pipelineId)
View sales pipelines.
const pipelines = await client.listPipelines();listActivities(params) / logActivity(activityDef)
Track sales activities.
await client.logActivity({
type: 'meeting',
subject: 'Product demo',
contactId: 'contact-id',
});License
MIT
