API Request Inspector
motiq/api-request-inspectorFreeComponent
A presentation-only inspection surface for a single HTTP request/response your app already has — method/url/status/duration/timing phases, headers/query/body, error, requestId, environment, retryCount, and an auth summary. Credential headers and fields are redacted by default and can never be revealed from inside the component. Expandable sections, in-payload search, formatted/raw + wrapped/scrolling views, and copy of url/request/response. It never sends anything.
Live preview
live · rendered by the registry
Rendered by motiq on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.motiq.dev/r/api-request-inspector.jsonSource
1"use client";23import * as React from "react";4import { motion, AnimatePresence } from "motion/react";56import { cn } from "@/lib/utils";7import {8 useReducedMotion,9 useDisclosure,10 useCopy,11 getStatusMeta,12 statusVars,13 useAnimatedNumber,14 formatTimestamp as defaultFormatTimestamp,15 type StatusTone,16} from "@/lib/motiq";1718/**19 * ApiRequestInspector — a presentation-only inspection surface for a single20 * HTTP request/response that your application already has in hand. It is NOT an21 * API client: it never opens a socket, never re-sends anything, and never22 * fabricates timing. Retry/Cancel are callbacks the host wires to its own logic.23 *24 * What makes it worth shipping in a dev/observability UI: it treats secrets as a25 * first-class concern. Well-known credential headers/fields are redacted by26 * default and can never be un-hidden from inside the component — redaction is a27 * one-way display transform, and the redacted value is never present in the DOM,28 * in search, or in copied text. Around that it offers expandable sections,29 * in-payload search, formatted/raw and wrapped/scrolling views, a timing-phase30 * breakdown, an auth summary, and copy of the url / request / response.31 *32 * Accessibility: status is conveyed with an icon + text label (never colour33 * alone); each section is a real disclosure button (aria-expanded) controlling a34 * labelled region; payload text stays selectable; long lines scroll35 * horizontally; a polite live region announces copy success and state changes;36 * under prefers-reduced-motion everything renders in its final state. Clean-room37 * original.38 */3940/* -------------------------------------------------------------------------- */41/* Types */42/* -------------------------------------------------------------------------- */4344export type HttpMethod =45 | "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS"46 | (string & {});4748/** Lifecycle of the inspected exchange, owned by the host application. */49export type InspectorState =50 | "idle"51 | "loading"52 | "success"53 | "client_error"54 | "server_error"55 | "timeout"56 | "cancelled"57 | "retrying";5859/** A single timing phase of the request (e.g. DNS, TLS, TTFB, Download). */60export interface TimingPhase {61 label: string;62 durationMs: number;63}6465/** Non-sensitive summary of how the request was authorized. */66export interface AuthSummary {67 /** e.g. "Bearer", "Basic", "API Key". */68// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from motiq
All 100 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Activity Streamactivity-stream | motiq | Components | Free | 1 dep | |
| Adaptive Safe-Zone Gridadaptive-safe-zone-grid | motiq | Components | Free | no deps | |
| Agent Run Timelineagent-run-timeline | motiq | Components | Free | 1 dep | |
| AI Response Streamai-response-stream | motiq | Components | Free | 1 dep | |
| Animated Accordionanimated-accordion | motiq | Components | Free | 2 deps | |
| Animated Buttonanimated-button | motiq | Components | Free | 1 dep | |
| Animated Dialoganimated-dialog | motiq | Components | Free | 2 deps | |
| Animated Gridanimated-grid | motiq | Components | Free | 2 deps |
