pishoniq-tracker 2.0.0 → 2.0.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 +10 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ Browser analytics SDK for PishonIQ. Track user events, sessions, and behavior in
|
|
|
18
18
|
### npm
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
npm install pishoniq
|
|
21
|
+
npm install pishoniq-tracker
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
Or using yarn:
|
|
@@ -30,10 +30,10 @@ yarn add pishoniq
|
|
|
30
30
|
### CDN script tag
|
|
31
31
|
|
|
32
32
|
```html
|
|
33
|
-
<script src="https://cdn.jsdelivr.net/npm/pishoniq@2.0.0/dist/browser.global.js"></script>
|
|
33
|
+
<script src="https://cdn.jsdelivr.net/npm/pishoniq-tracker@2.0.0/dist/browser.global.js"></script>
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
The script exposes `window.PishonIQ`. Use `https://unpkg.com/pishoniq@2.0.0/dist/browser.global.js` as an alternative CDN.
|
|
36
|
+
The script exposes `window.PishonIQ`. Use `https://unpkg.com/pishoniq-tracker@2.0.0/dist/browser.global.js` as an alternative CDN.
|
|
37
37
|
|
|
38
38
|
---
|
|
39
39
|
|
|
@@ -42,7 +42,7 @@ The script exposes `window.PishonIQ`. Use `https://unpkg.com/pishoniq@2.0.0/dist
|
|
|
42
42
|
### Option 1: Vanilla JavaScript (Any Framework)
|
|
43
43
|
|
|
44
44
|
```javascript
|
|
45
|
-
import PishonIQ from 'pishoniq';
|
|
45
|
+
import PishonIQ from 'pishoniq-tracker';
|
|
46
46
|
|
|
47
47
|
// Initialize with your API key and backend host
|
|
48
48
|
PishonIQ.init({
|
|
@@ -65,7 +65,7 @@ PishonIQ.page('Checkout');
|
|
|
65
65
|
|
|
66
66
|
```html
|
|
67
67
|
<!-- Add before </body> -->
|
|
68
|
-
<script src="https://cdn.jsdelivr.net/npm/pishoniq@2.0.0/dist/browser.global.js"></script>
|
|
68
|
+
<script src="https://cdn.jsdelivr.net/npm/pishoniq-tracker@2.0.0/dist/browser.global.js"></script>
|
|
69
69
|
<script>
|
|
70
70
|
window.PishonIQ.init({
|
|
71
71
|
apiKey: 'pk_live_xxxxxxxxxxxx',
|
|
@@ -79,7 +79,7 @@ PishonIQ.page('Checkout');
|
|
|
79
79
|
If you point the script at `defer`, initialize inside `DOMContentLoaded` instead of immediately:
|
|
80
80
|
|
|
81
81
|
```html
|
|
82
|
-
<script src="https://cdn.jsdelivr.net/npm/pishoniq@2.0.0/dist/browser.global.js" defer></script>
|
|
82
|
+
<script src="https://cdn.jsdelivr.net/npm/pishoniq-tracker@2.0.0/dist/browser.global.js" defer></script>
|
|
83
83
|
<script>
|
|
84
84
|
window.addEventListener('DOMContentLoaded', function () {
|
|
85
85
|
window.PishonIQ.init({ apiKey: 'pk_live_xxxxxxxxxxxx', host: 'https://your-pishoniq-backend.com' });
|
|
@@ -98,7 +98,7 @@ Self-hosted fallback: `https://your-pishoniq-backend.com/sdk/pishoniq.sdk.js`.
|
|
|
98
98
|
```tsx
|
|
99
99
|
// main.jsx or App.jsx
|
|
100
100
|
import { BrowserRouter } from 'react-router-dom';
|
|
101
|
-
import { PishonIQProvider } from 'pishoniq/react';
|
|
101
|
+
import { PishonIQProvider } from 'pishoniq-tracker/react';
|
|
102
102
|
import App from './App';
|
|
103
103
|
|
|
104
104
|
function Root() {
|
|
@@ -121,7 +121,7 @@ export default Root;
|
|
|
121
121
|
|
|
122
122
|
```tsx
|
|
123
123
|
// components/SignupButton.jsx
|
|
124
|
-
import { usePishonIQ } from 'pishoniq/react';
|
|
124
|
+
import { usePishonIQ } from 'pishoniq-tracker/react';
|
|
125
125
|
|
|
126
126
|
function SignupButton() {
|
|
127
127
|
const { track } = usePishonIQ();
|
|
@@ -140,7 +140,7 @@ function SignupButton() {
|
|
|
140
140
|
```tsx
|
|
141
141
|
// contexts/AuthContext.jsx
|
|
142
142
|
import { useEffect } from 'react';
|
|
143
|
-
import { usePishonIQ } from 'pishoniq/react';
|
|
143
|
+
import { usePishonIQ } from 'pishoniq-tracker/react';
|
|
144
144
|
import { useAuth } from './useAuth';
|
|
145
145
|
|
|
146
146
|
function AuthProvider({ children }) {
|
|
@@ -307,7 +307,7 @@ Add `data-pishon` attribute to track specific elements:
|
|
|
307
307
|
Access the PishonIQ instance and auto-tracking functions.
|
|
308
308
|
|
|
309
309
|
```tsx
|
|
310
|
-
import { usePishonIQ } from 'pishoniq/react';
|
|
310
|
+
import { usePishonIQ } from 'pishoniq-tracker/react';
|
|
311
311
|
|
|
312
312
|
function MyComponent() {
|
|
313
313
|
const { track, identify, page } = usePishonIQ();
|