
Product
PHP and Composer Support Is Now in Beta
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.
@decionis/presence-vercel
Advanced tools
Presence enforcement for Vercel / Next.js: gate sensitive routes on a verified Presence session or a locally-verified ES256 proof — as Edge Middleware with no application code, or as a withPresence wrapper on individual route handlers.
Presence adds execution-time human verification to sensitive Next.js routes. It gates configured
POST, PUT, and DELETE requests before they reach your application, validates Presence sessions
and ES256 proofs locally at the edge, and returns explicit 403 or 503 outcomes when verification
is denied or unavailable — the same enforcement contract (docs/41)
the Cloudflare and Fastly edge filters ship, with the execution mode as a developer choice.
npm install @decionis/presence-vercel
Set three Vercel environment variables (server-side only — the tenant secret never reaches the
browser): PRESENCE_API_SECRET, PRESENCE_TENANT_ID, and optionally PRESENCE_API_HOST
(defaults to https://presence.decionis.com).
Route selection lives in middleware.ts, with no application code:
// middleware.ts
import { createPresenceMiddleware } from "@decionis/presence-vercel";
export const middleware = createPresenceMiddleware({
apiHost: "https://presence.decionis.com",
apiSecret: process.env.PRESENCE_API_SECRET!, // a Vercel env var, server-side only
tenantId: process.env.PRESENCE_TENANT_ID!,
protectedRoutes: "/api/checkout/*,/api/transfer",
});
export const config = { matcher: ["/api/:path*"] };
Where the choice belongs in code, wrap the handler itself — there is no protectedRoutes, because
wrapping is the selection:
// app/api/transfers/route.ts
import { withPresence } from "@decionis/presence-vercel";
export const POST = withPresence(async (req) => {
return Response.json({ ok: true });
});
withPresence reads PRESENCE_API_HOST (defaulting to the production API), PRESENCE_API_SECRET,
and PRESENCE_TENANT_ID from the environment at first request; a config object can also be passed
as a second argument. A gated write whose configuration cannot verify anything fails closed (503),
never open.
Both modes run the identical gate on write requests (POST/PUT/DELETE):
| Condition | Result |
|---|---|
Valid x-presence-proof | Verified locally against the JWKS, forwarded (no API) |
x-presence-token valid, risk ≤ 0.75 | Forwarded to the app / handler |
| Token missing | 403 { code: "PRESENCE_TOKEN_MISSING" } |
| Token invalid / high-risk | 403 { code: "PRESENCE_CHALLENGE_FAILED" } |
/v1/verify unavailable | Fail closed 503 PRESENCE_VERIFICATION_UNAVAILABLE |
| Non-write method or unselected route | Continues to the app |
The middleware returns a Response to short-circuit, or undefined to continue — so it drops into
a Next.js middleware.ts or any Vercel Edge Function. withPresence returns the denial or the
handler's own Response, and passes the route context ({ params }) through untouched. Everything
is Web APIs only, so it runs on the Vercel Edge Runtime and the Node runtime alike; the test
suite runs in the Edge Runtime (vitest edge-runtime environment). See docs/44 in the repository.
Apache-2.0. Use of the hosted Presence service is governed separately.
FAQs
Presence enforcement for Vercel / Next.js: gate sensitive routes on a verified Presence session or a locally-verified ES256 proof — as Edge Middleware with no application code, or as a withPresence wrapper on individual route handlers.
We found that @decionis/presence-vercel demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.

Research
/Security News
Three compromised Rust crates pulled in a malicious dependency that downloaded and executed cross-platform malware during Cargo builds.