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

# Custom modules

> Extend account's capabilities with bespoke modules

Custom modules enable you to tailor the functionality of your smart wallet.

With custom *validators*, you can introduce novel ways to authorize user transactions. Custom *executors* enable automated transaction flows against the user account. And with custom *hooks*, you can add custom logic that runs before or after any transaction executed on the account.

To create a custom module, use the [ModuleKit](https://github.com/rhinestonewtf/modulekit).

## Deployment

You can install custom modules during account deployment by passing them in the `modules` field when creating the account:

```ts theme={null}
import { createRhinestoneAccount } from '@rhinestone/sdk'

const rhinestoneAccount = await createRhinestoneAccount({
  owners: {
    type: 'ecdsa',
    accounts: [owner],
  },
  modules: [
    {
      type: 'executor',
      address: MODULE_ADDRESS,
      // Optional
      initData: MODULE_DATA,
    },
  ],
})
```

This is useful when you want your account to have specific modules available from the start, without needing a separate installation transaction after deployment.

## Installing a Module

You can install and use custom validators, executors, and hooks.

```ts theme={null}
import { installModule, uninstallModule } from '@rhinestone/sdk/actions'

const transactionData = await rhinestoneAccount.sendTransaction({
  targetChain: base,
  calls: [
    installModule({
      address: MODULE_ADDRESS,
      type: 'executor',
      // Optional
      initData: MODULE_DATA,
    }),
  ],
})
```

## Uninstalling a Module

You can also remove any module from the account:

```ts theme={null}
const result2 = await rhinestoneAccount.sendTransaction({
  targetChain: base,
  calls: [
    uninstallModule({
      address: MODULE_ADDRESS,
      type: 'executor',
    }),
  ],
})
```

<Warning>Be careful when uninstalling validator modules, as you can lock the account forever.</Warning>
