Next.js — Group
Associate users with groups (e.g. company, organization) and set group properties. Available on both client and server.Client: useSignalGroup
Use the same hook as the React integration, re-exported from@signal-js/nextjs/client:
Client: group(groupType, groupKey, properties?)
Associate the current user with a group. Optionally set group properties.| Parameter | Type | Required | Description |
|---|---|---|---|
groupType | string | yes | Type of group (e.g. 'company', 'organization') |
groupKey | string | yes | Unique identifier for the group |
properties | Record<string, unknown> | no | Group properties to set |
Client: getGroups()
Get all groups the user is currently associated with. Returns an array of group objects.Server: group(distinctId, groupType, groupKey, properties?, sessionId?, windowId?)
Associate a user with a group from the server. PasssessionId and windowId for client correlation.
| Parameter | Type | Required | Description |
|---|---|---|---|
distinctId | string | yes | User identifier |
groupType | string | yes | Type of group (e.g. 'company', 'organization') |
groupKey | string | yes | Unique identifier for the group |
properties | Record<string, unknown> | no | Group properties to set |
sessionId | string | no | From x-signal-session-id header for client correlation |
windowId | string | no | From x-signal-window-id header for client correlation |
Server: groupIdentify(options, sessionId?, windowId?)
Set or update group properties from the server. PasssessionId and windowId for client correlation.
| Option | Type | Required | Description |
|---|---|---|---|
groupType | string | yes | Type of group (e.g. 'company', 'organization') |
groupKey | string | yes | Group identifier |
properties | Record<string, unknown> | no | Group properties to set |
See also
- Identify — identify()
- Capture — capture()
- Server tracking — Server-side patterns
