dragxcel
v1.0.4
Published
Official SDK for the DragXcel API Platform — automate personalized certificate and email generation at scale.
Maintainers
Readme
DragXcel SDK
Official Node.js client for the DragXcel API Platform — automate personalized certificate and email generation at scale.
Installation
npm install dragxcelHow it Works (The Workflow)
- Connect Your Data (using User-End API Key and Protection Key).
- Design Your Template on the DragXcel Platform.
- Automate Everything (using your Server-End API Key).
Usage
1. Connect Your Data (Data Bridge)
This is always the first step. You register your existing API endpoint so DragXcel can fetch your columns and data.
const { DragXcel } = require('dragxcel');
const dxl = new DragXcel(); // No server key needed yet
await dxl.connect({
userKey: 'dxl_user_your_project_id',
protectionKey: 'dxl_prot_your_secret_key',
endpoint: 'https://your-website.com/api/members'
});
console.log("Data source connected successfully!");2. Automate (Bulk Generation & Sending)
After you've designed your template and mapped your fields on the platform, you can use your Server-End API Key to automate the process.
// Initialize with your Server Key
const dxl = new DragXcel({
serverKey: 'dxl_srv_your_api_key'
});
// Generate and Send to everyone matching a filter
const result = await dxl.send({
subject: 'Your Completion Certificate',
filter: [
{ column: 'Attendance%', operator: 'gte', value: 75 }
],
smtp: [
{ email: '[email protected]', password: 'xxx', host: 'smtp.gmail.com', port: 465 }
]
});
console.log(result.jobId);3. Real-time Single Generation
Generate a certificate for a one-off event (e.g., as soon as a user clicks a button).
const cert = await dxl.generateOne({
data: {
Name: 'Arun Sharma',
ID: 'CSE001'
},
format: 'png'
});4. Check status
const status = await dxl.status('job_abc123');
console.log(status.sent); // How many emails have been sent so far5. Utility: Local Filtering
Use the same filtering logic as the DragXcel platform on your own local data arrays.
const data = [
{ name: 'Arun', score: 85 },
{ name: 'Sita', score: 60 }
];
const rules = [{ column: 'score', operator: 'gte', value: 75 }];
const filtered = DragXcel.filterData(data, rules);
// [{ name: 'Arun', score: 85 }]Filter Operators
| Category | Operator | Description |
|----------|----------|-------------|
| Text | contains | Value contains the filter string |
| Text | equals | Exact match |
| Text | starts_with | Value starts with filter string |
| Numeric | gt / gte | Greater than / or equal |
| Numeric | lt / lte | Less than / or equal |
License
MIT
