remove-square-1 smiley-indifferent add-circle-bold cog-1 view-off keyboard-arrow-up headphones-customer-support filter-1 smiley-sad-1 archive single-neutral move-to-top synchronize-arrows-1 pencil-write add shield-warning smiley-happy keyboard-arrow-down book-star love-it rating-star folder-file-1 diagram-fall-down ticket-1 list-bullets rating-star messages-bubble-square lock-unlock-1 arrow-right-1 smiley-unhappy multiple-neutral-1 envelope-letter close disable add-square time-clock-circle hyperlink-2 arrow-up-1 pencil-1 smiley-unhappy arrow-down-1 wench layout-module-1 smiley-indifferent undo analytics-pie-2 navigation-menu-horizontal alarm-bell-1 common-file-stack network-browser file-code attachment-1 open-quote copy-paste envelope-letter print-text download-thick-bottom alert-diamond archive single-neutral-actions arrow-down-2 multiple-circle floppy-disk social-media-twitter close-quote arrow-left-1 close expand-6 smiley-sad-1 send-email-1 search add-circle ticket-1 information-circle smiley-happy flying-insect-honey remove-circle credit-card-1 check-1 hierarchy-9 view-1 time-clock-midnight drawer-send lock-2 smiley-smile-1_1 tags-double pencil-1 bin-paper-1 multiple-users-1 smiley-thrilled expand-6 button-record check-circle-1 view navigation-menu cog

Pico Window Object

Pico Window Object properties and listener code

Pico Window Objects require prior knowledge

⚠️ NOTE: This is an advanced Pico feature that requires familiarity with JavaScript to fully utilize. We recommend working with a developer if you are unsure how to proceed.

When the plugin is first loaded, it will fire a pico.init event. This signifies that the plugin has successfully loaded and is ready to work. After initialization is complete, the plugin will fire a pico.loaded event to indicate the user's information has been fully loaded. The global window Pico object now has a user object that is available to access.  

Here's a breakdown of the Pico object properties:

  • email: Email address of the user if available - defaults to null
  • first_name: First name of the user if available, defaults to null
  • last_name: Last name of the user if available, defaults to null
  • membership_type: Type of recurring payment if available, available options ["subscription", "single-donation", "recurring-donation", null], defaults to null
  • tier: Name of the tier they have purchases, If no name was provided defaults to null
  • group_name: Name of the group they are associated to, defaults to null
  • total_paid: Lifetime total of all purchases, defaults to null
  • recurring_payment: Current recurring payment amount, defaults to null

This is typically how you would listen to an event fired at the window:

window.addEventListener('pico.loaded', function() {<br style="box-sizing:inherit;">&amp;nbsp; &amp;nbsp; console.log(window.Pico.user)<br style="box-sizing:inherit;">})