Skip to main content
JavaScript
await Smile.preload([
  'pointsSettings',
  'pointsProducts',
  'rewardFulfillments',
  'customerPointsProducts'
]);
This async method preloads and caches resources from the Smile API for instant access via their respective preloaded() methods. Refer to preloading resources to learn more about how preloading works and when to use it.
To get the best performance, you should preload resources during initialization or when logging a customer in . Doing so at either of these points will ensure fewer network calls as compared to using the Smile.preload() method later.

Parameters

resources
array
required
An array with one or multiple resource keys. Customer-specific resource keys can only be included when a customer is already logged-in.

Returns

This method returns a Promise that:
  • On success, resolves to void.
  • On failure, rejects with an error object.
If the method is improperly invoked (e.g. missing required parameters), the Promise will be rejected.