Popularity
0.5
Declining
Activity
0.0
Stable
1
0
2

Description

Simplistic api wrapper for Typeform api without abusing macro/dsl.

For more information about api check Typeform docs

Monthly Downloads: 0
Programming language: Elixir
License: MIT License
Tags: Phoenix     API     Forms     Typeform    

ExForm alternatives and similar packages

Based on the "Forms" category.
Alternatively, view ExForm alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of ExForm or a related project?

Add another 'Forms' Package

README

ExForm

MIT licensed Deps Status Inline docs Hex Version Code TriagersBadge

Simplistic api wrapper for Typeform api without abusing macro/dsl.

For more information about api check Typeform docs

Link for API key

Sign up for one here.

Installation

If available in Hex, the package can be installed as:

  1. Add ex_form to your list of dependencies in mix.exs:

    def deps do
      [{:ex_form, "~> 0.1.0"}]
    end
    
  2. Ensure ex_form is started before your application:

    def application do
      [applications: [:ex_form]]
    end
    

Examples

{:ok, form} = ExForm.new
|> ExForm.short_text("A short text", max_characters = 14)
|> ExForm.long_text("Long text here")
|> ExForm.yes_no("Will Trump win?")
|> ExForm.number("Lucky number?")
|> ExForm.opinion_scale("Rate this test?", "Could be better", "Okay", "Awesome")
|> ExForm.rating("Whatever")
|> ExForm.publish("Awesome form tittle", "http://requestb.in/112mjyd1")

iex> form
%{"_links" => [%{"href" => "https://api.typeform.io/v0.4/forms/xd6ZCNMK3h", "rel" => "self"}, %{"href" => "https://forms.typeform.io/to/JHSAzF4qLb", "rel" => "form_render"}, %{"href" => "https://api.typeform.io/v0.4/urls/JHSAzF4qLb", "rel" => "url"}], "fields" => [%{"id" => 49056886, "max_characters" => 14, "question" => "A short text", "type" => "short_text"}, %{"id" => 49056887, "question" => "Long text here", "type" => "long_text"}, %{"id" => 49056888, "question" => "Will Trump win?", "type" => "yes_no"}, %{"id" => 49056889, "question" => "Lucky number?", "type" => "number"}, %{"id" => 49056890, "labels" => %{"center" => "Okay", "left" => "Could be better", "right" => "Awesome"}, "question" => "Rate this test?", "steps" => 11, "type" => "opinion_scale"}, %{"id" => 49056891, "question" => "Whatever", "shape" => "star", "steps" => 5, "type" => "rating"}], "id" => "xd6ZCNMK3h", "tags" => ["deafult"], "title" => "Awesome form tittle", "urls" => [%{"form_id" => "xd6ZCNMK3h", "id" => "JHSAzF4qLb", "version" => "v0.4"}], "version" => "v0.4", "webhook_submit_url" => "http://requestb.in/112mjyd1"}

Just build and prepare

form_payload = ExForm.new
|> ExForm.short_text("A short text", max_characters = 14)
|> ExForm.long_text("Long text here")
|> ExForm.yes_no("Will Trump win?")
|> ExForm.number("Lucky number?")
|> ExForm.opinion_scale("Rate this test?", "Could be better", "Okay", "Awesome")
|> ExForm.rating("Whatever")
|> ExForm.build("Awesome form tittle", "http://requestb.in/112mjyd1")

Configuration

In order to run TYPE_SECRET should be set in env

export TYPE_SECRET=key-goes-here


*Note that all licence references and agreements mentioned in the ExForm README section above are relevant to that project's source code only.