npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@formforkio/vue

v1.0.0

Published

Official Vue 3 & Nuxt 3 SDK for FormFork — Reactive useFormFork() composable with built-in Store-and-Forward failover.

Readme

@formforkio/vue

Official Vue 3 & Nuxt 3 Composition API SDK for FormFork.

Provides a lightweight useFormFork composable with automatic Store-and-Forward Fallback Node failover, anti-bot timing verification (_ff_t), domain-scoped embedToken auto-provisioning, and cryptographic fallbackTicket support.


Features

  • Vue 3 & Nuxt 3 Ready: Works seamlessly inside <script setup lang="ts"> in both SSR and SPA modes.
  • Automatic Store-and-Forward Failover:
    1. Submits to your primary FormFork server (endpointHost) with a configurable timeoutMs (6000ms default).
    2. Automatically fails over to your Store-and-Forward Fallback Node (fallbackEndpoint) if the primary server returns 5xx or times out.
  • Multipart & JSON Support: Pass the native DOM @submit="handleSubmit" event, an HTMLFormElement, a FormData object (with file attachments), or a reactive JSON state object.
  • Cryptographic Offline Authorization: Supports embedToken (X-FormFork-Token) and stateless HMAC fallbackTicket (X-FormFork-Ticket) so your fallback server can verify the request even when the main FormFork server is offline.

Installation

# npm
npm install @formforkio/vue

# pnpm
pnpm add @formforkio/vue

# yarn
yarn add @formforkio/vue

# bun
bun add @formforkio/vue

Quick Start (Vue 3 / Nuxt 3 <script setup>)

1. Binding to a Native <form> (Supports File Uploads & Honeypot)

<script setup lang="ts">
import { reactive } from 'vue';
import { useFormFork } from '@formforkio/vue';

const { state: ffState, handleSubmit, reset } = useFormFork('form-support-ticket', {
  endpointHost: 'https://forms.yourdomain.com',
  fallbackEndpoint: 'https://fallback.yourdomain.com/index.php?formId=form-support-ticket',
  embedToken: 'ff_pub_live_98a7bc65d4e3f210',
  timeoutMs: 5000,
});

// Optional: wrap in Vue reactive() if mutating nested properties in template
const formState = reactive(ffState);
</script>

<template>
  <div v-if="formState.succeeded" class="rounded-xl border border-emerald-200 bg-emerald-50 p-6">
    <h3 class="text-lg font-semibold text-emerald-900">Support Request Received</h3>
    <p class="mt-1 text-sm text-emerald-700">
      <span v-if="formState.queuedViaFallback">
        Your request was securely spooled by our high-availability fallback node (ID: {{ formState.submissionId }}).
      </span>
      <span v-else>
        Ticket #{{ formState.submissionId }} has been created.
      </span>
    </p>
    <button
      type="button"
      class="mt-4 text-sm font-medium text-emerald-800 underline"
      @click="reset"
    >
      Submit another ticket
    </button>
  </div>

  <form v-else class="space-y-4" @submit="handleSubmit">
    <!-- Honeypot trap for bots -->
    <input
      type="text"
      name="_gotcha"
      tabindex="-1"
      autocomplete="off"
      style="position: absolute; left: -9999px; opacity: 0"
    />

    <div>
      <label for="email" class="block text-sm font-medium">Email</label>
      <input
        id="email"
        name="email"
        type="email"
        required
        class="mt-1 w-full rounded-md border px-3 py-2"
      />
    </div>

    <div>
      <label for="subject" class="block text-sm font-medium">Subject</label>
      <input
        id="subject"
        name="subject"
        type="text"
        required
        class="mt-1 w-full rounded-md border px-3 py-2"
      />
    </div>

    <div>
      <label for="screenshot" class="block text-sm font-medium">Screenshot (Optional)</label>
      <input id="screenshot" name="screenshot" type="file" accept="image/*,.pdf" />
    </div>

    <p v-if="formState.errorMessage" class="text-sm text-red-600" role="alert">
      {{ formState.errorMessage }}
    </p>

    <button
      type="submit"
      :disabled="formState.submitting"
      class="rounded-lg bg-slate-900 px-5 py-2.5 text-sm font-semibold text-white disabled:opacity-50"
    >
      {{ formState.submitting ? 'Submitting...' : 'Submit Ticket' }}
    </button>
  </form>
</template>

2. Submitting Reactive v-model State Programmatically

You can also pass a plain JavaScript object directly to handleSubmit:

<script setup lang="ts">
import { ref, reactive } from 'vue';
import { useFormFork } from '@formforkio/vue';

const email = ref('');
const plan = ref('pro');

const { state, handleSubmit } = useFormFork('Waitlist Signup', {
  endpointHost: 'https://forms.yourdomain.com',
  embedToken: 'ff_pub_live_98a7bc65d4e3f210',
});
const ui = reactive(state);

async function onSubmitCustom() {
  await handleSubmit({
    email: email.value,
    plan: plan.value,
    referrer: document.referrer,
  });
}
</script>

API Reference

useFormFork(formIdOrName, options?)

Returns { state, handleSubmit, reset }.

VueFormForkOptions

| Option | Type | Default | Description | | :--- | :--- | :--- | :--- | | embedToken | string | undefined | Public embed token (ff_pub_...) sent in X-FormFork-Token. | | fallbackTicket | string | undefined | Stateless HMAC ticket (X-FormFork-Ticket) for offline fallback verification. | | endpointHost | string | 'https://formfork.io' | Primary FormFork server base URL. | | fallbackEndpoint | string | 'https://fallback.formfork.io/index.php' | Store-and-Forward fallback node URL. | | timeoutMs | number | 6000 | Primary request timeout in ms before failing over to fallbackEndpoint. | | enableOfflineOutbox | boolean | undefined | Optional flag for offline outbox mode. |

VueFormForkState

| Property | Type | Description | | :--- | :--- | :--- | | submitting | boolean | true while request is in flight. | | succeeded | boolean | true when accepted by primary or Store-and-Forward fallback server. | | queuedViaFallback | boolean | true if spooled on the fallback node while primary was unreachable. | | queuedOffline | boolean | true if queued locally. | | errorMessage | string \| null | Validation or network error message if submission failed. | | submissionId | string \| null | Unique submission or spool ID. |


License

MIT