> ## Documentation Index
> Fetch the complete documentation index at: https://new-docs.squads.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Member (Controlled Multisig)

## Overview

Add a member via Config Authority. This instruction allows the config authority to add members without going through the standard proposal process.

<Note>
  Can only be used with a [Controlled Multisig](/developers/reference/controlled-multisigs).
</Note>

## Prerequisites

* Multisig with Config Authority set
* `@sqds/multisig` package installed
* Config Authority signer

## Quick Example

```typescript theme={null}
import * as multisig from "@sqds/multisig";
import { Connection, Keypair, PublicKey } from "@solana/web3.js";

const { Permissions } = multisig.types;

await multisig.rpc.multisigAddMember({
  connection,
  feePayer,
  multisigPda,
  configAuthority: configAuthority.publicKey,
  rentPayer: feePayer,
  newMember: {
    key: newMemberPublicKey,
    permissions: Permissions.all(),
  },
  signers: [configAuthority],
});
```

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `connection` | `Connection` | Yes | Solana RPC connection |
| `feePayer` | `Keypair` | Yes | Transaction fee payer |
| `multisigPda` | `PublicKey` | Yes | PDA of the multisig |
| `configAuthority` | `PublicKey` | Yes | Config authority public key |
| `rentPayer` | `Keypair` | Yes | Account paying for additional rent |
| `newMember` | `Member` | Yes | New member key and permissions |
| `signers` | `Signer[]` | No | Additional signers. Pass the config authority here so it signs the transaction |

## Full Example

```typescript theme={null}
import * as multisig from "@sqds/multisig";
import { Connection, Keypair, PublicKey } from "@solana/web3.js";

const { Permissions } = multisig.types;

// Cluster Connection
const connection = new Connection("<your rpc url>");

// Fee payer is the a signer that pays the transaction fees
const feePayer = Keypair.generate();
// Replace with the keypair of the multisig's config authority
const configAuthority = Keypair.generate();

// Derive the multisig PDA
const multisigPda = multisig.getMultisigPda({
    // The createKey has to be a Public Key, see accounts reference for more info
    createKey,
})[0];

// Public Key of the new member
const member = new PublicKey("");

await multisig.rpc.multisigAddMember({
    connection,
    feePayer,
    // The public key of the multisig account
    multisigPda,
    // Public Key of the config authority of the multisig
    configAuthority: configAuthority.publicKey,
    // Account paying for the rent of the additional account space needed by adding a member
    rentPayer: feePayer,
    newMember: {
        // Public Key of the new member to be added
        key: member,
        // Permissions that the new member will have, check the reference for more info
        permissions: Permissions.all(),
    },
    // The config authority must sign the transaction
    signers: [configAuthority],
});
```

## Error Handling

| Error | Cause | Solution |
| - | - | - |
| Invalid config authority | Wrong or missing config authority | Verify config authority is set on multisig |
| Not a controlled multisig | Multisig has no config authority | Use Config Transaction instead |

## See Also

* [Controlled Multisigs Reference](/developers/reference/controlled-multisigs)
* [Permissions Reference](/developers/reference/permissions)
* [Remove Member](/developers/typescript-sdk/instructions/controlled-multisig/remove-member)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.