Sunlight offers a powerful JavaScript library that simplifies the process of integrating Sunlight's functionality into your web application. One of the key features of the Sunlight SDK is the ability to provide your end-users with a seamless and convenient way to set your card as the primary card-on-file across various apps and services they use. The Sunlight SDK is typically triggered by a call-to-action (CTA) button or a similar user interaction within your application.

In this guide, we'll walk you through the steps required to initialize the Sunlight SDK and explain how to configure the CTA button that triggers the SDK.

Understanding the SDK Initialization Flow

Before diving into the technical details of initializing the Sunlight SDK, it's important to understand the overall flow of the process. The following diagram provides a visual representation of the key steps involved in initializing the SDK, from obtaining the necessary user and session information to configuring the SDK with the appropriate parameters. By following this flow, you can ensure a smooth and successful integration of the Sunlight SDK into your application.