getGroup( )


Gets a group by ID.

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.

Method Declaration
Copy
function getGroup(groupId: string, options: GetGroupOptions): Promise<Group>;
Method Parameters
groupIdstringRequired

ID of the group to retrieve.


optionsGetGroupOptions
Returns
Return Type:Promise<Group>
JavaScript
import { groups } from "wix-groups.v2"; async function getGroup(groupId, options) { try { const result = await groups.getGroup(groupId, options); return result; } catch (error) { console.error(error); // Handle the error } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?