Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/components/core/MantleProvider/MantleProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ export const MantleProvider = ({
await mantleClient.sendUsageEvent(usageEvent);
};

/**
* @type {SendUsageEventCallback}
*/
const sendUsageEvents = async (usageEvent) => {
await mantleClient.sendUsageEvents(usageEvent);
};

/**
* @type {GetUsageReportCallback}
*/
Expand Down Expand Up @@ -153,6 +160,7 @@ export const MantleProvider = ({
loading,
i18n: { ...Labels, ...i18n },
sendUsageEvent,
sendUsageEvents,
getUsageReport,
subscribe,
cancelSubscription,
Expand Down Expand Up @@ -214,6 +222,7 @@ export const useMantle = () => {
* @property {boolean} loading - Whether the current customer is loading
* @property {RefetchCallback} refetch - Refetch the current customer
* @property {SendUsageEventCallback} sendUsageEvent - Send a new usage event to Mantle
* @property {SendUsageEventCallback} sendUsageEvents - Send a set of new usage event to Mantle
* @property {GetUsageReportCallback} getUsageReport - Get a usage report for a usage metric
* @property {SubscribeCallback} subscribe - Subscribe to a new plan
* @property {CancelSubscriptionCallback} cancelSubscription - Cancel the current subscription
Expand Down Expand Up @@ -295,4 +304,4 @@ export const useMantle = () => {
* @param {string} params.type - The type of hosted session to create
* @param {Object} params.config - The configuration for the hosted session
* @returns {Promise<HostedSession>} a promise that resolves to the hosted session
*/
*/