# Agent Workflow URL: https://proofkit.proof.sh/docs/ai/agent-workflow How ProofKit closes the loop for coding agents building FileMaker apps. import { AgentWorkflowLoop } from "@/components/AgentWorkflowLoop"; ProofKit is designed for agents that can do more than produce snippets. The workflow gives the agent real FileMaker context, a project it can edit, and feedback it can use to fix mistakes. ## The loop ## What each step needs * **Next change**: the user asks for a new screen, behavior, or refinement. * **Read FileMaker schema**: the MCP server exposes file metadata and data context to the agent. * **Write app code**: the agent edits a normal web project using React, TypeScript, Tailwind, and shadcn/ui. * **Run checks**: TypeGen and TypeScript catch many schema and field-name mistakes before runtime. * **Preview in browser**: the agent can inspect the app as it runs, not just reason about code. * **Fix issues**: errors, screenshots, and build output become feedback for the next edit. * **Deploy to FileMaker**: the final bundle is pushed into the file and loaded by the Web Viewer. ## Why this matters Without the loop, you are usually copying FileMaker metadata into a chat, pasting code back into a project, discovering errors manually, and asking the model to try again. ProofKit gives the agent enough context and feedback to handle more of that cycle directly. ## Boundaries ProofKit v2 focuses on agentic coding of Web Viewer apps. It does not make the agent a full FileMaker schema editor. Scripts, tables, fields, layouts, and value lists remain outside the supported writing scope for this release. ## Related pages * [Install and Connect](/docs/ai/install-and-connect) * [Build a Web Viewer App](/docs/ai/build-a-webviewer-app) * [Hybrid App Architecture](/docs/webviewer/architecture) --- # Build a Web Viewer App URL: https://proofkit.proof.sh/docs/ai/build-a-webviewer-app Scaffold and iterate on a FileMaker Web Viewer app with your coding agent. import { Step, Steps } from "fumadocs-ui/components/steps"; After ProofKit is connected and your agent understands the file, switch from exploration to building. The goal is a local web project that previews in the browser and can later be deployed into FileMaker. ## Build loop **Ask the agent to scaffold a Web Viewer project.** Open your coding agent, such as Cursor, Claude Code, Codex, OpenCode, or another MCP-compatible agent, in an empty project folder before you start. Copy this prompt into your agent: ```text title="Prompt" Set up a ProofKit Web Viewer project in this folder. ``` The project should use the current ProofKit stack: React, TypeScript, Vite, Tailwind, shadcn/ui, TanStack Query, and TypeGen. **Run the local preview.** The agent should start the dev server and open the app in a browser so it can inspect the result. Agents also have embedded browsers, so they can inspect the result without leaving the agentic loop. If the agent doesn't open a browser, ask it to use it's preview browser. ```text title="Prompt" Use your embedded browser or preview browser to inspect and monitor your work. ``` **Ask for a specific screen.** Start with one workflow: a dashboard, detail view, calendar, kanban board, rich form, or data grid. ```text title="Prompt" Build a customer viewer with a searchable list view. ``` Local preview of a generated ProofKit Web Viewer app showing FileMaker-backed customer data. *After you ask the agent to build a screen, the desktop session can look like this: agent messages on the left and an embedded browser preview on the right, showing FileMaker data from the connected FileMaker file.* **Let the agent iterate.** The useful loop is not just code generation. The agent should typecheck, run lint/build commands, inspect browser errors, and fix issues. ## Style and theme ProofKit projects use shadcn/ui and Tailwind, so the agent can apply a theme or preset by editing normal project files. Use [shadcn/ui Create](https://ui.shadcn.com/create?) to explore visual presets. Copy a preset code, then ask your agent to apply it to the project to quickly change colors, typography, icons, and component styling. ```text title="Prompt" Apply this shadcn/ui preset to the project: ``` The same generated customer viewer after applying a different visual preset. *The same generated screen after applying a different preset, with updated colors, typography, and corner radiuses.* ## Reference docs * Use [Install and Connect](/docs/ai/install-and-connect) for project setup details. * Use [TypeGen](/docs/typegen) when your FileMaker layout metadata changes. * Use [Web Viewer](/docs/webviewer/package) for lower-level bridge behavior. * Use [Hybrid App Data Access](/docs/webviewer/data-access) for layout and Execute Data API patterns. ## Next step When the app works locally, continue to [Deploy to FileMaker](/docs/ai/deploy-to-filemaker). --- # Chat Mode vs Code Mode URL: https://proofkit.proof.sh/docs/ai/chat-vs-code-mode Understand when to use ProofKit for FileMaker exploration and when to use it to build Web Viewer apps. ProofKit is useful in two different AI workflows: chat-first exploration and agentic app development. Both use the same FileMaker connection, but they are not trying to do the same job. ## Chat mode Chat mode is best when you want to talk to your FileMaker file. In a chat-first tool such as Claude Desktop or ChatGPT, ProofKit can expose FileMaker context to the model. The assistant can read metadata, inspect layouts and fields, understand relationships, run read-only queries, summarize records, and help you reason about the shape of your data. This is useful even if you never build a Web Viewer app. Good chat-mode prompts include: ```text title="Prompt" Summarize the tables, layouts, and relationships in this FileMaker file. ``` ```text title="Prompt" Show me a table of the last ten invoices in the system. ``` ```text title="Prompt" Show me an ERD diagram for this FileMaker file. ``` **Works with Claude Desktop Chat** ```text title="Prompt" Use the visualizer to show recent invoice revenue by month. ``` Some chat tools also include built-in visualization features. For example, Claude can turn queried FileMaker data into charts, summaries, and dashboard-style artifacts directly inside the conversation. Chat mode is good for: * Exploring schema and relationships. * Asking questions about FileMaker data. * Creating summaries, reports, and charts. * Prototyping dashboard ideas before building. * Deciding what Web Viewer app would be worth making. Chat mode is not the full ProofKit app-building loop. The assistant may understand your file, but it usually is not editing a project, running TypeScript checks, previewing a browser app, or deploying a bundle back into FileMaker. ## Code mode Code mode is for building software. In a coding agent such as Cursor, Claude Code, Codex, OpenCode, or another MCP-compatible development agent, ProofKit gives the agent FileMaker context while it works inside a real project folder. That means the agent can use your FileMaker metadata and data while also editing files, installing project dependencies, running checks, inspecting browser output, fixing errors, and deploying the finished app into FileMaker. Good code-mode prompts include: ```text title="Prompt" Set up a ProofKit Web Viewer project in this folder. ``` ```text title="Prompt" Build a customer dashboard using the Contacts layout. ``` ```text title="Prompt" Run the app locally, inspect it in the browser, and fix any errors. ``` ```text title="Prompt" Build and deploy this Web Viewer app into my FileMaker file. ``` Code mode is good for: * Scaffolding a ProofKit Web Viewer project. * Building React, TypeScript, Tailwind, and shadcn/ui screens. * Using generated FileMaker types. * Running lint, typecheck, and build commands. * Previewing and debugging the app. * Deploying the bundle into FileMaker. ## How to choose Use chat mode when your goal is understanding, analysis, reporting, or visualization inside the conversation. Use code mode when your goal is a working app: project files, local preview, browser testing, and deployment into FileMaker. A common workflow is to start in chat mode, ask questions about the FileMaker file, identify a useful screen or dashboard, then move to code mode to build it as a real Web Viewer app. ## Related pages * [Explore Your File](/docs/ai/explore-your-file) * [Build a Web Viewer App](/docs/ai/build-a-webviewer-app) * [Agent Workflow](/docs/ai/agent-workflow) --- # Deploy to FileMaker URL: https://proofkit.proof.sh/docs/ai/deploy-to-filemaker Bundle your Web Viewer app and deploy it into a FileMaker file. import { Step, Steps } from "fumadocs-ui/components/steps"; Deployment for a ProofKit Web Viewer app means bundling the web app and storing it in your FileMaker file so it can load inside a Web Viewer layout. This is different from deploying a browser app to a hosting provider. The deployed artifact is HTML and JavaScript living in the FileMaker file. ## Ask the agent to deploy Once the app works locally and FileMaker is connected to ProofKit, you can ask the agent to handle deployment for you: ```text title="Prompt" Deploy the app to my connected FileMaker file. ``` The agent should treat deployment as a release step, not just a file copy. It should run available checks, build the production bundle, deploy the generated HTML through ProofKit, and then verify the result inside FileMaker. Because `deploy_html` writes the bundled app into the connected FileMaker file, only run it against the file you mean to update. If users are connected to a production file, they may see the change immediately, so prefer a development file or a controlled deployment window. Most MCP clients let you disable tools or toggle automatic prompting for individual tools; keep deployment approval on unless you are intentionally working in a safe dev environment. ## Deploy the app When you ask the agent to deploy the app, it should run through these steps for you. The final verification step is the one you should review yourself inside FileMaker. **Run checks before deployment.** The agent runs the project checks it has available, such as typechecking, linting, and a production build. **Bundle the Web Viewer app.** The agent builds the project into a deployable single-file bundle for the FileMaker Web Viewer. **Deploy through ProofKit.** The agent uses ProofKit to send the bundle through the local bridge and store it in the FileMaker file. **Verify inside FileMaker.** This step is for you: navigate to the Web Viewer layout and confirm the deployed app loads with real data. A deployed ProofKit dashboard running inside a FileMaker Web Viewer layout. *A deployed ProofKit app running inside FileMaker, with FileMaker's layout chrome around the Web Viewer and live FileMaker data rendered in the dashboard.* ## End-user requirements Users of the deployed app do not need ProofKit installed. ProofKit is needed during development. The deployed app runs inside FileMaker. ## Next step Continue with [Edit your app](/docs/ai/edit-your-app) for source vs bundled Web Viewer HTML and how to redeploy updates. Then read [Agent Workflow](/docs/ai/agent-workflow) to understand how deployment fits into the larger read, write, verify, and fix loop. --- # Edit your app URL: https://proofkit.proof.sh/docs/ai/edit-your-app Work on Web Viewer source in your project, then rebuild and redeploy the bundle into FileMaker. After you deploy, you will iterate on **source code**, not inside the Web Viewer HTML stored in FileMaker. ## Where your code actually lives * **Your project folder (on disk, usually in Git)** is the source of truth. React components, TypeScript files, Tailwind styles, and build configuration all live here. Your coding agent and editor work against this folder. * **Inside FileMaker** you have a **built bundle**: the single-file HTML (and embedded assets) that ProofKit writes when you deploy. That artifact runs in the Web Viewer; it is the output of a build, not a comfortable place to hand-edit layouts or scripts. If you are used to building everything directly in FileMaker, it helps to separate these two mentally: FileMaker hosts the runtime bundle; your machine hosts the editable app. ## The change loop 1. Open the **same Web Viewer project** in your coding agent (the folder created when you scaffolded the app). 2. **Ask for changes** — new screens, UX tweaks, data wiring, styling. Use the **local preview** so you see updates before touching FileMaker, as described in [Build a Web Viewer App](/docs/ai/build-a-webviewer-app). 3. When you are satisfied, **build and redeploy** so FileMaker receives a fresh bundle, as in [Deploy to FileMaker](/docs/ai/deploy-to-filemaker). Redeployment replaces the stored artifact users load in the Web Viewer. Changing FileMaker layouts, scripts, or fields may require **regenerating types** — see [TypeGen](/docs/typegen) when metadata changes. For how agents iterate with checks and verification, see [Agent Workflow](/docs/ai/agent-workflow). --- # Explore Your File URL: https://proofkit.proof.sh/docs/ai/explore-your-file Use chat mode to understand your FileMaker schema before building. import { Callout } from "fumadocs-ui/components/callout"; Before you build a Web Viewer app, use your agent to explore the FileMaker file. This gives you immediate value from ProofKit and confirms that the agent has useful context. This page focuses on the exploratory side of ProofKit. To understand how chat-first exploration differs from building an app in a coding agent, see [Chat Mode vs Code Mode](/docs/ai/chat-vs-code-mode). ## Useful first prompts ```text title="Prompt" Summarize the tables, layouts, and relationships in this FileMaker file. ``` ```text title="Prompt" Show me a table of the last ten invoices in the system. ``` ```text title="Prompt" Show me an ERD diagram for this FileMaker file. ``` **Works with Claude Desktop Chat** ```text title="Prompt" Use the visualizer to show recent invoice revenue by month. ``` ## Example: ProofKit ERD tool Claude Desktop showing a ProofKit-generated ERD diagram for a connected FileMaker file. *Claude Desktop can use ProofKit to inspect a connected FileMaker file, render an ERD diagram, and summarize the relationships it finds.* ## What the agent can learn * Layout and field names. * Table occurrence and relationship context. * Script names and the likely workflows they support. * Data shapes the future Web Viewer app can use. ## Keep exploration grounded Ask the agent to cite the FileMaker layouts and fields it is using. That keeps ideas tied to real schema instead of generic app suggestions. ProofKit v2 helps agents understand your FileMaker file and build Web Viewer apps. It does not agentically edit tables, fields, layouts, scripts, or value lists in this release. ## Next step When you know the screen you want to build, continue to [Build a Web Viewer App](/docs/ai/build-a-webviewer-app). --- # FAQ URL: https://proofkit.proof.sh/docs/ai/faq Common questions about ProofKit AI and v2. ## What is ProofKit? ProofKit is a toolbox for building FileMaker-backed applications with web technology and AI coding agents. It gives the agent access to FileMaker context, project scaffolding, type-safe data tools, Web Viewer communication, and deployment into your file. ## Is ProofKit a framework? No. It is a collection of tools. A scaffolded ProofKit app is a normal web project using familiar tools such as React, TypeScript, Tailwind, shadcn/ui, and TanStack Query. ## What does ProofKit produce? For the v2 launch path, ProofKit focuses on Web Viewer apps: modern web interfaces that run inside FileMaker. The broader toolchain also supports full web apps backed by FileMaker. ## What does ProofKit cost? ProofKit is free to download and use. The apps you build are yours. The cost you still pay is whatever your AI coding agent or model provider charges. ## Does ProofKit support other models, including DeepSeek models? Yes. ProofKit is an MCP server, so it is not tied to one model provider. If your coding agent supports MCP, ProofKit can work with it, and that agent can use whatever model or model mix you choose, including DeepSeek models. ## Do my users need ProofKit installed? No. ProofKit is a development tool. Once the app is bundled and deployed into FileMaker, users only need the FileMaker runtime environment where the app is deployed. ## Can I control the styling? Yes. ProofKit apps use normal web styling tools: Tailwind, shadcn/ui, React components, and CSS variables. You or your agent can change the theme, layout, and components in the project. ## What happens when the agent writes bad code? ProofKit gives the agent feedback: TypeScript checks, generated types from FileMaker metadata, browser preview, runtime errors, and deployment verification. That does not make agents perfect, but it gives them the information they need to fix many mistakes without constant manual copying and pasting. ## Can ProofKit edit FileMaker scripts, tables, or layouts? Not in the supported v2 release scope. ProofKit helps agents build Web Viewer app code. FileMaker scripts, tables, layouts, value lists, and schema design remain outside the supported agentic writing scope. ## Does ProofKit work in WebDirect? Deployed Web Viewer apps can run in WebDirect, but there are platform-specific considerations around refresh behavior and runtime context. See [Platform Notes](/docs/webviewer/platform-notes). ## How does team workflow work? For the web project, use normal web development practices: Git, branches, pull requests, CI, and code review. For the FileMaker file, ProofKit does not replace FileMaker's existing shared development model. ## Where do I get help? Join the [ProofKit community](https://community.proof.sh/c/proofkit) to ask questions, share what you build, and get unstuck. --- # Getting Started URL: https://proofkit.proof.sh/docs/ai/getting-started ProofKit AI path from install through deploy, editing source, and redeploying updates. import { Step, Steps } from "fumadocs-ui/components/steps"; This page is the overview for the ProofKit v2 happy path. Use it to understand the sequence: install ProofKit and connect MCP, explore your FileMaker file with your agent, build a Web Viewer app, deploy it into FileMaker, then keep working in your source project and redeploy when ready. Each step below maps to **one guide**: install and connect (single walkthrough), explore, build, deploy, and editing after deploy — with detailed instructions and companion videos where available. ## Before you start Ensure you have the following prerequisites installed on your computer before installing ProofKit. * FileMaker Pro (client for Mac or Windows) * MCP-compatible coding agent (e.g. [Cursor](https://cursor.com), [Claude Desktop](https://claude.com/download), [Codex](https://chatgpt.com/codex/), etc.) * [Node.js](https://nodejs.org/en/download/) (a supported LTS release, such as 22.x, 24.x, or 26.x) * [pnpm](https://pnpm.io/) (version 11 is recommended; it is currently the most secure package manager option) * Git (source control tool for managing the web code your agent will produce) If you are using a chat-first tool such as Claude Desktop or ChatGPT, you can still use ProofKit to explore FileMaker metadata and data. Building Web Viewer apps requires a coding agent that can work in a project folder. See [Chat Mode vs Code Mode](/docs/ai/chat-vs-code-mode) for the difference. See [Technical Requirements](/docs/ai/technical-requirements) for the full support matrix. ## Setup **Install ProofKit, connect MCP, and verify your file.** Run the installer and add-on, run **Connect to MCP** in FileMaker Pro, keep the connector Web Viewer open in Browse mode, and ask your agent to confirm it sees your open file. Continue with [Install and Connect](/docs/ai/install-and-connect) (covers install through verification). **Explore your file in chat mode.** Ask your agent about tables, layouts, fields, relationships, and data. This proves the connection is useful before you ask it to build anything. For a deeper explanation of exploration versus app development, see [Chat Mode vs Code Mode](/docs/ai/chat-vs-code-mode). Continue with [Explore Your File](/docs/ai/explore-your-file). **Build a Web Viewer project.** Scaffold a project, run a local preview, ask your agent to build a real screen, and let the agent iterate with type checks and browser feedback. Continue with [Build a Web Viewer App](/docs/ai/build-a-webviewer-app). **Deploy into FileMaker.** Bundle the app, deploy it into your FileMaker file, and verify it runs inside the Web Viewer layout. Continue with [Deploy to FileMaker](/docs/ai/deploy-to-filemaker). **Edit source and redeploy.** Iterate on your project on disk — that is where your React and TypeScript source lives — then build and redeploy the bundle stored in FileMaker whenever you want users to pick up changes. Continue with [Edit your app](/docs/ai/edit-your-app). ## What to read next * [Install and Connect](/docs/ai/install-and-connect) covers installer, MCP connection, and verification. * [Edit your app](/docs/ai/edit-your-app) separates source projects from bundles stored in FileMaker. * [Agent Workflow](/docs/ai/agent-workflow) explains the read, write, verify, and fix loop. * [Hybrid Apps](/docs/webviewer) explains the runtime model. * [FAQ](/docs/ai/faq) answers common scope, cost, and platform questions. --- # GitHub Workflow URL: https://proofkit.proof.sh/docs/ai/github-workflow A friendly introduction to Git and GitHub for FileMaker developers. import { Step, Steps } from "fumadocs-ui/components/steps"; If you've spent your career in FileMaker, Git can feel intimidating. The good news: you don't need to memorize commands or become a Git expert. Your AI agent can run the commands for you. What you *do* need is a mental model of where your code lives and how it moves around. That's what this guide is for. When you create a new ProofKit project, Git is initialized for you — there's nothing to configure inside the project itself. If you're completely new to Git, you may want to ask your agent to help you configure Git on your machine. This sets things like your name and email address, which get automatically attached to every commit so the version history knows who made each change. ## The model you already know In FileMaker, your file lives on a server. You and your teammates open it, make changes, and everyone sees those changes immediately. There's only ever one copy that matters: the hosted file. This model is simple because there's nothing to sync. The file is in one place, and editing *is* saving. There's also no real history — once a change is made, the previous version is gone unless someone happened to take a backup. ## How code projects work Web code projects work differently. Instead of one shared file on a server, every developer has their own complete copy of the project on their own machine. That copy is just a folder, but in Git terms it's called a **repo** (short for repository). You make changes in your local repo, and when you're ready, you push those changes up to a service like **GitHub**. GitHub holds the canonical copy that everyone else syncs with. The big shift: there is no live shared file. Each developer works in their own copy, and Git is the tool that keeps those copies in sync. ## Terms you'll run into You don't need to learn these all at once, but it helps to recognize them when your agent (or a teammate) uses them: * **Repo** — the project folder, tracked by Git. You'll have a local one on your machine and a remote one on GitHub. * **Clone** — make a local copy of a remote repo on your machine. * **Commit** — a saved snapshot of your changes, with a short message describing what you did. Think of it as a deliberate "save point" you can always return to. * **Push** — send your local commits up to GitHub so others can see them. * **Pull** — bring down commits that teammates have pushed, so your local copy is up to date. * **Branch** — a parallel line of work. You can experiment on a branch without affecting the main version of the project. * **Merge** — combine the changes from one branch into another, usually merging a finished branch back into the main one. * **Pull request (PR)** — a proposal on GitHub to merge one branch into another, usually with a teammate reviewing the changes first. * **Conflict** — what happens when two people change the same lines of the same file. Git asks you to decide which version wins. If any of these come up and you want a deeper explanation in the context of your own project, just ask your agent. ## What this gives you Once your project lives on GitHub, you get things FileMaker developers have long wished for: * **Full history.** Every change is recorded with who made it, when, and why. * **Branches.** Try out a risky change in a separate branch without touching the main version. Throw it away if it doesn't work, or merge it in if it does. * **Pull requests.** Have a teammate review your changes before they become part of the main project. * **Safe collaboration.** Two developers can work on the same project at the same time without overwriting each other. ## Let your agent do the heavy lifting You don't need to memorize Git commands. When you want to do something, just ask your agent in plain language: ```text title="Commit your changes" Commit my current changes with a clear message. ``` ```text title="Create a branch" Create a new branch called fix-customer-list and switch to it. ``` ```text title="Push to GitHub" Push my work to GitHub. ``` ```text title="Compare local and remote" What's the difference between my local copy and what's on GitHub? ``` If a Git concept comes up that you want to understand better — branches, merges, rebases, conflicts — ask the agent to explain it in the context of your project. That's a much faster way to learn than reading Git documentation cold. In FileMaker, saving and history don't really come up — your changes are just there. In a code project, the equivalent of "saving your work to history" is making a **commit**: a snapshot of the project at a moment in time that you can always come back to. When you want your work recorded, ask the agent to **commit** your changes. That keyword is what tells the agent you want a Git snapshot, not just an edit. Get in the habit of committing often — every commit is a safe point you can return to. ## Publish your project to GitHub When you create a new ProofKit project, the local repo on your machine is ready to go — but nothing is on GitHub yet. To get the benefits of remote backup, history you can browse online, and collaboration, you'll want to publish it. **Create a free GitHub account.** Go to [github.com](https://github.com) and sign up. The free tier is plenty for personal projects and small teams — there's no need to pay for anything to get started. **Install the GitHub CLI and sign in.** The GitHub CLI (`gh`) is what your agent will use to talk to GitHub on your behalf. Install it from [cli.github.com](https://cli.github.com), then sign in by running this once in your terminal: ```bash gh auth login ``` Follow the prompts to authenticate with your GitHub account. You only need to do this once per machine. **Ask your agent to publish the project.** With the CLI installed and authenticated, your agent can create the GitHub repo and push your project up for you. ```text title="Prompt" Publish this project to a new GitHub repo on my account. ``` The agent will confirm the details before creating anything on your account. ## Next step From here on, the workflow becomes a habit: edit, commit, push, repeat. Any time you're not sure what to do next, ask your agent — that's the fastest way to learn Git in the context of your own project. --- # Introduction URL: https://proofkit.proof.sh/docs/ai Build modern FileMaker apps with coding agents, WebViewers, and TypeScript tools. import { Card, Cards } from "fumadocs-ui/components/card"; import { Callout } from "fumadocs-ui/components/callout"; ProofKit helps you build modern web interfaces for FileMaker while keeping your FileMaker file at the center of the app. It connects your AI coding agent to your FileMaker file so it can understand your schema, build a modern Web Viewer app, run checks, preview the result, and deploy the bundle back into FileMaker. If you're new, follow the guided path below. The package docs are here when you need API details, but the pages in this section walk from first install to a deployed FileMaker app. ## Start Here Install ProofKit, connect your file, build an app, deploy it, then edit source and redeploy into FileMaker. See how ProofKit helps agents read, write, verify, and fix FileMaker-backed apps. Learn when to use ProofKit for conversational FileMaker exploration and when to build a Web Viewer app. Learn how modern web UI runs inside FileMaker while keeping FileMaker's platform strengths. Scaffold, preview, and iterate on a FileMaker Web Viewer app with your coding agent. ## What ProofKit gives the agent * Metadata access to your open FileMaker file. * Type-safe project scaffolding for a modern web stack. * A bridge for FileMaker scripts, data, and Web Viewer communication. * Deployment tooling that bundles the app into the FileMaker file. * Feedback loops so the agent can inspect errors and iterate. Start here first, then use the Web Viewer, TypeGen, and FMDAPI sections as reference material when a guide points you there. ## Recommended path 1. Read [Getting Started](/docs/ai/getting-started) for the full journey. 2. Confirm your machine and file meet the [technical requirements](/docs/ai/technical-requirements). 3. Learn why ProofKit starts with [hybrid Web Viewer apps](/docs/webviewer/why-webviewers). 4. Keep the [FAQ](/docs/ai/faq) nearby for scope, runtime, and team workflow questions. ## Tools and Packages ProofKit projects use the packages below; each part is documented separately if you want to understand or use it directly. Generate TypeScript types and validation schemas from FileMaker layouts. Use the Web Viewer bridge to communicate between FileMaker and your app. Work with the FileMaker Data API from TypeScript. Use a strongly typed FileMaker OData client. Add self-hosted auth backed by your FileMaker database. --- # Install and Connect URL: https://proofkit.proof.sh/docs/ai/install-and-connect Install ProofKit and confirm your agent can see your FileMaker file. import { Step, Steps } from "fumadocs-ui/components/steps"; The first milestone is simple: your coding agent should be able to communicate with an open FileMaker file through ProofKit. ProofKit installs several pieces that work together: a FileMaker add-on, a FileMaker plug-in, a connector script, an MCP server, and agent integrations. ## Install ProofKit **Download and run the installer.** Get the installer for your platform: The installer sets up the local ProofKit tools and registers integrations for supported coding agents. When it finishes, **fully restart both FileMaker Pro and your coding agent** (Claude Desktop, Cursor, etc.) so they pick up the new plug-in and integrations. Skipping this restart is the most common cause of connection failures. **Open your FileMaker file in FileMaker Pro.** ProofKit works against an open local or hosted file. FileMaker Server is not required for the development loop. **Add the ProofKit add-on to the file.** The add-on installs the scripts, layout, table, and custom function ProofKit uses to communicate with your file and store deployed app bundles. **Enable the ProofKit plug-in.** In FileMaker Pro, open the Plug-Ins settings and confirm the ProofKit plug-in is enabled. The **Connect to MCP** script needs this plug-in to communicate with the local MCP server. **Run the Connect to MCP script.** In FileMaker Pro, run the **Connect to MCP** script installed by the add-on. It opens the connector Web Viewer that registers your file with the local MCP server. Leave the connector Web Viewer open in Browse mode while you work. ## Verify the connection Open your agent and ask it to confirm that ProofKit can see your FileMaker file. A good first prompt: ```text title="Prompt" Use ProofKit to verify my FileMaker connection, list the connected file, and summarize the available layouts. If nothing is connected, tell me what to fix before I continue. ``` Claude Code verifying a FileMaker connection with ProofKit and summarizing available layouts. *Claude Code following the prompt and confirming the connected file and layouts.* If the agent cannot see your file, re-run **Connect to MCP** in FileMaker Pro and confirm the connector Web Viewer remains open in Browse mode. For the full checklist, see [fmBridge troubleshooting](/docs/webviewer/fm-bridge#troubleshooting). ## Next step Once the connection works, continue to [Explore Your File](/docs/ai/explore-your-file). --- # Manual MCP Setup URL: https://proofkit.proof.sh/docs/ai/manual-mcp-setup Register the ProofKit MCP server with a coding agent by hand when the installer cannot do it for you. import { Callout } from "fumadocs-ui/components/callout"; The ProofKit installer automatically registers the `proofkit-mcp` server with the coding agents it knows about — Claude Desktop, Claude Code, Cursor, Codex, VS Code, Windsurf, and Gemini CLI. This page is for the cases where that automatic step is not enough: * The installer reported a failure or skipped your agent. * You want to register ProofKit with an MCP-compatible agent the installer does not detect. * You want to edit the server arguments by hand, for example to add or remove the [telemetry flag](/docs/ai/telemetry). You still need to run the ProofKit installer at least once so the `proofkit-mcp` binary, the FileMaker plug-in, and the add-on are present on your machine. This page only covers the agent config file step. ## Where the `proofkit-mcp` binary lives You will point your agent at the absolute path to the `proofkit-mcp` binary that the installer placed on your machine. | Platform | Path | | ------------ | -------------------------------------------------- | | macOS, Linux | `~/.local/bin/proofkit-mcp` | | Windows | `%LOCALAPPDATA%\ProofKit\MCP\bin\proofkit-mcp.exe` | Replace `~` and `%LOCALAPPDATA%` with the fully resolved path in the JSON or TOML snippets below. Most agents require an absolute path. ## The server entry Every supported agent uses the same logical server entry. The only differences are the file format (JSON or TOML), the wrapper key, and where the file lives. ```json title="The shared server entry" { "command": "/Users/you/.local/bin/proofkit-mcp", "args": [], "env": {} } ``` * `command` — absolute path to `proofkit-mcp`. * `args` — leave empty for default behavior. Add `"--disable-telemetry"` here to opt out of [anonymous usage statistics](/docs/ai/telemetry). * `env` — leave empty unless you need an advanced override such as `FM_HTTP_BASE_URL`, `FM_MCP_EXPERIMENTAL_FEATURES`, or `FM_MCP_EXPOSE_LOW_LEVEL_DATA_API_TOOLS`. ## Per-agent config Open the config file for your agent, add the server entry under the correct wrapper key, save, and restart the agent. **Config file** * macOS: `~/Library/Application Support/Claude/claude_desktop_config.json` * Windows: `%APPDATA%\Claude\claude_desktop_config.json` **Wrapper key:** `mcpServers` ```json { "mcpServers": { "proofkit-mcp": { "command": "/Users/you/.local/bin/proofkit-mcp", "args": [], "env": {} } } } ``` Quit and reopen Claude Desktop after saving. **Config file:** `~/.claude.json` **Wrapper key:** `mcpServers` ```json { "mcpServers": { "proofkit-mcp": { "command": "/Users/you/.local/bin/proofkit-mcp", "args": [], "env": {} } } } ``` Restart Claude Code after saving. **Config file:** `~/.cursor/mcp.json` **Wrapper key:** `mcpServers` ```json { "mcpServers": { "proofkit-mcp": { "command": "/Users/you/.local/bin/proofkit-mcp", "args": [], "env": {} } } } ``` Restart Cursor after saving. **Config file:** `~/.codex/config.toml` Codex uses TOML, not JSON. **Wrapper key:** `mcp_servers`. ```toml [mcp_servers.proofkit-mcp] command = "/Users/you/.local/bin/proofkit-mcp" args = [] [mcp_servers.proofkit-mcp.env] ``` Restart Codex after saving. **Config file** * macOS: `~/Library/Application Support/Code/User/mcp.json` * Windows: `%APPDATA%\Code\User\mcp.json` **Wrapper key:** `servers` (not `mcpServers`). ```json { "servers": { "proofkit-mcp": { "command": "/Users/you/.local/bin/proofkit-mcp", "args": [], "env": {} } } } ``` Reload the VS Code window after saving. **Config file:** `~/.codeium/windsurf/mcp_config.json` **Wrapper key:** `mcpServers` ```json { "mcpServers": { "proofkit-mcp": { "command": "/Users/you/.local/bin/proofkit-mcp", "args": [], "env": {} } } } ``` Restart Windsurf after saving. **Config file:** `~/.gemini/settings.json` **Wrapper key:** `mcpServers` ```json { "mcpServers": { "proofkit-mcp": { "command": "/Users/you/.local/bin/proofkit-mcp", "args": [], "env": {} } } } ``` Restart the Gemini CLI session after saving. ## Other MCP-compatible agents Any agent that speaks MCP over stdio can run ProofKit. The agent only needs to launch the `proofkit-mcp` binary as a child process and talk to it with the MCP protocol. Follow your agent's documentation for how to add an MCP server and use the **shared server entry** above as the values. If your agent supports the standard `mcpServers` wrapper key (Claude Desktop, Cursor, Windsurf, Gemini CLI all use it), the Claude Desktop snippet is a safe starting point. ## Verify the connection After restarting your agent, ask it to use ProofKit. A good first prompt: ```text title="Prompt" Use ProofKit to verify my FileMaker connection, list the connected file, and summarize the available layouts. If nothing is connected, tell me what to fix before I continue. ``` If the agent reports it cannot find the server, double-check the absolute path to `proofkit-mcp` and that the file is executable. On macOS and Linux, you can run the binary directly from a terminal to confirm it launches: ```sh ~/.local/bin/proofkit-mcp --help ``` ## Related guides * [Install and Connect](/docs/ai/install-and-connect) * [Telemetry](/docs/ai/telemetry) * [Troubleshooting](/docs/ai/troubleshooting) --- # Technical Requirements URL: https://proofkit.proof.sh/docs/ai/technical-requirements What you need to build and run ProofKit v2 apps. import { Tab, Tabs } from "fumadocs-ui/components/tabs"; ProofKit v2 is designed for FileMaker developers using agentic coding tools to build Web Viewer apps. ## FileMaker version ProofKit v2 requires **FileMaker 22 or greater**. Future ProofKit releases will track the next major FileMaker release cycle so ProofKit can take advantage of new platform capabilities as they become available. ## Development machine To build ProofKit apps, you need: * **FileMaker Pro** with the target file open. * **Node.js LTS** installed locally. Choose a release that is explicitly marked LTS. Today that means **Node.js 22**, **Node.js 24**, or **Node.js 26**. * **pnpm** version 11 is recommended. It is currently the most secure package manager option. * **An MCP-compatible coding agent**, such as Cursor, Claude Code, Codex, OpenCode, or another agent that supports MCP servers. FileMaker Server is not required for the development loop. ProofKit can work against a local or hosted file as long as it is open in FileMaker Pro. ## Node.js ProofKit projects use Node.js for the local development tools that scaffold, build, preview, and deploy Web Viewer apps. Pick an LTS release rather than the newest "Current" release. Node's odd-numbered releases are short-lived, and not every even-numbered release is the right choice forever; use a version that [nodejs.org marks as LTS](https://nodejs.org/en/download/). If you are not already managing Node versions, the native installer from nodejs.org is the simplest option. Download the LTS installer for macOS or Windows from [nodejs.org/download](https://nodejs.org/en/download/). Choose Node.js 26 LTS when available, or Node.js 24 LTS or Node.js 22 LTS if your environment standardizes on one of those versions. After installing, verify the version: ```sh node -v npm -v ``` On macOS, Homebrew is convenient if you already use it. Install a versioned LTS formula instead of the unversioned `node` formula, which may track a newer non-LTS release. ```sh brew install node@24 node -v ``` If `node` is not found after installation, run `brew info node@24` and follow Homebrew's PATH instructions. Use a version manager if you switch between projects with different Node requirements. ```sh nvm install --lts nvm use --lts ``` `fnm` and Volta are good alternatives. The important part is pinning your project to an LTS line such as Node.js 26, Node.js 24, or Node.js 22. ## pnpm ProofKit projects use `pnpm` for workspace installs, scripts, and monorepo tooling. We recommend **pnpm 11** because it is the fastest and most secure package manager available for the Node.js ecosystem. * Learn more: [pnpm.io](https://pnpm.io/) * Installation guide: [pnpm installation docs](https://pnpm.io/installation) After installing, verify your version: ```sh pnpm -v ``` ## Developer background You do not need to be a web developer to get started. Familiarity with React, TypeScript, a terminal, and Git will help, but the workflow is designed so the agent does much of the setup and implementation work. ## Runtime environments After a Web Viewer app is bundled and deployed into FileMaker, it can run in: * FileMaker Pro on macOS and Windows. * FileMaker Go on iOS and iPadOS. * FileMaker WebDirect. See [Platform Notes](/docs/webviewer/platform-notes) for runtime caveats. ## Out of scope for v2 ProofKit v2 enables agentic coding of Web Viewer apps. It does not currently enable agentic editing of: * Scripts. * Tables and fields. * Layouts. * Value lists. * Other FileMaker schema or design elements. ## Summary | Requirement | Value | | ------------------------ | ------------------------------------------- | | FileMaker version | FileMaker 22 or greater | | Agent environment | Any MCP-compatible agent | | Development requirements | FileMaker Pro and Node.js 22, 24, or 26 LTS | | FileMaker Server | Not required for local development | | Runtime platforms | FileMaker Pro, FileMaker Go, WebDirect | | Agent writing scope | Web Viewer app code | --- # Telemetry URL: https://proofkit.proof.sh/docs/ai/telemetry What anonymous usage statistics ProofKit collects, and how to opt in or out. import { Callout } from "fumadocs-ui/components/callout"; import { Step, Steps } from "fumadocs-ui/components/steps"; ProofKit can send a small amount of anonymous usage data to help us understand which tools are being used and where the MCP server fails. We collect **usage statistics only**. We do not collect anything that identifies you, your FileMaker file, your data, or your code. Telemetry is keyed to a random ID generated on your machine the first time ProofKit runs. It is not tied to your name, email, license, IP address, FileMaker account, file name, or any other personal or business identifier. ## What we collect When telemetry is enabled, ProofKit sends: * **MCP session lifecycle events** — when an MCP session starts and ends, the transport (`stdio`), session duration, the agent client name and version (for example, `Claude Desktop 1.2.3`), and how many tool calls happened in the session. * **Tool call metadata** — the tool name (for example, `connectedFiles`, `execute_filemaker_sql`), how long it took, and whether it succeeded or failed. * **Installer completion** — installer UI used (macOS pkg, Windows NSIS, or CLI), platform, duration, exit code, whether telemetry was enabled, and the installer version. * **A random anonymous ID** — generated on first run and stored locally so repeat sessions from the same machine can be counted as one user. * **ProofKit server version**. ## What we do NOT collect ProofKit telemetry **never** includes: * FileMaker data of any kind — no record values, no field contents, no found sets. * Tool inputs or arguments passed to any MCP tool. * Tool outputs or return values. * SQL queries, layout names, table names, field names, or script names. * Error messages or stack traces. * File names, file paths, or anything about your project structure. * Your name, email, IP address, FileMaker account, or any other identifier. When a tool call fails, we record only that the tool with that name failed and how long it took. The error itself stays on your machine. ## How to opt in or opt out The simplest way to change your telemetry choice is to **run the ProofKit installer again** and check or uncheck the **Allow anonymous usage statistics** option. **Download the latest installer.** **Run the installer.** On the installer screen, look for **Allow anonymous usage statistics**. * **Check the box** to opt in. * **Uncheck the box** to opt out. The default is checked (opted in). **Finish the install.** Your choice is applied immediately. No restart of FileMaker or your agent is required for the telemetry change itself, although other parts of the installer may ask you to relaunch FileMaker. You can re-run the ProofKit installer any time to change your telemetry choice. It does not remove your projects or deployed apps. See [Updating ProofKit](/docs/ai/updating-proofkit) for the full update flow if you also want to update the FileMaker add-on. ## Manually disable telemetry If you cannot re-run the installer, or you registered ProofKit with your agent by hand, you can opt out by adding `--disable-telemetry` to the `args` array of the `proofkit-mcp` entry in your agent's MCP config. ```json title="Example: Claude Desktop, Cursor, Windsurf, Gemini CLI, Claude Code" { "mcpServers": { "proofkit-mcp": { "command": "/Users/you/.local/bin/proofkit-mcp", "args": ["--disable-telemetry"], "env": {} } } } ``` ```toml title="Example: Codex" [mcp_servers.proofkit-mcp] command = "/Users/you/.local/bin/proofkit-mcp" args = ["--disable-telemetry"] ``` Save the config and restart your agent. To re-enable telemetry, remove `"--disable-telemetry"` from `args`. The exact config file path and wrapper key vary by agent. See [Manual MCP Setup](/docs/ai/manual-mcp-setup) for the full list of supported agents, their config file locations, and what to do if your agent is not in that list. ## Why we collect it Anonymous usage statistics help us: * See which MCP tools agents actually use, so we can invest in the right ones. * Spot tools that fail often, so we can fix bugs we would not otherwise hear about. * Understand which agent clients (Claude Desktop, Cursor, Codex, and others) ProofKit is used with. * Measure whether installer changes succeed or fail across platforms. ## Related guides * [Install and Connect](/docs/ai/install-and-connect) * [Updating ProofKit](/docs/ai/updating-proofkit) --- # Troubleshooting URL: https://proofkit.proof.sh/docs/ai/troubleshooting Fix common ProofKit AI setup, preview, and deployment problems. ## I see an error about the ProofKit plug-in There are three common plug-in states: ### The plug-in is disabled If ProofKit is installed but disabled in FileMaker Pro: 1. Open FileMaker Pro. 2. Go to **Settings**. 3. Open the **Plug-Ins** tab. 4. Find the ProofKit plug-in. 5. Enable it. 6. Re-run the **Connect to MCP** script. ### The plug-in failed to load If FileMaker says the ProofKit plug-in failed to load, report a bug in the [ProofKit community](https://community.proof.sh/c/proofkit). ### The plug-in is missing If FileMaker says the ProofKit plug-in is missing, download and install ProofKit again. If you already downloaded and installed it and still see the missing plug-in error, report a bug in the [ProofKit community](https://community.proof.sh/c/proofkit). ## The agent cannot see my FileMaker file If your agent says no file is connected, or it cannot list layouts or fields: 1. Confirm the file is open in FileMaker Pro. 2. Re-run the **Connect to MCP** script in that file. 3. Keep the connector Web Viewer window open while you work. 4. Confirm that connector window is in **Browse mode**, not Layout mode. 5. Restart the agent app after installing ProofKit if this is your first setup. This is the most common failure mode. The connector Web Viewer is part of the bridge. If it is closed, hidden in the wrong file window, or switched out of Browse mode, the agent loses access. If the connection still fails, revisit [Install and Connect](/docs/ai/install-and-connect) and the [`fmBridge` troubleshooting notes](/docs/webviewer/fm-bridge#troubleshooting). ## The local preview opens, but FileMaker-backed features do not work If the browser preview loads but data calls, script calls, or bridge actions fail: * Ensure the FileMaker file is still connected through **Connect to MCP**. * Confirm the connector Web Viewer has not been closed since the dev server started. * Check that your project is using the standard ProofKit Web Viewer setup with `fmBridge`. * Re-run your dev server after reconnecting FileMaker if the bridge was broken during startup. Typical symptoms include script calls hanging, bridge errors, or a preview that renders static UI but never loads live FileMaker data. For bridge-specific failures, see [`fmBridge`](/docs/webviewer/fm-bridge) and [Web Viewer troubleshooting](/docs/webviewer/troubleshooting). ## The generated app is using the wrong fields If the agent built against stale schema, or TypeScript errors reference fields that no longer exist: 1. Make sure the agent is using the correct FileMaker file and layout. 2. Re-run type generation after schema or layout changes. 3. Restart the dev server after regenerated types land. 4. Ask the agent to fix type errors before continuing feature work. ProofKit apps rely on generated metadata. If your FileMaker schema changes but the project still uses old generated files, the agent will confidently write code against the wrong shape. Use the [TypeGen docs](/docs/typegen) when the issue is clearly about generated types, layouts, or config. ## FileMaker says access privileges are damaged If FileMaker shows a warning that says **"The access privileges in this file have been damaged or possibly tampered with"**, and the file previously had **PROOFKIT** installed in it, contact us at [support@proof.sh](mailto:support@proof.sh). FileMaker warning that the access privileges in the file have been damaged or possibly tampered with. This issue only affected files where the ProofKit add-on was installed with **ProofKit 2.04**. We fixed the add-on in later versions, but in affected files the 2.04 add-on could fail to uninstall cleanly. We have a fix for affected files. Send us a note at [support@proof.sh](mailto:support@proof.sh), mention that the file had **PROOFKIT** installed, and we can help repair it. --- # Updating ProofKit URL: https://proofkit.proof.sh/docs/ai/updating-proofkit Re-run the installer, then reconnect FileMaker, reinstall the add-on, and redeploy your apps. import { Callout } from "fumadocs-ui/components/callout"; import { Step, Steps } from "fumadocs-ui/components/steps"; import { CliCommand } from "@/components/CliCommand"; To update ProofKit, simply run the latest installer on your system. Sometimes this is all you need to do. If, however, you also want to update the add-on that was installed in your FileMaker file, you'll need to follow a few extra steps. ## Download the latest installer ## Updating the Add-on in FileMaker **Restart FileMaker Pro** if it was running during the installation process. Close FileMaker Pro fully, then open it again before you continue. **Uninstall the ProofKit add-on from your FileMaker file.** This may remove all previously deployed apps from your file. You will need to make sure that you still have the source code (a folder on your computer) so you can deploy them again in a later step. Go into layout mode and the add-ons tab on the left sidebar. Right-click the ProofKit add-on and choose to uninstall. **Install the Add-on again.** After installation, you can verify that the new add-on was installed by checking the version number in any of the ProofKit scripts. **Redeploy your apps into the FileMaker file.** Remember to run the "Connect to MCP" script in order to open the connection to your FileMaker file before deploying. Any Web Viewer apps you want available in that file should be deployed again from their local source folders. You can either ask your coding agent to do this for you or run this command within that folder: ## Related guides * [Install and Connect](/docs/ai/install-and-connect) * [Deploy to FileMaker](/docs/ai/deploy-to-filemaker) --- # Introduction URL: https://proofkit.proof.sh/docs/better-auth @proofkit/better-auth import { Cards, Card } from "fumadocs-ui/components/card"; import { SquareArrowOutUpRight } from "lucide-react"; # What is Better-Auth? From the [Better-Auth](https://better-auth.com) website: > The most comprehensive authentication framework for TypeScript. Better-Auth has a robust plugin ecosystem that gives you the ability to pick and choose which authentication methods you want to use, all within a system that let's you securely host your own authentication. The `@proofkit/better-auth` package allows you to use FileMaker as the backend database for the better-auth library, including automated schema migrations to easily add any neccesary tables and fields to your FileMaker file. How to quickly get started with Better-Auth and FileMaker. Better-Auth Docs{" "} } href="https://better-auth.com/docs" > Learn more about the Better-Auth framework and how to use it in your app. --- # Installation & Usage URL: https://proofkit.proof.sh/docs/better-auth/installation import { CliCommand } from "@/components/CliCommand"; import { PackageInstall } from "@/components/PackageInstall"; import { Callout } from "fumadocs-ui/components/callout"; # Prerequisites * Ensure OData is enabled on your FileMaker server. * Ensure your credentials have the `fmodata` privilege enabled. * If you are using OttoFMS 4.11+ and you want to use a Data API key instead of plain credentials, ensure OData is enabled for that key. # Step 1: Manual Setup Follow the [Better-Auth installation guide](https://better-auth.com/docs/installation) to get started in your app, but come back here for special instructions for anything related to your Database Setup or schema migrations. ### Database Setup Ensure you have the @proofkit/better-auth and @proofkit/fmodata packages installed in your app. Configure your database connection in your `auth.ts` file. Be sure to set these value secrets in your environment variables. The credentials you use here need `fmodata` permissions enabled, and read/write access to the better-auth tables. ```ts title="auth.ts" import { betterAuth } from "better-auth"; import { FMServerConnection } from "@proofkit/fmodata"; import { FileMakerAdapter } from "@proofkit/better-auth"; const connection = new FMServerConnection({ serverUrl: process.env.FM_SERVER_URL!, auth: { // option 1: username/password credentials username: process.env.FM_USERNAME!, password: process.env.FM_PASSWORD!, // option 2: Data API key (OttoFMS 4.11+, OData enabled for the key) // apiKey: process.env.OTTO_API_KEY!, }, }); const db = connection.database(process.env.FM_DATABASE!); export const auth = betterAuth({ database: FileMakerAdapter({ database: db }), // ...rest of your config }); ``` # Step 2: Create/Update Database Tables Run the following command to create the necessary tables and fields in your FileMaker file. It will show you a confirmation before any changes are applied, so you can review them. \[Full Access] credentials are required for the schema changes to be applied automatically, but you may want to use a more restricted account for the rest of better-auth usage. If your credentials that you entered earlier in the `auth.ts` file do not have the \[Full Access] permissions, you can override them in the CLI. These changes affect database schema only. No layouts or relationships are created or modified during this process. The tables/fields that are created will be dependent on how your `auth.ts` file is setup. If you want to use any of your existing tables, just set [custom table names](https://www.better-auth.com/docs/concepts/database#custom-table-names) in the `auth.ts` file before running the migration command. You may see fields added to your tables that you don't plan on using, but it's best to keep them in your database anyway to avoid potential errors. If you make any schema-related changes to the better-auth config, such as adding plugins, you will need to run the migration command again to apply the changes to your FileMaker file. --- # Troubleshooting URL: https://proofkit.proof.sh/docs/better-auth/troubleshooting import { CliCommand } from "@/components/CliCommand"; ## Error when generating schema ```bash ERROR [Better Auth]: filemaker is not supported. If it is a custom adapter, please request the maintainer to implement createSchema ``` This means you used the better-auth CLI directly instead of the @proofkit/better-auth version. Run this instead: --- # Adapters URL: https://proofkit.proof.sh/docs/fmdapi/adapters Adapters are a new level of abstraction that allows you to reuse the same client API with any number of proxies, including via a FileMaker Webviewer using the [`@proofkit/webviewer`](/docs/webviewer/package) package and the Execute Data API script step. The adapter is responsible for handling the specifics of the connection to the FileMaker Data API, while the shared client exposes helper functions, schema validators, and other utilities to the developer. Choose the adapter that is right for your project, or view below for how to build your own custom adatper. ## OttoFMS (recommended) To connect via the [OttoFMS](https://docs.ottofms.com/) [Data API Proxy](https://docs.ottofms.com/ottofms-features/api-proxy#data-api-proxy), use the `OttoAdapter` with a Data API key: ```ts import { DataApi, OttoAdapter } from "@proofkit/fmdapi"; ``` The OttoAdapter is compatible with API keys for both the Otto v3 and OttoFMS Data API Proxy. OttoFMS is available under a free license and is our recommended method for interacting with the Data API. #### Options | Option | Type | Description | | ------------- | -------- | ---------------------------------------------------------------------------------------- | | `auth.apiKey` | `string` | The Data API key from either Otto v3 (starts with `KEY_`) or OttoFMS (starts with `dk_`) | | `auth.port` | `string` | *(optional)* Only used for Otto v3. Defaults to 3030 | | `db` | `string` | FileMaker database name | | `server` | `string` | FileMaker server URL (must start with include `https://`) | ## FetchAdapter To connect directly to the FileMaker Data API, use the `FetchAdapter` with a username and password: ```ts import { DataApi, FetchAdapter } from "@proofkit/fmdapi"; ``` #### Options | Option | Type | Description | | ------------ | ------------ | ------------------------------------------------------------------------------------------------------------------ | | `auth` | `object` | Authentication object. Must contain `username` and `password` | | `db` | `string` | FileMaker database name | | `server` | `string` | FileMaker server URL (must include `https://`) | | `tokenStore` | `TokenStore` | *(optional)* If provided, will use the custom set of functions to store and retrieve the short-lived access token. | ## WebViewerAdapter For rich webviewer experiences, use the `WebViewerAdapter` with the [`@proofkit/webviewer`](/docs/webviewer/package) package: npm pnpm yarn bun ```bash npm install @proofkit/webviewer ``` ```bash pnpm add @proofkit/webviewer ``` ```bash yarn add @proofkit/webviewer ``` ```bash bun add @proofkit/webviewer ``` Then import the adapter like so: ```ts import { DataApi } from "@proofkit/fmdapi"; import { WebViewerAdapter } from "@proofkit/webviewer"; ``` ## Custom Adapters > **This is an advanced topic.** If you are just an application developer trying to connect to a FileMaker database, all you need to know is how you want to connect to the FileMaker server, then import the appropriate adapter. Type hint for the selected adapter will guide you through the rest. If you want to write you own adapter for your own proxy, or to override the root-level `request` method, you can write a custom adapter. All adapters must implement the `Adapter` interface. If you want to build a proxy similar to the `OttoAdapter`, you can extend the `BaseFetchAdapter` class and will likely only need to implement the `getToken` and `request` methods. View the source for the FetchAdapter for an example of this. --- # Usage Examples URL: https://proofkit.proof.sh/docs/fmdapi/examples import { Callout } from "fumadocs-ui/components/callout"; import { Card, Cards } from "fumadocs-ui/components/card"; ## Prerequisites Before you can use any of these methods, you need to set up a FileMaker Data API client. If you haven't done this yet, check out our [Quick Start Guide](/docs/fmdapi/quick-start) to create your client in a separate file. For these examples, we'll assume you've already setup a client in another file and are importing it for use. ```ts // This is just an example - follow the Quick Start guide for your actual setup import { CustomersLayout } from "./schema/client"; ``` *** ## Retrieving Data from FileMaker ### Finding Records You can use the `find` method to perform FileMaker-style find requests on a layout. This method is limited to 100 records by default, but you can use the `findAll` helper method to automatically paginate the results and return all records that match the query. ```ts twoslash title="searchCustomers.ts" import { CustomersLayout } from "./CustomersLayout"; // ---cut--- // Simple search - find customers in a specific city (max 100 records) export async function findCustomersByCity(city: string) { const response = await CustomersLayout.find({ query: { city: city } }); console.log(`Found ${response.data.length} customers in ${city}`); return response.data; } // Get ALL matching records at once (handles pagination automatically) export async function getAllActiveCustomers() { const records = await CustomersLayout.findAll({ query: { status: "==Active" } // all standard FileMaker operators are supported }); return records; // All active customers, no pagination needed } ``` Use an array of find requests to get the OR behavior, equivalent to having multiple find requests in FileMaker. ```ts twoslash title="multipleFindRequests.ts" import { CustomersLayout } from "./CustomersLayout"; // ---cut--- export async function getCustomersByCityOrStatus(city: string, status: string) { const records = await CustomersLayout.findAll({ query: [{ city }, { status }] }); return records; } ``` There are also helper methods for common find scenarios. Any of these methods will return just a single record instead of an array. * `findOne` will throw an error unless there is exactly one record found * `findFirst` will return the first record found, but still throw if no records are found * `maybeFindFirst` will return the first record found or null ### Getting All Records If you don't need to specify any find requests, you can use the `list` or `listAll` methods. `list` will limit to 100 records per request by default, while `listAll` will automatically handle pagination via the API and return all records for the entire table. Use with caution if the table is large! ```ts twoslash title="getAllCustomers.ts" import { CustomersLayout } from "./CustomersLayout"; // ---cut--- // Get a page of customers (recommended for large datasets) export async function listCustomers() { const response = await CustomersLayout.list({ sort: [{ fieldName: "firstName", sortOrder: "ascend" }] }); return { customers: response.data, totalRecords: response.dataInfo.foundCount, hasMore: response.data.length === 100 // Default page size }; } // Get ALL customers at once (use with caution on large datasets) export async function listAllCustomers() { const records = await CustomersLayout.listAll(); type CustomerRecord = (typeof records)[number]; console.log(`Retrieved all ${records.length} customers`); return records.map((customer: CustomerRecord) => ({ id: customer.recordId, firstName: customer.fieldData.firstName, lastName: customer.fieldData.lastName, email: customer.fieldData.email, city: customer.fieldData.city })); } ``` *** ## Creating Records Use `create` to add new records to your FileMaker database. ```ts twoslash title="createCustomer.ts" import { CustomersLayout } from "./CustomersLayout"; // ---cut--- export async function createNewCustomer(customerData: { firstName: string; lastName: string; email: string; phone?: string; city?: string; }) { const response = await CustomersLayout.create({ fieldData: { firstName: customerData.firstName, lastName: customerData.lastName, email: customerData.email, phone: customerData.phone || "", city: customerData.city || "", status: "Active", created_date: new Date().toISOString() } }); console.log(`Created customer with ID: ${response.recordId}`); return response.recordId; } ``` *** ## Update / Delete Records Updating or deleting records requires the internal record id from FileMaker, not the primary key for your table. This value is returned in the `recordId` field of any create, list, or find response. This record id *can* change during imports or data migrations, so you should never store it, but instead alwyas look it up via a find request when it's needed. ```ts twoslash title="updateCustomer.ts" import { CustomersLayout } from "./CustomersLayout"; // ---cut--- export async function updateCustomerInfo(myPrimaryKey: string, updates: { firstName?: string; lastName?: string; phone?: string; city?: string; }) { const { data: { recordId } } = await CustomersLayout.findOne({ query: { myPrimaryKey: myPrimaryKey } }); // Only update fields that were provided const fieldData: any = {}; if (updates.firstName) fieldData.firstName = updates.firstName; if (updates.lastName) fieldData.lastName = updates.lastName; if (updates.phone) fieldData.phone = updates.phone; if (updates.city) fieldData.city = updates.city; const response = await CustomersLayout.update({ fieldData, recordId }); return response.modId; } ``` ```ts twoslash title="deleteCustomer.ts" import { CustomersLayout } from "./CustomersLayout"; // ---cut--- export async function deleteCustomer(myPrimaryKey: string) { // Optional: Get customer info first for logging const { data: { recordId } } = await CustomersLayout.findOne({ query: { myPrimaryKey: myPrimaryKey } }); await CustomersLayout.delete({recordId}); } ``` *** ## Working with Scripts FileMaker scripts can be executed during any other method or run directly. ### Running Scripts Directly Use `executeScript` to run a script directly. ```ts twoslash title="executeScripts.ts" import { CustomersLayout } from "./CustomersLayout"; // ---cut--- export async function sendEmailFromFileMaker() { const response = await CustomersLayout.executeScript({ script: "Send Email", scriptParam: JSON.stringify({ to: "customer@example.com", subject: "Welcome to our service", body: "Thank you for signing up!" }) }); console.log("Script result:", response.scriptResult); return response.scriptResult; } ``` ### Run a script with another method You can run scripts before or after any data operation. The script will be run in the context of the layout specified in your client and will be on the record or found set as the operation. This is especially useful when creating records, as you can run a script after the record is created, knowing the script will be focused on this newly created record; thus giving you access to the calculated values such as a UUID primary key defined in your field definitions. ```ts twoslash title="scriptsWithOperations.ts" import { CustomersLayout } from "./CustomersLayout"; // ---cut--- // Run a script after creating a record export async function createCustomerWithWelcomeEmail(customerData: any) { const response = await CustomersLayout.create({ fieldData: customerData, script: "Send Welcome Email", // script name // script param must always be a string "script.param": JSON.stringify({ email: customerData.email, name: `${customerData.firstName} ${customerData.lastName}` }) }); return { recordId: response.recordId, scriptResult: response.scriptResult }; } ``` For more details about the script execution order, see [this page](https://help.claris.com/en/data-api-guide/content/run-script-with-another-request.html) of the FileMaker Data API guide. *** See also Complete list of all available methods Set up your FileMaker Data API client --- # Overview URL: https://proofkit.proof.sh/docs/fmdapi @proofkit/fmdapi This package is designed to make working with the FileMaker Data API much easier. Here's just a few key features: For generated ProofKit Web Viewer apps, start with [Hybrid App Data Access](/docs/webviewer/data-access) to understand when this package is used directly and when FileMaker scripts are the better runtime path. * Handles token refresh for you automatically * [OttoFMS](https://ottofms.com/) Data API proxy support * TypeScript support for easy auto-completion of your field names * [Automated type generation](/docs/typegen) based on layout metadata * Protection against field name changes with [Standard Schema](https://standardschema.dev/) runtime validation * Supports both node and edge runtimes with a customizable token store * Customizable adapters allow usage even within the [FileMaker Web Viewer](/docs/webviewer/package) ## Edge Runtime Support This package is compatible with edge runtimes, but there are some additional considerations to avoid overwhelming your FileMaker server with too many connections. If you are developing for the edge, be sure to implement one of the following strategies: * ✅ Use a custom token store (see above) with a persistent storage method such as Upstash * ✅ Use a proxy such as the [Otto Data API Proxy](https://www.ottofms.com/docs/otto/working-with-otto/proxy-api-keys/data-api) which handles management of the access tokens itself. * Providing an API key to the client instead of username/password will automatically use the Otto proxy --- # Quick Start - Manual URL: https://proofkit.proof.sh/docs/fmdapi/manual-setup import { Tabs, Tab } from "fumadocs-ui/components/tabs"; import { Callout } from "fumadocs-ui/components/callout"; > Note: For the best experience, use the [@proofkit/typegen](/docs/typegen) tool to generate layout-specific clients and get autocomplete hints in your IDE with your actual field names. This minimal example just demonstrates the basic setup Add the following envnironment variables to your project's `.env` file: ```sh FM_DATABASE=filename.fmp12 FM_SERVER=https://filemaker.example.com # if you want to use the OttoFMS Data API Proxy OTTO_API_KEY=dk_123456...789 # otherwise FM_USERNAME=admin FM_PASSWORD=password ``` Initialize the client with credentials, depending on your adapter ```ts // to use the OttoFMS Data API Proxy import { DataApi, OttoAdapter } from "@proofkit/fmdapi"; const client = DataApi({ adapter: new OttoAdapter({ auth: { apiKey: process.env.OTTO_API_KEY }, db: process.env.FM_DATABASE, server: process.env.FM_SERVER, }), layout: "API_Contacts", }); ``` ```ts // to use the raw Data API import { DataApi, FetchAdapter } from "@proofkit/fmdapi"; const client = DataApi({ adapter: new FetchAdapter({ auth: { username: process.env.FM_USERNAME, password: process.env.FM_PASSWORD, }, db: process.env.FM_DATABASE, server: process.env.FM_SERVER, }), layout: "API_Contacts", }); ``` Then, use the client to query your FileMaker database. [View all available methods here](https://github.com/proofsh/fmdapi/wiki/methods). Basic Example: ```typescript const result = await client.list({ layout: "Contacts" }); ``` ## TypeScript Support If you define a schema in your client, the types will be inferred automatically. [Learn more](/docs/fmdapi/validation) The basic client will return the generic FileMaker response object by default. You can also create a type for your expected response and get a fully typed response that includes your own fields. ```typescript type TContact = { name: string; email: string; phone: string; }; // if you have portals type TOrders = { "Orders::orderId": string; "Orders::orderDate": string; "Orders::orderTotal": number; }; type TPortals = { orders: TOrders; // key is based on the portal object name }; const client = DataApi({ layout: "API_Contacts", // ... your adapter, other config }); ``` 💡 TIP: For a more ergonomic TypeScript experience, use the [@proofkit/typegen tool](/docs/typegen) to generate these types based on your FileMaker layout metadata. --- # Methods URL: https://proofkit.proof.sh/docs/fmdapi/methods The following methods are available for all adapters. * `list` return all records from a given layout * `find` perform a FileMaker find * `get` return a single record by recordID * `create` return a new record * `update` modify a single record by recordID * `delete` delete a single record by recordID # Helper Functions This package also includes some helper methods to make working with Data API responses a little easier: * `findOne` return the first record from a find instead of an array. This method will error unless exactly 1 record is found. * `findFirst` return the first record from a find instead of an array, but will not error if multiple records are found. * `findAll` return all found records from a find, automatically handling pagination. Use caution with large datasets! * `listAll` return all records from a given layout, automatically handling pagination. Use caution with large datasets! # Adapter-Specific Functions The first-party `FetchAdapter` and `OttoAdatper` both share the following additional methods from the `BaseFetchAdapter`: * `executeScript` execute a FileMaker script directly * `layoutMetadata` return metadata for a given layout * `layouts` return a list of all layouts in the database (top-level layout key ignored) * `scripts` return a list of all scripts in the database (top-level script key ignored) * `globals` set global fields for the current session (top-level globals key ignored) If you have your own proxy, you can write your own Custom Adapter that extends the BaseFetchAdapter to also implement these methods. ## Fetch Adapter * `disconnect` forcibly logout of your FileMaker session ## Otto Adapter No additional methods --- # Quick Start - Typegen URL: https://proofkit.proof.sh/docs/fmdapi/quick-start import { Tabs, Tab } from "fumadocs-ui/components/tabs"; import { Steps, Step } from "fumadocs-ui/components/steps"; import { AgentCommand } from "@/components/AgentCommand"; The typegen tool is the best way to interact with this library, as it will automatically generate layout-specific clients and get autocomplete hints in your IDE with your actual field names from your solution ### Install the required packages npm pnpm yarn bun ```bash npm install @proofkit/fmdapi zod ``` ```bash pnpm add @proofkit/fmdapi zod ``` ```bash yarn add @proofkit/fmdapi zod ``` ```bash bun add @proofkit/fmdapi zod ``` Zod is used by the typegen tool by default, but it can be excluded if you set `validator` to `false` in the typegen config. #### AI Agent Integration If you use an AI coding agent, run this command to map ProofKit's built-in skills to your project. See the [TanStack Intent docs](https://tanstack.com/intent/latest/docs/getting-started/quick-start-consumers) for more details. ### Create a typegen config file in your project ```sh npx @proofkit/typegen ``` Add the layouts you want to generate clients for to the `layouts` array in the config file. ```jsonc title='proofkit-typegen.config.jsonc' { "$schema": "https://proofkit.proof.sh/typegen-config-schema.json", "config": { "clientSuffix": "Layout", "layouts": [ // add your layouts and name schemas here { "layoutName": "my_layout", "schemaName": "MySchema" } // repeat as needed for each layout... // { layoutName: "my_other_layout", schemaName: "MyOtherSchema" }, ], // change this value to generate the files in a different directory "path": "schema", "clearOldFiles": true }, } ``` ### Setup Environment Variables Add the following envnironment variables to your project's `.env` file: ```bash title=".env" FM_SERVER=https://filemaker.example.com # must start with https:// FM_DATABASE=filename.fmp12 # must end with .fmp12 # if you want to use the OttoFMS Data API Proxy (recommended) OTTO_API_KEY=dk_123456...789 # otherwise FM_USERNAME=admin FM_PASSWORD=password ``` ### Generate the layout-specific clients Run this command any time you make changes to your config file, any of the referenced FileMaker layouts, or any field names/types that are on the layouts. ```sh npx @proofkit/typegen ``` Tip: Add a script to your `package.json` to make it easier to run in the future. ```jsonc title="package.json" { "scripts": { // ... "typegen": "npx @proofkit/typegen" } } ``` ## Usage You can now import the layout-specifc client for use in your project. ```ts title="getCustomer.ts" import { CustomersLayout } from "./schema/client"; export async function getCustomer(id: string) { // findOne will throw an error unless exactly 1 record is returned const { data } = await CustomersLayout.findOne({ query: { id: `==${id}` } }); return data.fieldData; } ``` For all available methods, see [this page](/docs/fmdapi/methods) . ## Customization If you run into any limitations from the generated code, there are many ways to customize it to your needs. How to configure the typegen tool for your use case. Customize the shape of the data returned from your database. --- # Token Store URL: https://proofkit.proof.sh/docs/fmdapi/token-store This page applies only to the FetchAdapter when your connecting via username/password to your FileMaker server. The Otto Data API Proxy manages the token for you. If you are using username/password authentication, the fmdapi client will manage your access token for you. By default, the token is kept in memory only, but you can provide other getter and setter methods to store the token in a database or other location. Included in this package are helper functions for file storage if you have access to the filesystem, or Upstash if running in a serverless environment. ```ts import { DataApi, FetchAdapter } from "@proofkit/fmdapi"; // using file storage, if you have persistent access to the filesystem on your server import { fileTokenStore } from "@proofkit/fmdapi/tokenStore/file"; const client = DataApi({ adapter: new FetchAdapter({ // ... tokenStore: fileTokenStore(), }), }); // or with Upstash, requires `@upstash/redis` as peer dependency import { upstashTokenStore } from "@proofkit/fmdapi/tokenStore/upstash"; const client = DataApi({ adapter: new FetchAdapter({ // ... tokenStore: upstashTokenStore({ token: process.env.UPSTASH_TOKEN, url: process.env.UPSTASH_URL, }), }), }); ``` --- # Validation & Transformation URL: https://proofkit.proof.sh/docs/fmdapi/validation Protect your app from field name changes by validating the shape of the data returned from the FileMaker Data API. import { File, Folder, Files } from "fumadocs-ui/components/files"; import { IconFileTypeTs } from "@tabler/icons-react"; ## Why validate? One of the best features of the FileMaker platform is how you can easily add, remove, and rename fields in your database. However, when you make integrations that are beyond the scope of your database, you can run into serious issues if the field names change out from under you. This library supports validation using [Standard Schema](https://standardschema.dev/) out of the box, and will throw an error *early* to prevent unexpected behavior in your app. We suggest using the [Zod](https://zod.dev) library by default, but any other validation library that supports Standard Schema will also work. ## How does it work? When creating your layout client, add a `schema` property and define a Standard-Schema compliant schema definition for your `fieldData` and `portalData`. Your schema must be an object, and should represent a single record or portal row. Most validation libraries also support some kind of transformation, and you can use these to adjust how your FileMaker data is returned to your app. Try this interactive example that uses the [Zod](https://zod.dev/) library to validate and transform the data: