@x402sentinel/next
v0.1.0
Published
Sentinel for Next.js — audit x402 payments in API routes and server actions
Maintainers
Readme
@x402sentinel/next
Sentinel for Next.js. One line.
Install
npm install @x402sentinel/next @x402sentinel/x402Usage
Route handler wrapper
// app/api/data/route.ts
import { withSentinel } from "@x402sentinel/next";
export const GET = withSentinel(async (req, sentinelFetch) => {
const res = await sentinelFetch("https://api.example.com/paid");
return Response.json(await res.json());
});Standalone fetch
import { createSentinelFetch } from "@x402sentinel/next";
const sentinelFetch = createSentinelFetch({ agentId: "my-agent" });
export async function getServerSideProps() {
const res = await sentinelFetch("https://api.example.com/paid");
return { props: { data: await res.json() } };
}Links
License
MIT
