Tags
Add, remove, and confirm tags on the signed-in user.
备注
userInstance — ESPRMUser from User sign in.
What This Module Does ?
Applies string tags to the user for categorization, beta access, or feature flags in your deployment.
Use when your RainMaker setup uses tags for entitlements or filtering—not for device/node tags (see Node Metadata).
Expected outcome: Tags attached after addTags and optional confirmTagAssignment with OTP.
Common Workflows
Add tags
await userInstance.addTags(["premium", "beta-tester"]);
Remove tags
await userInstance.removeTags(["premium"]);
Confirm tag assignment
await userInstance.confirmTagAssignment(verificationCode);
Some deployments require OTP confirmation after addTags.
Error Handling
try {
await userInstance.confirmTagAssignment(verificationCode);
} catch (error) {
console.error("Tag confirmation failed:", error);
}
Best Practices
- Align tag names with RainMaker dashboard configuration
- Confirm tags in UI when the platform sends a verification code
- Refresh entitlements after tag changes before gating features
Related Resource
- API Reference: