better-auth-setup
БесплатноБез исполняемых скриптовНе проверенSet up self-hosted authentication with better-auth using FileMaker as the database backend. Covers FileMakerAdapter, FMServerConnection, betterAuth config…
от proofsh★ 21 звезда на GitHubОб этом скилле
Setup
Prerequisites
- OData enabled on FileMaker Server
- API credentials with
fmodataprivilege enabled - Read/write access to the better-auth tables
- Full Access credentials available for schema migration (can differ from runtime credentials)
Install packages
pnpm add @proofkit/better-auth @proofkit/fmodata
Configure 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: {
username: process.env.FM_USERNAME!,
password: process.env.FM_PASSWORD!,
},
});
const db = connection.database(process.env.FM_DATABASE!);
export const auth = betterAuth({
database: FileMakerAdapter({ database: db }),
// add plugins, social providers, etc.
});
FileMakerAdapter accepts a FileMakerAdapterConfig:
database(required) -- an fmodataDatabaseinstancedebugLogs(optional) -- enable adapter debug loggingusePlural(optional) -- settrueif table names are plural
The adapter maps Better Auth operations (create, findOne, findMany, update, delete, count) to OData requests via db._makeRequest. It does not support JSON columns, native dates, or native booleans -- all values are stored as strings/numbers.
Alternative: Data API key (OttoFMS 4.11+)
const connection = new FMServerConnection({
serverUrl: process.env.FM_SERVER_URL!,
auth: {
apiKey: process.env.OTTO_API_KEY!,
},
});
OData must be enabled for the key.
Core Patterns
1. Initial migration
After configuring auth.ts, run the migration CLI to create tables and fields in FileMaker:
npx @proofkit/better-auth migrate
The CLI:
- Loads your
auth.tsconfig (auto-detected or via--config <path>) - Calls
getSchema()frombetter-auth/dbto determine required tables/fields - Fetches current OData metadata via
db.getMetadata() - Computes a diff: tables to create, fields to add to existing tables
- Prints the migration plan and prompts for confirmation
- Executes via
db.schema.createTable()anddb.schema.addFields()
Only schema is modified. No layouts or relationships are created.
If your runtime credentials lack Full Access, override for migration only:
npx @proofkit/better-auth migrate --username "admin" --password "admin_pass"
Skip confirmation with -y:
npx @proofkit/better-auth migrate -y
2. Adding plugins and re-migrating
When you add a Better Auth plugin (e.g. twoFactor, organization), it declares additional tables/fields. After updating auth.ts:
import { betterAuth } from "better-auth";
import { twoFactor } from "better-auth/plugins";
import { FMServerConnection } from "@proofkit/fmodata";
import { FileMakerAdapter } from "@proofkit/better-auth";
const connection = new FMServerConnection({
serverUrl: process.env.FM_SERVER_URL!,
auth: {
username: process.env.FM_USERNAME!,
password: process.env.FM_PASSWORD!,
},
});
const db = connection.database(process.env.FM_DATABASE!);
export const auth = betterAuth({
database: FileMakerAdapter({ database: db }),
plugins: [twoFactor()],
});
Re-run migration:
npx @proofkit/better-auth migrate
The planner diffs against existing metadata, so only new tables/fields are added. Existing tables are left untouched.
3. Troubleshooting privilege errors
When migration fails with OData error code 207, the account lacks schema modification privileges. The CLI outputs:
Failed to create table "tableName": Cannot modify schema.
The account used does not have schema modification privileges.
Use --username and --password to provide Full Access credentials.
Fix: provide Full Access credentials via CLI flags. These are only used for migration, not at runtime.
Common Mistakes
[CRITICAL] Using better-auth CLI instead of @proofkit/better-auth
Wrong:
npx better-auth migrate
Correct:
npx @proofkit/better-auth migrate
The standard better-auth CLI does not know about the FileMaker adapter and produces: ERROR [Better Auth]: filemaker is not supported. If it is a custom adapter, please request the maintainer to implement createSchema. The @proofkit/better-auth CLI loads your auth config, extracts the Database instance from the adapter, and handles migration via fmodata's schema API.
Source: apps/docs/content/docs/better-auth/troubleshooting.mdx
[HIGH] Missing Full Access credentials for schema migration
Wrong:
# Using runtime credentials that only have fmodata privilege
npx @proofkit/better-auth migrate
# Fails with OData error 207: Cannot modify schema
Correct:
npx @proofkit/better-auth migrate --username "full_access_user" --password "full_access_pass"
Schema modification (db.schema.createTable, db.schema.addFields) requires [Full Acces
Установить better-auth-setup в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл better-auth-setup?
Set up self-hosted authentication with better-auth using FileMaker as the database backend. Covers FileMakerAdapter, FMServerConnection, betterAuth config, migration via npx @proofkit/better-auth migrate, OData prerequisites, fmodata privilege, Full Access credentials for schema modification, plugin migration workflow, troubleshooting "filemaker is not supported" errors.
Как установить скилл better-auth-setup?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл better-auth-setup запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic