Sunlight offers a powerful feature called "customizations" that allows you to tailor the user experience when performing card switches. Customizations enable you to define a specific list of supported services that will be presented to the user during the card switch process. By creating customizations, you can offer a more focused and relevant experience to your users, whether you're targeting specific types of services (e.g., B2B, B2C, streaming) or linking a vendor card to a specific service.

In this guide, we'll explore what customizations are, how to create them, and how to use them as part of the Sunlight SDK initialization. We'll also discuss a special use case where customizations can be used to skip the service selection screen in the SDK.

What are Customizations?

Customizations are entities that define a list of supported services to be displayed to the user during the card switch process. Each customization is associated with a unique customization_id, which can be used to initialize the Sunlight SDK. By creating customizations, you gain control over the list of services presented to the user, allowing you to offer a curated and personalized experience.

Creating Customizations

To create a customization, you can use the /api/customizations/create API endpoint. When creating a customization, you'll need to specify the list of supported services that you want to include. The API will return a customization_id that can be used to initialize the Sunlight SDK.

Using Customizations in the SDK Initialization

When initializing the Sunlight SDK, you can specify the customization_id as part of the configuration object. By doing so, the SDK will display the list of services defined in the customization during the card switch process. Here's an example of how to include the customization_id during SDK initialization:

  // Other configuration fields...
  customizationId: 'your-customization-id'

Skipping the Service Selection Screen

In cases where a customization contains only one supported service ID, the SDK will automatically skip the service selection screen and proceed directly to the card switch process for that specific service. This feature is useful for use cases where you have created a vendor card and wish to link it directly to a specific service, providing a streamlined experience for the user.

Customizations offer a powerful way to tailor the card switch process to meet the specific needs of your application and users. By creating and using customizations, you can provide a curated list of services, enhance the user experience, and streamline the card switch flow.