createEmptyClient

function createEmptyClient(): Client<object>;

Creates a new empty client that can be extended with plugins.

This serves as an entry point for building Solana clients. Start with an empty client and chain the .use() method to apply plugins that add various functionalities such as RPC connectivity, wallet integration, transaction building, and more.

See ClientPlugin for detailed examples on creating and using plugins.

Returns

Client<object>

An empty client object with only the use method available.

Example

import { createEmptyClient } from '@solana/client';
 
const client = createEmptyClient()
    .use(myRpcPlugin('https://api.mainnet-beta.solana.com'))
    .use(myWalletPlugin());

On this page