@masa-finance/analytics-react
Advanced tools
Comparing version 0.13.8 to 0.13.9
@@ -5,7 +5,7 @@ import { BaseEventData, EventType } from '@masa-finance/analytics-sdk'; | ||
type: EventType; | ||
user_address?: string | undefined; | ||
user_address?: string; | ||
event_data: BaseEventData; | ||
endpoint: string; | ||
client_id?: string | undefined; | ||
client_id?: string; | ||
}) => Promise<Event | undefined>; | ||
}; |
@@ -42,16 +42,14 @@ "use strict"; | ||
var useEventLogger = function () { | ||
var logEvent = (0, react_1.useCallback)(function (_a) { | ||
var type = _a.type, user_address = _a.user_address, client_id = _a.client_id, event_data = _a.event_data, endpoint = _a.endpoint; | ||
return __awaiter(void 0, void 0, void 0, function () { | ||
return __generator(this, function (_b) { | ||
return [2 /*return*/, logEvent({ | ||
type: type, | ||
user_address: user_address, | ||
client_id: client_id, | ||
event_data: event_data, | ||
endpoint: endpoint, | ||
})]; | ||
}); | ||
var logEvent = (0, react_1.useCallback)(function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) { | ||
var type = _b.type, user_address = _b.user_address, client_id = _b.client_id, event_data = _b.event_data, endpoint = _b.endpoint; | ||
return __generator(this, function (_c) { | ||
return [2 /*return*/, logEvent({ | ||
type: type, | ||
user_address: user_address, | ||
client_id: client_id, | ||
event_data: event_data, | ||
endpoint: endpoint, | ||
})]; | ||
}); | ||
}, []); | ||
}); }, []); | ||
return { | ||
@@ -58,0 +56,0 @@ logEvent: logEvent, |
@@ -1,2 +0,2 @@ | ||
import { FireConnectWalletEventArgs, FireEventArgs, FireLoginEventArgs, FireMintEventArgs, FirePageViewEventArgs, FireTrackCustomEventArgs } from '@masa-finance/analytics-sdk'; | ||
import { FireConnectWalletEventArgs, FireEventArgs, FireLoginEventArgs, FireMintEventArgs, FirePageViewEventArgs, FireTrackCustomEventArgs, FireBridgeEventArgs } from '@masa-finance/analytics-sdk'; | ||
export declare const useMasaAnalyticsReact: ({ clientApp, clientName, clientId, }: { | ||
@@ -11,4 +11,5 @@ clientApp: string; | ||
fireConnectWalletEvent: (fireConnectWalletEventArgs: FireConnectWalletEventArgs) => Promise<void>; | ||
fireBridgeEvent: (fireBridgeEventArgs: FireBridgeEventArgs) => Promise<void>; | ||
fireTrackCustomEvent: (fireTrackCustomEventArgs: FireTrackCustomEventArgs) => Promise<void>; | ||
fireMintEvent: (fireMintEventArgs: FireMintEventArgs) => Promise<void>; | ||
}; |
@@ -47,3 +47,2 @@ "use strict"; | ||
clientApp: clientApp, | ||
clientName: clientName, | ||
clientId: clientId, | ||
@@ -55,18 +54,16 @@ }); | ||
*/ | ||
var fireLoginEvent = (0, react_1.useCallback)(function (_a) { | ||
var user_address = _a.user_address, additionalEventData = _a.additionalEventData; | ||
return __awaiter(void 0, void 0, void 0, function () { | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: return [4 /*yield*/, masaAnalytics.fireLoginEvent({ | ||
user_address: user_address, | ||
additionalEventData: additionalEventData, | ||
})]; | ||
case 1: | ||
_b.sent(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
var fireLoginEvent = (0, react_1.useCallback)(function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) { | ||
var user_address = _b.user_address, additionalEventData = _b.additionalEventData; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: return [4 /*yield*/, masaAnalytics.fireLoginEvent({ | ||
user_address: user_address, | ||
additionalEventData: additionalEventData, | ||
})]; | ||
case 1: | ||
_c.sent(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}, [masaAnalytics]); | ||
}); }, [masaAnalytics]); | ||
/** | ||
@@ -112,2 +109,15 @@ * Fire an event once the user changes the page | ||
/** | ||
* Fire an event once a user tries to bridge tokens from one chain to another | ||
*/ | ||
var fireBridgeEvent = (0, react_1.useCallback)(function (fireBridgeEventArgs) { return __awaiter(void 0, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, masaAnalytics.fireBridgeEvent(fireBridgeEventArgs)]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); }, [masaAnalytics]); | ||
/** | ||
* Fire an event once a user tries to mint a token | ||
@@ -144,2 +154,3 @@ */ | ||
fireConnectWalletEvent: fireConnectWalletEvent, | ||
fireBridgeEvent: fireBridgeEvent, | ||
fireTrackCustomEvent: fireTrackCustomEvent, | ||
@@ -146,0 +157,0 @@ fireMintEvent: fireMintEvent, |
{ | ||
"name": "@masa-finance/analytics-react", | ||
"version": "0.13.8", | ||
"version": "0.13.9", | ||
"description": "A customizable, easy-to-use React component for displaying a cookie consent banner on your website, written in TypeScript.", | ||
@@ -39,3 +39,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@masa-finance/analytics-sdk": "^0.5.8", | ||
"@masa-finance/analytics-sdk": "^0.5.13", | ||
"react": "^18.2.0" | ||
@@ -48,6 +48,6 @@ }, | ||
"eslint": "^8.54.0", | ||
"eslint-config-masa": "^0.0.22", | ||
"eslint-config-masa": "^0.0.24", | ||
"eslint-plugin-react": "^7.33.2", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-simple-import-sort": "^10.0.0", | ||
"eslint-plugin-simple-import-sort": "^12.0.0", | ||
"prettier": "^3.1.0", | ||
@@ -54,0 +54,0 @@ "terser-webpack-plugin": "^5.3.9", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
512700
253