# formster.js

> Client-side Form Tracking for Formster.io

Latest version **0.4.1** (published 2015-06-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install formster.js
pnpm add formster.js
yarn add formster.js
bun add formster.js
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.1 |
| Published | 2015-06-23 |
| First published | 2015-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | trey.griffith@gmail.com |
| Maintainers | treygriffith |
| Keywords | signups.io, formster.io, form tracking |

## Links

- npm: https://www.npmjs.com/package/formster.js
- Repository: https://github.com/formster/formster.js
- Homepage: http://github.com/formster/formster.js
- Issues: https://github.com/formster/formster.js/issues
- npm.io page: https://npm.io/package/formster.js

## Dependencies (3)

- [qs](https://npm.io/package/qs.md) ^0.6.6
- [reqwest](https://npm.io/package/reqwest.md) ^1.1.0
- [randomstring](https://npm.io/package/randomstring.md) ^1.0.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.4.1 (latest) — 2015-06-23
- 0.4.0 — 2015-06-23
- 0.3.0 — 2015-06-23

## README

formster.js - the Formster.io Client-side Library
------------------

[Formster.io](http://formster.io) is a service to let you easily create and track sign up forms on static web pages. For more information and examples, visit [Formster.io](http://formster.io). Formster.io was previously known as Signups.io.


Installation
============

### CDN (recommended)
Formster.io maintains a CDN for the formster.js Library (built as a standalone). The format for requests to the CDN is:
`protocol://cdn.formster.io/{version}/{script}`

Simply drop a script tag in, and you're ready to go:

```html
    <script src="//cdn.formster.io/v0.4.1/formster.min.js"></script>
```


### Standalone
The formster.js library is built using [Browserify](http://browserify.org). Standalone libraries are available in `[build/](/build)`, and are exposed to the `window` object as `Formster` if no other module system is detected. Browserify uses [UMD](https://github.com/forbeslindesay/umd) to expose standalone modules.


### Browserify
To include the client-side library in your own Browserify build, just install the formster.js package through [npm](http://npmjs.org):

```javascript
    $ npm install formster.js
```


Usage
=====

### Auto Tracking
formster.js automatically scans the page for `<form>`s with a `className` of formster on `DOMReady`. Upon finding them, it instantiates the API and starts tracking. For the majority of cases, this automatic tracking is sufficient. To trigger auto tracking at a later time, call the `auto` method of the `Formster` object:

```javascript
    function callMeLater() {
      Formster.auto();
    }
```

Formster.js keeps track of which forms it is tracking, so calling `auto` multiple times will *not* result in a duplication of data.

### Manual Tracking
In some cases, more control over the form tracking process might be desirable.

#### Instantiation
`Formster` is a constructor for the API which takes the API key as its only parameter:

```javascript
    var formster = new Formster('YOUR_API_KEY');
```

#### Track Form
To track a form (including form clicks and submissions), pass the DOM element to the `trackForm` method:

```javascript
    formster.trackForm($("#my-form-id").get(0));
```

#### Page Visit
To track a visit to a page, use the `visit` method with a page name as the only paramter:

```javascript
    formster.visit("lead-form");
```

### Underlying API Library
The guts of formster.js, most users will never need to touch the underlying library. However, it is exposed on the `Formster` object as `Formster.Api`. Any changes made to the `Api` object will be used in all future instances of `Formster`.

---
_Source: https://npm.io/package/formster.js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
