Choosing a Storefront
Store Builder Library must be "initialized" with a specific Storefront. This Storefront will be used when you are ready to "checkout" a customer and products "associated" with the Storefront will be available in the data returned by FastSpring backend to the Store Builder Library.
You can use either a Web Storefront or a Popup Storefront with the Store Builder Library depending on the preferred checkout experience. There is no difference in behavior of those Storefronts in regards to the Store Builder Library and available data.
If you are planning to use a Popup Storefront, you will need to get in touch with FastSpring support to "whitelist" domains where the Popup Storefront will be shown. All of your domains (including those you will use for testing and development) need to be whitelisted.
Selecting products which will be accessible with the Library
If you would like to display localized product pricing and descriptions to your customers you need to explicitly choose products which will be delivered to your page. To do this:
- Log in to the FastSpring Dashboard
- Navigate to the Storefront you have chosen to use with the Library
- For Web storefronts – click to setup Homepage Products
- For Popup storefronts – click to setup Products
Initializing the Library
After choosing the Storefront and selecting available products you can insert the Library to all pages where it's features will be used.
To get the latest library code, navigate to the Storefront of your choice and click "Place storefront on your website". The code will reference the selected storefront and the latest version of the Library.
The code provided will be limited to a simple reference, but to use advanced features you will need to provide additional data and register callbacks:
Full code reference
- id – Required, do not change value, must be "fsc-api".
- data-storefront – Required, the Storefront that the API initializes. Use the Storefront's usual Domain URL without "https://". For example, "vendor.test.onfastspring.com" or "vendor.test.onfastspring.com/holiday". This Storefront will be used when redirecting the customer to checkout. You can use both Test and Live Storefronts here. Test Storefronts might not respond as quickly as Live Storefronts.
- data-access-key – Required for making requests with the secure payload. Please refer to Passing sensitive data with Secure Requests for more information.
- data-debug – The default is "false". When set to "true", the Library provides extensive logging and other information to the browser console.