
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
axios UI for request logs with a react component and SSR (Next.js) support
cd example/nextjs-13
npm install
npm run dev
npm install axios-ui --save-dev
Example available in
/example/nextjs-13
see Example:
/example/nextjs-13/pages/index.ts
each route using the interceptor should add axiosUIData
to the page props
add the following to your server side requests:
// register interceptor
const { axiosInterceptor, debugToken } = registerAxiosInterceptor(...);
axiosInterceptor.intercept();
// request with debugToken header (necessary in SSR context)
axios.get(..., { headers: { 'x-axios-debug': debugToken } });
// consume intercepted request/response data
const axiosUIData = axiosInterceptor.getData();
// return data from your handler
return {...yourData, axiosUIData};
export const getServerSideProps = async (context) => {
const data = ({ axiosUIData, ...yourPageProps } = yourRequestHandler());
// add axiosUIData to pageProps
return Promise.resolve({
props: {
...yourPageProps,
axiosUIData,
},
});
};
\_app.ts
)export default function App({ Component, pageProps }: AppProps) {
<>
<AxiosUIWrapperSSR axios={axios} initialData={pageProps.axiosUIData} />
<Component {...pageProps} />
</>;
}
see Example:
/example/nextjs-13/pages/api/get-entry/[id].ts
// register interceptor
const { axiosInterceptor, debugToken } = registerAxiosInterceptor(...);
axiosInterceptor.intercept();
// request with debugToken header (necessary in SSR context)
axios.get(..., { headers: { 'x-axios-debug': debugToken } });
// consume intercepted request/response data
const axiosUIData = axiosInterceptor.getData();
// resopnd with data from your handler
return response.status(200).json({...yourData, axiosUIData});
FAQs
axios UI for request logs with a react component and SSR (Next.js) support
The npm package axios-ui receives a total of 4 weekly downloads. As such, axios-ui popularity was classified as not popular.
We found that axios-ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.