@clianta/sdk 1.1.1 → 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 +69 -0
- package/README.md +71 -1
- package/dist/clianta.cjs.js +1393 -225
- package/dist/clianta.cjs.js.map +1 -1
- package/dist/clianta.esm.js +1393 -226
- package/dist/clianta.esm.js.map +1 -1
- package/dist/clianta.umd.js +1393 -225
- package/dist/clianta.umd.js.map +1 -1
- package/dist/clianta.umd.min.js +2 -2
- package/dist/clianta.umd.min.js.map +1 -1
- package/dist/index.d.ts +596 -6
- package/dist/react.cjs.js +1393 -226
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.esm.js +1393 -226
- package/dist/react.esm.js.map +1 -1
- package/dist/vue.cjs.js +3900 -0
- package/dist/vue.cjs.js.map +1 -0
- package/dist/vue.d.ts +201 -0
- package/dist/vue.esm.js +3893 -0
- package/dist/vue.esm.js.map +1 -0
- package/package.json +16 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,75 @@ 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
|
+
|
|
25
|
+
## [1.2.0] - 2026-02-02
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
- **Companies API** - Full CRUD operations for company management
|
|
29
|
+
- `getCompanies()`, `getCompany()`, `createCompany()`, `updateCompany()`, `deleteCompany()`
|
|
30
|
+
- `getCompanyContacts()` - Retrieve all contacts associated with a company
|
|
31
|
+
- `getCompanyDeals()` - Retrieve all deals associated with a company
|
|
32
|
+
- **Pipelines API** - Manage sales pipelines and stages
|
|
33
|
+
- `getPipelines()`, `getPipeline()`, `createPipeline()`, `updatePipeline()`, `deletePipeline()`
|
|
34
|
+
- **Tasks API** - Task management for CRM workflows
|
|
35
|
+
- `getTasks()`, `getTask()`, `createTask()`, `updateTask()`, `deleteTask()`
|
|
36
|
+
- `completeTask()` - Mark a task as completed
|
|
37
|
+
- **Activities API** - Full activity logging system
|
|
38
|
+
- `getContactActivities()`, `getOpportunityActivities()`
|
|
39
|
+
- `createActivity()`, `updateActivity()`, `deleteActivity()`
|
|
40
|
+
- `logCall()` - Quick helper for logging phone calls
|
|
41
|
+
- `logMeeting()` - Quick helper for logging meetings
|
|
42
|
+
- `addNote()` - Quick helper for adding notes to contacts/opportunities
|
|
43
|
+
- **New TypeScript Types** - Added `Company`, `Pipeline`, `PipelineStage`, `Task`, `Activity` interfaces
|
|
44
|
+
- **26 new unit tests** for CRM API methods (76 total tests)
|
|
45
|
+
|
|
46
|
+
## [1.1.1] - 2026-02-01
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
- **Security:** Fixed XSS vulnerability in PopupForms plugin - now uses safe DOM APIs instead of innerHTML
|
|
50
|
+
- **Memory Leak:** Fixed PageViewPlugin not cleaning up History API patches and popstate listeners on destroy
|
|
51
|
+
- **Memory Leak:** Added max buffer size (100 events) to consent manager to prevent unbounded memory growth
|
|
52
|
+
- **Race Condition:** Fixed potential race condition in queue flush when events pushed during flush
|
|
53
|
+
- **Divide by Zero:** Fixed scroll depth plugin crash on pages shorter than viewport
|
|
54
|
+
|
|
55
|
+
### Changed
|
|
56
|
+
- Performance plugin now uses modern `PerformanceNavigationTiming` API with fallback for older browsers
|
|
57
|
+
- Plugin interface now supports async `init()` methods
|
|
58
|
+
- Tracker `destroy()` method is now async and properly awaits queue flush
|
|
59
|
+
|
|
60
|
+
### Added
|
|
61
|
+
- Client-side rate limiting (100 events per minute) to prevent event flooding
|
|
62
|
+
- Unit test suite with 50+ tests covering core modules (queue, transport, consent, utils)
|
|
63
|
+
|
|
64
|
+
## [1.1.0] - 2026-01-31
|
|
65
|
+
|
|
66
|
+
### Added
|
|
67
|
+
- PopupForms plugin for lead capture popups with multiple trigger types (delay, scroll, exit intent, click)
|
|
68
|
+
- React integration with `CliantaProvider`, `useClianta()`, and `useCliantaTrack()` hooks
|
|
69
|
+
- GDPR right-to-erasure via `deleteData()` method
|
|
70
|
+
- Anonymous tracking mode for pre-consent data collection
|
|
71
|
+
- Event buffering when `waitForConsent` is enabled
|
|
72
|
+
|
|
73
|
+
### Changed
|
|
74
|
+
- Updated SDK_VERSION constant to track version properly
|
|
75
|
+
- Improved TypeScript type exports
|
|
76
|
+
|
|
8
77
|
## [1.0.0] - 2026-01-30
|
|
9
78
|
|
|
10
79
|
### 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:
|