VVibeFlui

Provider Config

provider tells runtime execution to use a named provider instead of only executing a resolved endpoint.

Schema shape

TS
export const usersSchema = {
  resource: "users",
  provider: {
    type: "custom",
    name: "admin"
  }
} as const;
PropertyPurpose
typeProvider kind metadata such as rest, custom, graphql, trpc, supabase, or firebase.
nameProvider key resolved from FluiKitProvider providers.
queryMetadata field for provider-specific query names.

Runtime provider map

Providers are passed to FluiKitProvider.

TSX
import { FluiKitProvider } from "@vibeflui/core";

const providers = {
  admin: {
    list: async ({ query }) => fetchUsers(query),
    detail: async ({ params }) => fetchUser(params.id),
    create: async ({ values }) => createUser(values),
    update: async ({ params, values }) => updateUser(params.id, values),
    delete: async ({ params }) => deleteUser(params.id),
    action: async ({ operation, params }) => runAction(operation, params)
  }
};

export function AppProviders({ children }: { children: React.ReactNode }) {
  return <FluiKitProvider providers={providers}>{children}</FluiKitProvider>;
}

Provider methods

MethodUsed for
listlist operation.
detaildetail or view operation.
createcreate operation.
updateupdate or edit operation.
deletedelete operation.
actionCustom operations and fallback.

type: "rest"

When schema.provider.type is rest and no provider.name is used, VibeFlui creates the built-in endpoint provider. The schema still needs resolvable endpoints.

TS
export const usersSchema = {
  resource: "users",
  provider: {
    type: "rest"
  },
  endpoint: "/api/users"
} as const;

Execution context

Provider methods receive an action execution context with:

  • schema
  • action
  • operation
  • row
  • values
  • query
  • endpoint
  • fetcher
  • identityValue
  • params
  • permissionContext

Common mistakes

  • Put runtime provider functions in FluiKitProvider, not inside schema.
  • Set provider.name only when the provider exists in the runtime provider map.
  • type: "graphql" and type: "trpc" are metadata unless a matching provider is supplied.