For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
HomeGuidesAPI Reference
HomeGuidesAPI Reference
  • Welcome
    • Business Hub
  • Platforms
    • Platforms Quickstart
    • Adyen
    • Ecwid
    • Shopify
    • Stripe
  • Afterpay Messaging
    • Getting Started
    • Implementation
    • Migration
    • Legacy Messaging Products
    • Afterpay.js Glossary
    • Launch Afterpay Info Modal Anywhere
  • API Development
    • API Quickstart
    • Test Environments
    • Certification
    • Disputes
    • Upgrade from API v1 to v2
  • SDK
    • iOS SDK
    • Android SDK
    • React Native SDK
    • PHP SDK
  • Marketing
    • Shop Directory
    • Brand Assets
LogoLogo
On this page
  • Constants
  • Using Afterpay Constants
  • Functions
  • Window Events
Afterpay Messaging

Afterpay.js Glossary

Was this page helpful?
Previous

Launch Afterpay Info Modal Anywhere

Next
Built with

Constants

<CONSTANT_NAME>Values
currencyAUD, CAD ,GBP, NZD, USD, EUR
localeEN_AU, EN_CA, EN_GB, EN_NZ, EN_US, IT_IT, FR_FR, ES_ES
logoTypeBADGE, LOCKUP
modalLinkStyleCIRCLED_INFO_ICON, LEARN_MORE_TEXT, MORE_INFO_TEXT, CIRCLED_QUESTION_ICON, NONE
placementTypesPRICE_TABLE
sizeXS, SM, MD, LG
mobileViewLayoutFOUR_BY_ONE, TWO_BY_TWO
theme.badgeBLACK_ON_MINT, BLACK_ON_WHITE, MINT_ON_BLACK, WHITE_ON_BLACK
theme.lockupBLACK, WHITE, MINT
theme.modalWHITE
theme.priceTableBLACK, WHITE

Using Afterpay Constants

Constants are exposed to the window via the Afterpay object Afterpay.<constant_name>.

See some examples below:

1console.log(Afterpay.locale.EN_US) // "en_US"
2console.log(Afterpay.theme.lockup) // "{"BLACK":"black","WHITE":"white","MINT":"mint"}"
3console.log(Afterpay.theme.lockup.BLACK) // "black"

Functions

NameDescription
createPlacementsAdds one or more placements to the page using the targetSelector attribute.
launchModalDynamically open the Clearpay Modal.
readyCustom Window Event dispatched when Afterpay.js is successfully initialized.
modalRenderCompleteCustom Window Event dispatched when the <afterpay-modal> finishes rendering.

Window Events

NameDescription
readyCustom Window Event dispatched when Afterpay.js is successfully initialized.
modalRenderCompleteCustom Window Event dispatched when the <afterpay-modal> finishes rendering