跳到主要内容

Tags

Add, remove, and confirm tags on the signed-in user.

备注

userInstanceESPRMUser 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

  1. Align tag names with RainMaker dashboard configuration
  2. Confirm tags in UI when the platform sends a verification code
  3. Refresh entitlements after tag changes before gating features

On this page