{"plugin":{"id":5,"name":"cloudflare-pages-functions-action","icon":"🔁","description":"Transform your API call into Fully typeSafe server Action.","longDescription":"### Introduction\nThis plugin is designed to bring type-safe server actions to Cloudflare Pages, enabling developers to write server-side functions that can be called from the client as async functions with full TypeScript type safety.\n\n#### Key Features\n* **Dev Mode HMR**: Hot Module Replacement (HMR) support in development mode for seamless and efficient development.\n* **File Uploads**: Ability to upload a single file or an array of files.\n* **Serializable Params**: Support for serializable parameters, allowing for flexible and type-safe data transfer.\n* **FormData Support**: Compatibility with FormData for easy file uploads and form data handling.\n* **Full TypeScript Type Safety**: Ensuring that all server actions are fully type-safe, reducing errors and improving code maintainability.","version":"0.1.0","compatibleVersions":"^2.0.4","author":"Justin Halle","ownerId":"c166cdde-5f5c-40e5-a3ff-236652fa88a9","category":"api","tags":["server action","cloudflare pages","cloudflare"],"published":true,"npmPackage":"frame-master-plugin-cloudflare-pages-functions-action","githubUrl":"https://github.com/shpaw415/frame-master-plugin-cloudflare-pages-functions-action","docsUrl":"","installation":"bun add frame-master-plugin-cloudflare-pages-functions-action","quickStart":"// src/actions/user/profile.ts\n\nimport { getContext } from \"frame-master-plugin-cloudflare-pages-functions-action/context\";\n\n// create your action\nexport async function GET() {\n  const ctx = getContext<globalThis.Clouflare.Env, any, any>(arguments);\n\n  // Access Cloudflare environment\n  const user = await ctx.env.KV.get(\"current-user\");\n\n  return {\n    name: \"John Doe\",\n    email: \"john@example.com\",\n  } as const;\n}\n\nexport async function POST(\n  userId: string,\n  data: { name: string; email: string }\n) {\n  const ctx = getContext(arguments);\n\n  // Save to Cloudflare KV\n  await ctx.env.KV.put(`user:${userId}`, JSON.stringify(data));\n\n  return {\n    success: true,\n    userId,\n  } as const;\n}\n\n// src/index.ts\nimport {\n  GET as getProfile,\n  POST as updateProfile,\n} from \"src/actions/user/profile\";\n\n// Fully type-safe function calls\nconst profile = await getProfile();\nconsole.log(profile.name); // TypeScript knows this exists!\n\nconst result = await updateProfile(\"123\", {\n  name: \"Jane Doe\",\n  email: \"jane@example.com\",\n});\nconsole.log(result.success); // Type-safe!\n\n\n","configuration":"import CloudFlareWorkerAction from \"frame-master-plugin-cloudflare-pages-functions-action\";\nimport type { FrameMasterConfig } from \"frame-master/server/types\";\n\nexport default {\n  plugins: [\n    CloudFlareWorkerAction({\n      actionBasePath: \"src/actions\", // Directory containing your actions\n      outDir: \".frame-master/build\", // Build output directory\n      serverPort: 8787, // Optional: Wrangler dev server port (default: 8787)\n    }),\n    // ... other plugins\n  ],\n} satisfies FrameMasterConfig;","upvote":0,"downvote":0,"createdAt":"2025-11-29T18:39:21.000Z","updatedAt":"2025-11-29T19:16:14.000Z","dependencies":[]}}