v1.0.0
Major Changes
-
39ae0f4: Bump Clerk dependencies
@clerk/backendand@clerk/sharedto Clerk Core 3 versions.This release also raises the minimum supported
elysiaversion to1.4.0.
Minor Changes
-
9684bc8: Introduces machine authentication, supporting four token types:
api_key,oauth_token,machine_token, andsession_token. For backwards compatibility,session_tokenremains the default when no token type is specified. This enables machine-to-machine authentication and use cases such as API keys and OAuth integrations. Existing applications continue to work without modification.You can specify which token types are allowed by using the
acceptsTokenoption in theauth()function. This option can be set to a specific type, an array of types, or'any'to accept all supported tokens.Example usage:
import { clerkPlugin } from "elysia-clerk"; export const app = new Elysia() .onError(({ code, error }) => { console.error(code, error); }) .use(clerkPlugin()) .get("/api/protected", ({ auth }) => { const authObject = auth({ acceptsToken: "any" }); if (!authObject.isAuthenticated) { // do something for unauthenticated requests } if (authObject.tokenType === "session_token") { console.log("this is session token from a user"); } else { console.log("this is some other type of machine token"); console.log("more specifically, a " + authObject.tokenType); } }) .listen(8080);