Skip to content

feat(sdk): generate TypeScript/Node.js client from proto #20

@EngineerProjects

Description

@EngineerProjects

Summary

Generate a TypeScript gRPC client from nexus.proto and publish it as
an npm package. Covers both Node.js server-side usage and browser usage
via gRPC-Web.

Deliverables

  • sdk/typescript/ — generated stubs + typed wrapper
  • sdk/typescript/src/client.tsNexusClient class with full TypeScript types
  • sdk/typescript/package.json — publishable as @nexus-engine/client
  • README with quickstart for Node.js and browser (gRPC-Web)

NexusClient API (proposed)

import { NexusClient } from "@nexus-engine/client";

const client = new NexusClient({ host: "localhost:50051", apiKey: "..." });

// One-shot
const response = await client.query("Refactor the auth module");
console.log(response.content);

// Streaming
for await (const event of client.stream("Write a TypeScript handler")) {
  if (event.textChunk) process.stdout.write(event.textChunk.text);
}

// Sessions
const session = await client.createSession();
await session.submit("First message");

Acceptance criteria

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions