UNPKG

@clerk/nextjs

Version:

Clerk SDK for NextJS

54 lines 2.13 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var proxy_exports = {}; __export(proxy_exports, { DEFAULT_PROXY_PATH: () => import_proxy2.DEFAULT_PROXY_PATH, clerkFrontendApiProxy: () => clerkFrontendApiProxy, createFrontendApiProxyHandlers: () => createFrontendApiProxyHandlers }); module.exports = __toCommonJS(proxy_exports); var import_proxy = require("@clerk/backend/proxy"); var import_constants = require("./constants"); var import_proxy2 = require("@clerk/backend/proxy"); async function clerkFrontendApiProxy(request, options) { return (0, import_proxy.clerkFrontendApiProxy)(request, { proxyPath: (options == null ? void 0 : options.proxyPath) || import_proxy.DEFAULT_PROXY_PATH, publishableKey: (options == null ? void 0 : options.publishableKey) || import_constants.PUBLISHABLE_KEY, secretKey: (options == null ? void 0 : options.secretKey) || import_constants.SECRET_KEY }); } function createFrontendApiProxyHandlers(options) { const handler = async (request) => { return clerkFrontendApiProxy(request, options); }; return { GET: handler, POST: handler, PUT: handler, DELETE: handler, PATCH: handler }; } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { DEFAULT_PROXY_PATH, clerkFrontendApiProxy, createFrontendApiProxyHandlers }); //# sourceMappingURL=proxy.js.map