Skip to content

php-skir/typescript-client

 
 

Repository files navigation

npm build

Skir TypeScript Client

Library imported from TypeScript code generated from skir files.

Install with:

npm i @php-skir/skir-client

CBOR transport

The default SkirRPC transport stays compatible with upstream Skir. To exchange CBOR request and response bodies, opt in on both the client and service:

const client = new ServiceClient("https://example.com/rpc", undefined, {
  transportCodec: "cbor",
});

const service = new Service({ transportCodec: "cbor" });

CBOR transport sends a { method, request } envelope as application/cbor and encodes the response value as application/cbor.

When installing a CBOR-enabled service on Express, pass Express's raw middleware as the sixth argument:

installServiceOnExpressApp(app, "/rpc", service, text, json, raw);

See:

About

Runtime dependency for TypeScript code generated from .skir files

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages

  • TypeScript 98.9%
  • Other 1.1%