Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@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 70 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.