Retrieves activity counters for the specified site member, including all public counters and any private counters owned by the authenticated caller.
Note: Make sure to pass a memberId
and not a contactId
to identify the member. Any relationship between a member's memberId
and contactId
is coincidental.
function getActivityCounters(
memberId: string,
): Promise<GetActivityCountersResponse>;
Member ID whose counters will be returned.
import { activityCounters } from "wix-activity-counters.v2";
async function getActivityCounters(memberId) {
try {
const result = await activityCounters.getActivityCounters(memberId);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.