Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
createClient
✓ import { createClient } from 'kavka-core'
✗ const { createClient } = require('kavka-core')
Package is ESM-only; CommonJS require will fail.
KavkaService
✓ import { KavkaService } from 'kavka-core'
✗ import { KavkaService } from 'kavka-core/service'
All exports are at the main entry point; no subpath imports.
KavkaClient
✓ import type { KavkaClient } from 'kavka-core'
Use type import for TypeScript; regular import works at runtime but is unnecessary.
createRouter
✓ import { createRouter } from 'kavka-core'
For server-side usage.
Creates a Kavka client using Connect-Web transport and sends a message.
import { createClient, KavkaService } from 'kavka-core';
import { createConnectTransport } from '@connectrpc/connect-web';
const transport = createConnectTransport({
baseUrl: 'https://api.example.com',
interceptors: [],
});
async function main() {
const client = createClient(KavkaService, transport);
const response = await client.sendMessage({
topic: 'orders',
key: 'order-123',
value: new TextEncoder().encode('hello'),
});
console.log('Sent:', response);
}
main().catch(console.error);
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/kavka-core/index.mjs from /path/to/app.js not supported.
Using CommonJS require() on ESM-only package
fixUse dynamic import() or convert project to ESM (type: module).
TypeError: Class extends value undefined is not a constructor or null
Missing @bufbuild/protobuf dependency
fixnpm install @bufbuild/protobuf
Module not found: Can't resolve '@bufbuild/protobuf'
@bufbuild/protobuf not installed or not in node_modules
fixnpm install @bufbuild/protobuf
Audit
Dependencies
@connectrpc/connectrequiredCore Connect-Protocol runtime for creating clients and servers
@bufbuild/protobufrequiredProtobuf message types and serialization