
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@clerk/edge
Advanced tools
This package has been deprecated in favor of the isomorphic @clerk/backend
which is now used across all server-enabled Clerk packages. This package will not receive any future updates. It should not be used directly - please use as a reference only.
This package is a wrapper around Clerk core capabilities with added functionality and helpers aimed towards different edge and serverless platforms.
npm install @clerk/edge
To build the package locally with the TypeScript compiler, run:
npm run build
Currently supported environments/platforms:
To use with Edge Functions:
import { withAuth } from '@clerk/edge/vercel-edge';
async function handler(req, event) {
// ...
}
export const middleware = withAuth(handler);
Supported methods:
withAuth
verifySessionToken
ClerkAPI
Clerk's JWT session token, contains the azp
claim, which equals the Origin of the request during token generation. You can provide the middlewares with a list of whitelisted origins to verify against, to protect your application of the subdomain cookie leaking attack.
Example implementation:
import { withAuth } from '@clerk/edge/vercel-edge';
const authorizedParties = ['http://localhost:3000', 'https://example.com'];
async function handler(req, event) {
// ...
}
export const middleware = withAuth(handler, { authorizedParties });
For further details and examples, please refer to our Documentation.
You can get in touch with us in any of the following ways:
We're open to all community contributions! If you'd like to contribute in any way, please read our contribution guidelines.
@clerk/edge
follows good practices of security, but 100% security cannot be assured.
@clerk/edge
is provided "as is" without any warranty. Use at your own risk.
For more information and to report security issues, please refer to our security documentation.
This project is licensed under the MIT license.
See LICENSE for more information.
FAQs
Clerk SDK for serverless and edge environments
The npm package @clerk/edge receives a total of 84 weekly downloads. As such, @clerk/edge popularity was classified as not popular.
We found that @clerk/edge demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.