@churnsignal/churnsignal-sdk-web 0.1.5 → 0.1.6
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 +1 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ npm install @churnsignal/churnsignal-sdk-web
|
|
|
14
14
|
The SDK only requires your API key. All configuration (workspaceId, tenantId, baseUrl) is automatically extracted from the API key.
|
|
15
15
|
|
|
16
16
|
```typescript
|
|
17
|
-
import { initialise,
|
|
17
|
+
import { initialise, track } from '@churnsignal/churnsignal-sdk-web';
|
|
18
18
|
|
|
19
19
|
// Initialize with your API key
|
|
20
20
|
const success = initialise(API_KEY);
|
|
@@ -43,19 +43,6 @@ track('purchase_completed', {
|
|
|
43
43
|
}, 'user@example.com');
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
**Note:** You can also use `identify()` to set the user email once, then call `track()` without the email parameter:
|
|
47
|
-
|
|
48
|
-
```typescript
|
|
49
|
-
import { initialise, identify, track } from '@churnsignal/churnsignal-sdk-web';
|
|
50
|
-
|
|
51
|
-
initialise('your-api-key-here');
|
|
52
|
-
identify({ email: 'user@example.com' });
|
|
53
|
-
|
|
54
|
-
// Now you can track without passing email each time
|
|
55
|
-
track('page_viewed', { page: '/home' });
|
|
56
|
-
track('product_viewed', { productId: 'abc123' });
|
|
57
|
-
```
|
|
58
|
-
|
|
59
46
|
### Complete Example
|
|
60
47
|
|
|
61
48
|
```typescript
|
package/package.json
CHANGED