Skip to content

An Elixir wrapper for the Nationbuilder API, complete with API key cycling and more

License

Notifications You must be signed in to change notification settings

BrandNewCongress/nb_ex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nb

An Elixir wrapper for the Nationbuilder API, complete with API key cycling and more.

Installation

If available in Hex, the package can be installed by adding nb to your list of dependencies in mix.exs:

def deps do
  [
    {:nb, "git://github.com/BrandNewCongress/nb_ex.git"}
  ]
end

Usage

In your config.exs, put

config :nb,
  slug: "YOUR NATIONBUILDER SLUG",
  keys: ["KEY 1", "KEY 2", "KEY 3"]

And add Nb to your supervision tree

# List all child processes to be supervised
children = [
  worker(Nb, []),
]

And you're good to go!

%{"id" => id} = Nb.People.push(%{first_name: "Greg", last_name: "Greg", email: "greggreg@greg.edu"})
Nb.People.update(id, %{"phone" => "2147030845"})

Documentation

Clone the repository, and see doc/index.html.

About

An Elixir wrapper for the Nationbuilder API, complete with API key cycling and more

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages