{"id":49654,"library":"vrf-rest","title":"vrf-rest","description":"REST effect for the vrf form engine (v0.11.0). Enables automatic REST API integration for Vue forms built with vrf: forms declare resources and vrf-rest generates GET, POST, PATCH requests from form configuration (auto, single, action modes). Supports file uploads via multipayload format. Ships TypeScript types. Release cadence is irregular; currently stable.","status":"active","version":"0.11.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install vrf-rest","lang":"bash","label":"npm"},{"cmd":"yarn add vrf-rest","lang":"bash","label":"yarn"},{"cmd":"pnpm add vrf-rest","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only package, no CommonJS export. useRestEffect is the main composable.","wrong":"const useRestEffect = require('vrf-rest')","symbol":"useRestEffect","correct":"import { useRestEffect } from 'vrf-rest'"},{"note":"RestEffect is a TypeScript type, not a runtime value.","wrong":"import { RestEffect } from 'vrf-rest'","symbol":"RestEffect","correct":"import type { RestEffect } from 'vrf-rest'"},{"note":"Package also exports a default export (the Vue plugin install function).","wrong":"import { default as vrfRest } from 'vrf-rest'","symbol":"vrf-rest (default)","correct":"import vrfRest from 'vrf-rest'"}],"quickstart":{"code":"import { createApp } from 'vue';\nimport { createVrf } from 'vrf';\nimport vrfRest from 'vrf-rest';\n\nconst app = createApp(App);\nconst vrf = createVrf();\napp.use(vrf);\napp.use(vrfRest, {\n  baseURL: process.env.VITE_API_BASE ?? '/api',\n  headers: { Authorization: `Bearer ${process.env.API_TOKEN ?? ''}` }\n});\napp.mount('#app');","lang":"typescript","description":"Shows how to install the vrf-rest plugin with Vue and vrf, setting a base URL and auth header."},"warnings":[{"fix":"Ensure 'vrf' is installed: npm install vrf, and call app.use(vrf) before app.use(vrfRest).","message":"vrf-rest requires the 'vrf' peer dependency to be installed and initialized before use.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Consider using standard multipart/form-data with JSON metadata if needed.","message":"The 'multipayload' format is not standard REST; only documented as a Rails mixin example.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Define explicit routes for action endpoints in your backend.","message":"Action mode uses a different URL pattern (e.g., /todos/:id/add_comment) which may conflict with routes expecting CRUD.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure backend route for PATCH /todos acts on a single resource (e.g., current user).","message":"The 'single' mode uses PATCH /todos (no id) which can accidentally update all records if backend is not scoped.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'action':40 'api':15 'auto':38 'automat':13 'built':20 'cadenc':52 'configur':37 'current':55 'declar':24 'effect':5 'enabl':12 'engin':10 'file':43 'form':9,19,23,36 'format':47 'generat':30 'get':31 'integr':16 'irregular':54 'javascript':57 'mode':41 'multipayload':46 'patch':33 'post':32 'releas':51 'request':34 'resourc':25 'rest':3,4,14,29 'ship':48 'singl':39 'stabl':56 'support':42 'type':50 'typescript':49,58 'upload':44 'v0.11.0':11 'via':45 'vrf':2,8,22,28 'vrf-rest':1,27 'vue':18","created_at":"2026-06-07T17:02:54.590575+00:00","updated_at":"2026-06-07T17:02:54.590575+00:00","problems":[{"fix":"npm install vrf-rest (if types exist they are bundled).","cause":"vrf-rest is not installed or types are missing.","error":"Cannot find module 'vrf-rest' or its corresponding type declarations."},{"fix":"Ensure import vrfRest from 'vrf-rest' returns a default function that is a Vue plugin.","cause":"vrf-rest may not be registered correctly.","error":"Vue.use() is not a function. You are likely using Vue 3 and calling app.use(vrfRest) but vrfRest is not a Vue plugin."},{"fix":"Provide options object with baseURL: process.env.VITE_API_BASE ?? '/api', and ensure app.use(vrf) is called first.","cause":"Options object passed to vrfRest plugin is missing baseURL or vrf is not initialized.","error":"Uncaught TypeError: Cannot read properties of undefined (reading 'baseURL')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"vrf-rest","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}