Search.../

getGroup( )

Gets a group by ID.

Description

The getGroup() function returns a Promise that resolves to a group whose ID matches the given ID.

Note: For SECRET groups, only site admins, group admins, and group members can see a group and its content.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function getGroup(groupId: string): Promise<GetGroupResponse>

getGroup Parameters

NAME
TYPE
DESCRIPTION
groupId
string

ID of the group to retrieve.

Returns

Return Type:

Promise<
GetGroupResponse
>
NAME
TYPE
DESCRIPTION
group
Group

Retrieved group.

Was this helpful?

getGroup example

Copy Code
1import { groups } from 'wix-groups.v2';
2
3 async function getGroup(groupId, options) {
4 try {
5 const result = await groups.getGroup(groupId, options);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13