원클릭으로
getting-started
Create an HTTP client with interceptors. Use when making authenticated HTTP requests from a NestJS service.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Create an HTTP client with interceptors. Use when making authenticated HTTP requests from a NestJS service.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when scanning NestJS providers with DiscoveryService-backed utilities.
Use when working with the @wisemen/nestjs-custom-fields package — developer-defined custom fields in NestJS with TypeORM persistence and runtime validation. Covers registering the CustomFieldDefinition entity, authoring definitions with customFieldDefinition(), storing resolved values via @CustomFieldValueColumn(), exposing them through CustomFieldValueDto / @IsCustomFields(), and validating submissions with CustomFieldDefinitionsRepository + validateCustomFieldValues(). Use this whenever a task involves custom field definitions, CustomFieldValue columns, custom-field DTOs, or tenant-scoped field definitions, even if the package is not named explicitly.
Use when defining Typesense collections, collectors, and search queries in NestJS APIs.
Generate PDFs through API2PDF in NestJS. Use when converting HTML or URLs to PDFs in apis.
Use when storing and validating multilingual text in NestJS apis with TypeORM and class-validator.
Use when configuring NATS messaging, subscribers, or the simple NatsClient in NestJS applications.
| name | getting-started |
| description | Create an HTTP client with interceptors. Use when making authenticated HTTP requests from a NestJS service. |
Use createClient to get a fetch wrapper with a typed interceptor pipeline.
All HTTP methods return a native Response. Non-2xx responses are never thrown.
import { createClient } from '@wisemen/node-fetch'
const client = createClient({
baseUrl: 'https://api.example.com',
headers: { 'X-App': 'my-app' },
})
client.interceptors.request.use(async (req) => {
const token = await tokenStore.get()
req.headers.set('Authorization', `Bearer ${token}`)
return req
})
let refreshing = false
client.interceptors.response.use(async (res, req) => {
if (res.status !== 401 || refreshing) return res
refreshing = true
await tokenStore.refresh()
refreshing = false
const retry = new Request(req.url, { method: req.method, headers: req.headers })
return client.fetch(retry)
})
client.interceptors.error.use((err, _res, req) => {
logger.error({ url: req.url, err })
return err
})
const res = await client.get('/users')
const data = await res.json()
await client.post('/users', {
body: JSON.stringify({ name: 'Alice' }),
headers: { 'Content-Type': 'application/json' },
})
await client.delete('/users/1')
const id = client.interceptors.request.use(myFn)
client.interceptors.request.eject(id) // remove by id
client.interceptors.request.eject(myFn) // remove by reference
client.interceptors.request.update(id, newFn)
client.interceptors.request.exists(id)
client.interceptors.request.clear() // remove all