MantleProvider
<MantleProvider>
is a component which uses the React Context API to wrap your application, so you can easily access various parts of the Mantle API client from your app’s React frontend. You must initialize the <MantleProvider>
using the customer apiToken
which you retrieved during the /identify
step, and should wrap the rest of your app similar to the below snippet:
<MantleProvider
appId="YOUR_MANTLE_APP_ID_HERE"
customerApiToken={shop.mantleApiToken}
>
{children}
</MantleProvider>
Check out the @heymantle/react library to learn more.