Skip to main content
Version: React SDK

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:

ParameterTypeRequiredDescription
groupNamestringYesThe name of the group (e.g., company name, team name)
groupTypestringNoThe type of group (e.g., "company", "organization", "team")
groupPropertiesPropertyRecordNoProperties 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:

ParameterTypeRequiredDescription
groupNamestringYesThe name of the group to unassign
groupTypestringNoThe type of group