getRequirement([payload,])
Fetches the completion status of a program requirement for the user
const campaignId = 'aSlug123';
const requirementId = 'Hiodn2oD2dkmo2';
const verify = await userClient.getRequirement(
{
id: requirementId,
campaign: {
id: campaignId
}
}
)
Params
Param
Required
Type
Description
campaign.id
required
String
the id of the program/campaign the requirement belongs to.
Note: this campaign/program must belong to your account.
id
required
String
the referral program/campaign requirement id.
Response
UserRequirementResponse
Field
Type
Description
id
String
the requirement id processed by the request.
completed
Boolean
a boolean representing if the user has completed the requirement or not.
Examples
import { ChainvineClient } from '@chainvine/sdk';
const userWalletAddress = '0x293kdo0ij0';
const campaignId = 'aSlug123';
const client = new ChainvineClient(); //Make sure to whitelist your domain
const requirementId = 'Hiodn2oD2dkmo2';
const userClient = await client.syncUser(userWalletAddress);
const requirement = await userClient.getRequirement({
campaign: {
id: campaignId
},
id: requirementId
});
Last updated