mirror of
https://github.com/better-auth/better-auth.git
synced 2026-07-25 05:33:55 -05:00
25 lines
683 B
TypeScript
25 lines
683 B
TypeScript
import type { BetterAuthClientPlugin } from "@better-auth/core";
|
|
import type { apiKey } from ".";
|
|
import { API_KEY_ERROR_CODES } from "./error-codes";
|
|
import { PACKAGE_VERSION } from "./version";
|
|
|
|
export * from "./error-codes";
|
|
|
|
export const apiKeyClient = () => {
|
|
return {
|
|
id: "api-key",
|
|
version: PACKAGE_VERSION,
|
|
$InferServerPlugin: {} as ReturnType<typeof apiKey>,
|
|
pathMethods: {
|
|
"/api-key/create": "POST",
|
|
"/api-key/delete": "POST",
|
|
"/api-key/delete-all-expired-api-keys": "POST",
|
|
},
|
|
$ERROR_CODES: API_KEY_ERROR_CODES,
|
|
} satisfies BetterAuthClientPlugin;
|
|
};
|
|
|
|
export type ApiKeyClientPlugin = ReturnType<typeof apiKeyClient>;
|
|
|
|
export type * from "./types";
|