createOtimClient
function accepts different configuration options depending on your application type and wallet management needs.
Initialization Methods
The Otim Client can be initialized in three different ways:- Wallet Client – For frontend applications using wagmi or existing viem wallet clients
- Transport + Chain + Account – For backend services and direct configuration
1. Using Wallet Client (Frontend – Recommended)
The Otim Client can accept an existing viem wallet client instance, allowing you to reuse wallet configurations across different parts of your application.Note: The next example is using wagmi, but the wallet client can be from viem too.
When to use
- You have an existing viem
WalletClient
instance - Advanced applications with custom wallet management
- Integration with existing viem-based infrastructure
- You need to share wallet clients between different parts of your application
Benefits
- Reuse existing wallet client configuration
- No additional wallet client creation overhead
- Full compatibility with viem ecosystem
- Maximum flexibility for complex setups
2. Using Transport + Chain + Account (Backend – Direct Configuration)
The Otim Client accepts direct wallet configuration through transport, chain, and account parameters. This method creates a new wallet client internally and provides full control over the configuration.When to use
- Backend services and server-side applications
- You have direct access to private keys
- You need explicit control over transport and chain configuration
- Building automated systems or bots
transport
, chain
, and account
, the SDK will create a new WalletClient
internally using viem’s createWalletClient
function. This approach is recommended for backend applications where you have direct control over the wallet configuration.