Group assignation
Assign users to groups for segmentation and B2B targeting. Groups represent organizations like companies, teams, or workspaces.
Assign a user to a group
import { useScreeb } from "@screeb/sdk-react";
const MyComponent = () => {
const { identityGroupAssign } = useScreeb();
const assignUserToCompany = async () => {
await identityGroupAssign(
"Apple",
"company",
{
address_line_1: "Apple Campus",
address_line_2: "1 Infinite Loop",
city: "Cupertino",
zipcode: 95014,
state: "California",
country: "United States",
}
);
};
};
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
groupName | string | Yes | The name of the group (e.g., company name, team name) |
groupType | string | No | The type of group (e.g., "company", "organization", "team") |
groupProperties | PropertyRecord | No | Properties describing the group |
Requirements
- Property names must be limited to 128 characters
- No more than 1000 attributes
- Supported types for values: string, number, boolean and Date.
Unassign a user from a group
import { useScreeb } from "@screeb/sdk-react";
const MyComponent = () => {
const { identityGroupUnassign } = useScreeb();
const removeUserFromCompany = async () => {
await identityGroupUnassign("Apple", "company");
};
};
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
groupName | string | Yes | The name of the group to unassign |
groupType | string | No | The type of group |