Register the client in the module using ClientsModule.register() with a name token and transport options. Inject it via @Inject('SERVICE_NAME') and call client.connect() in onModuleInit() for transports that require an explicit connection. Use client.send() for request-response and client.emit() for events.
ClientsModule.registerAsync() supports async factory with ConfigService injection for dynamic credentials.
Call client.connect() in onModuleInit() — TCP and RabbitMQ require an explicit connection before sending.
firstValueFrom() converts the Observable returned by send() to a Promise for async/await code.
The name token ('USERS_SERVICE') must match the provide value in ClientsModule.register().
ClientProxyFactory.create() creates a client instance programmatically without the module system.