Help & Support

Join Groups

This guide will help you manage Group membership on Lens.

Join a Group

1

Join a Group

Use the joinGroup action to join a Group with the logged-in account.

You MUST be authenticated as Account Owner or Account Manager to make this request.

Example
import { evmAddress } from "@lens-protocol/client";import { joinGroup } from "@lens-protocol/client/actions";
const result = await joinGroup(sessionClient, { group: evmAddress("0x1234") });

2

Handle Result

Finally, handle the result using the adapter for the library of your choice:

import { handleWith } from "@lens-protocol/client/viem";
// …
const result = await joinGroup(sessionClient, { group: evmAddress("0x1234") }).andThen(  handleWith(walletClient),);

See the Transaction Lifecycle guide for more information on how to determine the status of the transaction.

Leave a Group

1

Leave a Group

Use the leaveGroup action to leave a Group with the logged-in account.

You MUST be authenticated as Account Owner or Account Manager to make this request.

Example
import { evmAddress } from "@lens-protocol/client";import { leaveGroup } from "@lens-protocol/client/actions";
const result = await leaveGroup(sessionClient, { group: evmAddress("0x1234") });

2

Handle Result

Finally, handle the result using the adapter for the library of your choice:

import { handleWith } from "@lens-protocol/client/viem";
// …
const result = await leaveGroup(sessionClient, { account: evmAddress("0x1234") }).andThen(  handleWith(walletClient),);

See the Transaction Lifecycle guide for more information on how to determine the status of the transaction.