Getting Started

Basin is the perfect solution for static sites that need a form backend, and works anywhere HTML forms can be rendered.

Quick Setup


To start using Basin to power your web forms, you'll need the following:

  • A Basin account
  • An HMTL form
  • A unique form endpoint (generated by Basin)
  • Basic knowledge of JavascriptOptional
Creating an HTML form

In order to use Basin, you’re going to need an HTML form. If you don't already have one, you can start with the following example:

HTML
<form action="#" method="POST">
<label for="email-address">Email Address</label>
<input type="email" id="email" name="email" required>
<button type="submit">Submit</button>
</form>

Theaction="#"determines where submitted data will be sent for processing. Developers often use something like the following:

HTML
<form action="https://coolsite.com/form.php" method="POST">
<label for="email-address">Email Address</label>
<input type="email" id="email" name="email" required>
<button type="submit">Submit</button>
</form>

The downside to this method is the need to write backend code (like Nodejs, PHP, Python, Ruby, Perl, etc.) to process the data once it hits the URL. But with Basin, you can out that development time by using a unique URL endpoint to handle all the backend data processing for you. They look like this:

https://usebasin.com/f/1a2b3c4d5e6f
Creating a form endpoint

After creating your Basin account, you'll be prompted to create your first form endpoint. Simply fill out the fields and click “Create Form”. You'll use this same process for every form endpoint you create with Basin.

When creating a new form endpoint, thenamefield is required. Setting a customredirect URLis optional and only avaliable to customers on paid plans. If you leave this field blank, people who submit to your form will see our default submission success page below.

After creating an endpoint, go to theSetuppage in your dashboard and simply copy/paste the URL endpoint into your form’s action attribute. If you used the example form above, it should now look like this:

HTML
<form action="https://usebasin.com/f/1a2b3c4d5e6f" method="POST">
<label for="email-address">Email Address</label>
<input type="email" id="email" name="email" required>
<button type="submit">Submit</button>
</form>

And that's it. You’re all set to receive submissions.

Helpful Tips

1. Every input field must have thenameattribute defined.

HTML
<input type="email" name="email">
<input type="text" name="name">
<input type="text" name="phone">
<input type="text" name="website">

2. Requests using javascript are supported by default in Basin. You are able to setcontent-type:json,form-data, orx-www-form-urlencoded. If you're using a vanilla HTML form that doesn't include any special functions, don't worry about this.

3. If you want to collect data usingjsonas the format, then you must set theAcceptheader toapplication/json.