@clianta/sdk 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,23 @@ All notable changes to the Clianta SDK will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.3.0] - 2026-02-17
9
+
10
+ ### Added
11
+ - **ContactUpdateAction Type** - New trigger action type for automatically updating contact fields when triggers fire
12
+ - Supports partial contact updates via `updates: Partial<Contact>`
13
+ - **TriggerExecution Interface** - Full execution tracking for event triggers
14
+ - Fields: `triggerId`, `eventType`, `entityId`, `status`, `error`, `actionsExecuted`, `executedAt`
15
+ - Status tracking: `pending`, `success`, `failed`
16
+ - **deleteEventTrigger()** - New CRM client method to delete event triggers by ID
17
+ - `crm.deleteEventTrigger(triggerId)` - removes a trigger from the workspace
18
+ - **Vue Type Augmentation** - Added `ComponentCustomProperties` declaration for `$clianta` global property
19
+ - Enables type-safe access to tracker via Options API in Vue components
20
+ - **Export: ContactUpdateAction** - Now exported from main SDK entry point
21
+
22
+ ### Changed
23
+ - `TriggerAction` union type now includes `ContactUpdateAction` alongside `EmailAction`, `WebhookAction`, and `TaskAction`
24
+
8
25
  ## [1.2.0] - 2026-02-02
9
26
 
10
27
  ### Added
package/README.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Clianta SDK
2
2
 
3
- Professional CRM and tracking SDK for lead generation. Works with any website or JavaScript framework.
3
+ Professional CRM and tracking SDK for lead generation with **automated email triggers** and workflows. Works with any website or JavaScript framework.
4
+
5
+ ## ✨ Key Features
6
+
7
+ - 📊 **Visitor & Event Tracking** - Track page views, clicks, forms, and custom events
8
+ - 👥 **CRM Management** - Contacts, companies, opportunities, tasks, and activities
9
+ - 🤖 **Event Triggers & Automation** - Automated emails, tasks, and webhooks (like Salesforce & HubSpot)
10
+ - 📧 **Email Notifications** - Send automated emails based on CRM actions
11
+ - 🔒 **GDPR Compliant** - Built-in consent management
12
+ - ⚡ **Framework Agnostic** - Works with React, Vue, Next.js, or vanilla JavaScript
4
13
 
5
14
  ## Installation
6
15
 
@@ -431,6 +440,67 @@ import {
431
440
 
432
441
  ---
433
442
 
443
+ ## Event Triggers & Automation
444
+
445
+ Automate your workflows with event-driven triggers. Send emails, create tasks, or call webhooks when specific actions occur.
446
+
447
+ ### Quick Example
448
+
449
+ ```typescript
450
+ import { CRMClient } from '@clianta/sdk';
451
+
452
+ const crm = new CRMClient(
453
+ 'https://api.clianta.online',
454
+ 'your-workspace-id',
455
+ 'your-auth-token'
456
+ );
457
+
458
+ // Send welcome email when a contact is created
459
+ await crm.createEventTrigger({
460
+ name: 'Welcome Email',
461
+ eventType: 'contact.created',
462
+ actions: [
463
+ {
464
+ type: 'send_email',
465
+ to: '{{contact.email}}',
466
+ subject: 'Welcome to Our Platform!',
467
+ body: 'Hello {{contact.firstName}}, welcome aboard!',
468
+ }
469
+ ],
470
+ isActive: true,
471
+ });
472
+
473
+ // Create task when high-value opportunity is created
474
+ await crm.triggers.createTaskTrigger({
475
+ name: 'Follow-up Task',
476
+ eventType: 'opportunity.created',
477
+ taskTitle: 'Call {{contact.firstName}} about {{opportunity.title}}',
478
+ priority: 'high',
479
+ dueDays: 1,
480
+ conditions: [
481
+ { field: 'value', operator: 'greater_than', value: 10000 }
482
+ ],
483
+ });
484
+ ```
485
+
486
+ ### Supported Event Types
487
+
488
+ - **Contact Events**: `contact.created`, `contact.updated`, `contact.deleted`
489
+ - **Opportunity Events**: `opportunity.created`, `opportunity.won`, `opportunity.stage_changed`
490
+ - **Task Events**: `task.created`, `task.completed`, `task.overdue`
491
+ - **Activity Events**: `activity.logged`, `form.submitted`
492
+
493
+ ### Action Types
494
+
495
+ 1. **Send Email** - Automated email notifications with template variables
496
+ 2. **Create Task** - Auto-create follow-up tasks
497
+ 3. **Webhook** - Call external services (Slack, Zapier, etc.)
498
+ 4. **Update Contact** - Automatically update contact fields
499
+
500
+ 📚 **[Full Event Triggers Documentation](./docs/EVENT_TRIGGERS.md)**
501
+
502
+ ---
503
+
434
504
  ## Self-Hosted
435
505
 
436
506
  For self-hosted deployments, configure the API endpoint: