# Create Base Groups for your community

#### Base Groups are capable of following:

* They can set membership conditions to define who can be part of the group
* They can register short names with a nonce
* They can trust avatars individually or in batches with condition checks.

### Create a Base Group

`sdk.register.asGroup` wraps profile pinning, factory deployment, and address extraction.

```ts
import { Sdk } from '@aboutcircles/sdk';

const sdk = new Sdk(
  { rpcUrl: 'https://rpc.aboutcircles.com' },
  runner // ContractRunner tied to your wallet
);

const groupAvatar = await sdk.register.asGroup(
  '0xOwner',
  '0xService',
  '0xFeeCollection',
  ['0xCondition1', '0xCondition2'], // initial membership conditions
  'My Base Group',
  'MBG',
  {
    name: 'My Base Group',
    symbol: 'MBG',
    description: 'A base group for coordination',
    imageUrl: '',        // optional
    previewImageUrl: '', // optional
  }
);

console.log('Base group created at:', groupAvatar.address);
```

The returned instance is a `BaseGroupAvatar`, ready for trust, membership, and admin actions.

### Membership Management

```ts
// List current conditions
const conditions = await groupAvatar.properties.getMembershipConditions();

// Enable/disable a condition
await groupAvatar.setProperties.membershipCondition('0xCondition1', true);
```

### Trust Management

```ts
// Trust avatars (default expiry = max uint96)
await groupAvatar.trust.add(['0xA', '0xB']);

// Untrust
await groupAvatar.trust.remove('0xA');

// Batch trust with membership checks
const oneYear = BigInt(Math.floor(Date.now() / 1000)) + 31536000n;
await groupAvatar.trust.addBatchWithConditions(['0xC', '0xD'], oneYear);
```

### Group Administration

```ts
// Change ownership / service / fee collection
await groupAvatar.setProperties.owner('0xNewOwner');
await groupAvatar.setProperties.service('0xNewService');
await groupAvatar.setProperties.feeCollection('0xNewTreasury');

// Register a short name (nonce required)
await groupAvatar.profile.registerShortName(42);
```

You can also update metadata with `groupAvatar.profile.update({...})`, which pins a new CID and updates on-chain metadata via the group contract.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aboutcircles.com/circles-sdk/circles-avatars/group-avatars/create-base-groups-for-your-community.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
