wirl 0.1.0 → 0.1.1
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/README.md +106 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Wirl
|
|
2
|
+
|
|
3
|
+
Email sequence automation for developers.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install wirl
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import Wirl from 'wirl';
|
|
15
|
+
|
|
16
|
+
const wirl = new Wirl({
|
|
17
|
+
apiKey: 'sk_test_...',
|
|
18
|
+
baseUrl: 'https://your-wirl-instance.vercel.app'
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// Track events
|
|
22
|
+
await wirl.track({
|
|
23
|
+
email: 'user@example.com',
|
|
24
|
+
event: 'user.signup',
|
|
25
|
+
properties: { plan: 'pro' }
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Update contact properties
|
|
29
|
+
await wirl.identify({
|
|
30
|
+
email: 'user@example.com',
|
|
31
|
+
properties: {
|
|
32
|
+
name: 'John Doe',
|
|
33
|
+
company: 'Acme Inc'
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// Manually trigger a sequence
|
|
38
|
+
await wirl.trigger({
|
|
39
|
+
email: 'user@example.com',
|
|
40
|
+
sequence: 'Welcome Sequence'
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// Remove from a sequence
|
|
44
|
+
await wirl.exit({
|
|
45
|
+
email: 'user@example.com',
|
|
46
|
+
sequence: 'Welcome Sequence'
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## API
|
|
51
|
+
|
|
52
|
+
### `new Wirl(options)`
|
|
53
|
+
|
|
54
|
+
| Option | Type | Required | Description |
|
|
55
|
+
|--------|------|----------|-------------|
|
|
56
|
+
| `apiKey` | string | Yes | Your Wirl API key |
|
|
57
|
+
| `baseUrl` | string | No | API base URL (default: `https://api.wirl.dev`) |
|
|
58
|
+
|
|
59
|
+
### `wirl.track(params)`
|
|
60
|
+
|
|
61
|
+
Track an event for a contact. Creates the contact if they don't exist.
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
await wirl.track({
|
|
65
|
+
email: 'user@example.com',
|
|
66
|
+
event: 'purchase.completed',
|
|
67
|
+
properties: { amount: 99.99 }
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### `wirl.identify(params)`
|
|
72
|
+
|
|
73
|
+
Create or update a contact with properties.
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
await wirl.identify({
|
|
77
|
+
email: 'user@example.com',
|
|
78
|
+
properties: { name: 'John', plan: 'enterprise' }
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### `wirl.trigger(params)`
|
|
83
|
+
|
|
84
|
+
Manually enroll a contact in a sequence.
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
await wirl.trigger({
|
|
88
|
+
email: 'user@example.com',
|
|
89
|
+
sequence: 'Onboarding'
|
|
90
|
+
});
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### `wirl.exit(params)`
|
|
94
|
+
|
|
95
|
+
Remove a contact from an active sequence.
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
await wirl.exit({
|
|
99
|
+
email: 'user@example.com',
|
|
100
|
+
sequence: 'Onboarding'
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
|
|
106
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wirl",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Wirl SDK for email sequence automation",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
|
-
"dist"
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
17
18
|
],
|
|
18
19
|
"scripts": {
|
|
19
20
|
"build": "tsup src/index.ts --format cjs,esm --dts",
|