Events
SDK events for tracking initialization and user actions
Overview
The SDK fires custom DOM events at two distinct times:
- Boot-time events - Fire during SDK initialization
- User-action events - Fire in response to user interactions
Understanding this distinction helps you integrate correctly. Boot-time events tell you when features are ready; user-action events let you respond to user behavior.
Listening to Events
document.addEventListener('PelcroUserLoggedIn', (event) => {
const user = event.detail;
console.log('User logged in:', user.email);
});All events follow this pattern:
- Events are dispatched on
document - Event data is available in
event.detail - Events bubble and are not cancelable
Boot-Time Events
These events fire during SDK initialization. Use them to know when features are ready.
| Event | Description |
|---|---|
| PelcroFingerprintReady | Device fingerprinting complete |
| PelcroSiteLoaded | Site configuration loaded, most APIs ready |
| PelcroUserLoaded | User session restored (fires on every user data update) |
| PelcroEcommerceProductsLoaded | E-commerce products loaded |
| PelcroBootComplete | SDK fully initialized, all features ready |
AdBlock Detection Events
| Event | Description |
|---|---|
| PelcroAdBlockDetected | Ad blocker is active |
| PelcroAdBlockDisabled | No ad blocker detected |
| PelcroAdBlockTestComplete | Ad blocker detection test finished |
User-Action Events
These events fire in response to user interactions or API calls.
User Events
| Event | Description |
|---|---|
| PelcroUserRegister | New user account created |
| PelcroUserLoggedIn | User successfully authenticated |
| PelcroUserLogout | User logged out |
| PelcroUserUpdated | User profile updated |
| PelcroUserRefresh | User session refreshed |
| PelcroEmailVerified | Email verification completed |
| PelcroMetadataUpdated | User metadata saved |
Subscription Events
| Event | Description |
|---|---|
| PelcroSubscriptionCreate | New subscription created |
| PelcroSubscriptionCancel | Subscription canceled |
| PelcroSubscriptionRenewed | Subscription renewed |
| PelcroSubscriptionReactivated | Canceled subscription reactivated |
| PelcroSubscriptionUpdated | Subscription modified |
| PelcroGiftRedeemed | Gift subscription redeemed |
Payment Events
| Event | Description |
|---|---|
| PelcroSourceCreated | Payment source added |
| PelcroSourceUpdated | Payment source updated |
| PelcroPaymentMethodCreated | Payment method added |
| PelcroPaymentMethodUpdated | Payment method updated |
| PelcroPaymentMethodDeleted | Payment method removed |
| PelcroInvoicePay | Invoice paid |
Address Events
| Event | Description |
|---|---|
| PelcroAddressCreated | New address added |
| PelcroAddressUpdated | Address modified |
Password Events
| Event | Description |
|---|---|
| PelcroPasswordForgot | Password reset requested |
| PelcroPasswordReset | Password reset completed |
| PelcroPasswordUpdate | Password changed |
Newsletter Events
| Event | Description |
|---|---|
| PelcroNewsletterCreated | Newsletter subscription created |
E-commerce Events
| Event | Description |
|---|---|
| PelcroOrderCreated | Order placed |
Paywall Events
These events can fire during boot (automatic paywall) or at runtime (manual trigger).
| Event | Description |
|---|---|
| PelcroPaywallMatch | Content matches a paywall rule |
| PelcroPaywallDisplayed | Paywall shown to user |
| PelcroPaywallNotDisplayed | Paywall skipped (user has access) |
Deprecated Events
These events still work but should not be used in new integrations.
| Deprecated Event | Use Instead |
|---|---|
PelcroUserLogin | PelcroUserLoggedIn |
PelcroOrderCreate | PelcroOrderCreated |
Related
- Modules - Methods that trigger these events
- JavaScript SDK - Installation and setup
Updated 1 day ago
