{"id":18875,"library":"typescript-http-client","title":"TypeScript HTTP Client","description":"A lightweight Promise-based HTTP client for TypeScript with a filter chain architecture, version 0.10.5. Released infrequently (last update 2020). Differentiates from axios/fetch by offering a middleware-like filter system for request/response transformation, caching, or logging. Ships TypeScript types. Supports typed responses via generics. Not actively maintained; consider alternatives like ky or axios for modern apps.","status":"maintenance","version":"0.10.5","language":"javascript","source_language":"en","source_url":"https://github.com/taktik/typescript-http-client","tags":["javascript","typescript"],"install":[{"cmd":"npm install typescript-http-client","lang":"bash","label":"npm"},{"cmd":"yarn add typescript-http-client","lang":"bash","label":"yarn"},{"cmd":"pnpm add typescript-http-client","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Named export, not default.","wrong":"import newHttpClient from 'typescript-http-client'","symbol":"newHttpClient","correct":"import { newHttpClient } from 'typescript-http-client'"},{"note":"ESM-only; can also use CJS destructure but prefer named imports.","wrong":"const Request = require('typescript-http-client').Request","symbol":"Request","correct":"import { Request } from 'typescript-http-client'"},{"note":"Used for type annotations; no common alternative import.","wrong":null,"symbol":"Response","correct":"import { Response } from 'typescript-http-client'"},{"note":"Interface for custom filters.","wrong":null,"symbol":"Filter","correct":"import { Filter } from 'typescript-http-client'"},{"note":"Used in filter implementation.","wrong":null,"symbol":"FilterChain","correct":"import { FilterChain } from 'typescript-http-client'"}],"quickstart":{"code":"import { Request, newHttpClient } from 'typescript-http-client';\n\nconst client = newHttpClient();\nconst request = new Request('https://jsonplaceholder.typicode.com/todos/1', { responseType: 'text' });\nclient.execute<string>(request).then(response => {\n  console.log(response);\n}).catch(err => {\n  console.error(err);\n});","lang":"typescript","description":"Creates an HTTP client, builds a GET request, and executes it with typed text response."},"warnings":[{"fix":"Ensure each filter's doFilter method awaits or returns filterChain.doFilter(call).","message":"Filter chain: Filters must call filterChain.doFilter() or the request hangs.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use newHttpClient() instead of newClient().","message":"Version 0.10.x renamed newClient() to newHttpClient().","severity":"breaking","affected_versions":">=0.10.0"},{"fix":"Consider migrating to a maintained alternative like ky or axios.","message":"Package not updated since 2020; may have unpatched security issues.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Explicitly set { responseType: 'text' } for non-JSON responses.","message":"The Request constructor's responseType defaults to 'json'; set to 'text' for string responses.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.10.5':19 '2020':24 'activ':51 'altern':54 'app':61 'architectur':17 'axio':58 'axios/fetch':27 'base':8 'cach':39 'chain':16 'client':3,10 'consid':53 'differenti':25 'filter':15,34 'generic':49 'http':2,9 'infrequ':21 'javascript':62 'ky':56 'last':22 'lightweight':5 'like':33,55 'log':41 'maintain':52 'middlewar':32 'middleware-lik':31 'modern':60 'offer':29 'promis':7 'promise-bas':6 'releas':20 'request/response':37 'respons':47 'ship':42 'support':45 'system':35 'transform':38 'type':44,46 'typescript':1,12,43,63 'updat':23 'version':18 'via':48","created_at":"2026-04-25T07:40:35.855665+00:00","updated_at":"2026-04-25T07:40:35.855665+00:00","problems":[{"fix":"Use newHttpClient() to create the client instance.","cause":"Old API: newClient() was renamed to newHttpClient() in v0.10.","error":"TypeError: client.execute is not a function"},{"fix":"Add 'const response = await filterChain.doFilter(call); return response;' in each filter.","cause":"A filter's doFilter did not invoke filterChain.doFilter() causing infinite wait.","error":"Error: Filter must call filterChain.doFilter"},{"fix":"Ensure generic parameter matches expected response body type.","cause":"Misunderstanding of Response type: body property exists but may be typed incorrectly.","error":"Property 'body' does not exist on type 'Response<U>'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/taktik/typescript-http-client","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/typescript-http-client","openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}