Instalación

Core es agnóstico al framework, y las funcionalidades de Next.js y RSocket solo importan un punto de entrada separado si se utilizan.


Instalación de npm

bash
npm i @byeolnaerim/typed-rx-http rxjs

Core (independiente del framework)

ts
import {
  createHttpClient,
  createHeaderStore,
  createCsrCache,
  createSessionAuth,
  HttpResponseError,
  isHttpResponseError,
  type ServiceArguments,
  type CacheForService,
} from "@byeolnaerim/typed-rx-http";

Las solicitudes HTTP generales, streaming NDJSON, HeaderStore, autenticación de sesión y caché CSR están incluidas en el punto de entrada básico. Se puede usar Core sin Next.js.

Adaptador de Next.js (opcional)

ts
import {
  callApiSsrCache,
  redirectToUnauthorizedOnServer401,
} from "@byeolnaerim/typed-rx-http/next";

Adaptador de RSocket (opcional)

Solo se instalan paquetes peer en proyectos que utilizan RSocket.

bash
npm i rsocket-core rsocket-types rsocket-websocket-client
ts
import { createRSocketApi } from "@byeolnaerim/typed-rx-http/rsocket";

const api = createRSocketApi("ws://localhost:7000/rsocket", jwt);

api.mono<User>("user.findById", { id: 1 }).subscribe((user) => {
  console.log(user);
});

api.stream<Notification>("notification.stream").subscribe((notification) => {
  console.log(notification);
});

Script de Node Auto OpenAPI/Swagger (opcional)

Además del cliente HTTP en tiempo de ejecución, también se incluye un script de Node que genera tipos de TypeScript y archivos de servicio desde JSON de OpenAPI/Swagger. Esta funcionalidad es opcional y no es necesaria para usar Core, /next, /rsocket.

ts
import {
  connectToSwaggerEventStream,
  generateSwaggerFromHttp,
  generateSwaggerFromFile,
} from "@byeolnaerim/typed-rx-http/auto-node-script/openapi";
© 2026 Byeolnaerim. Todos los derechos reservados.IntroducciónPolítica de privacidad