# Clova

A behaviour and related modules for implementing a Clova Extension.

## Summary

Defines a `Clova` behaviour which can be implemented to receive callbacks to handle requests.
`Plug` should be used to parse the request, validate it, and dispatch it to the `Clova` implementation.

Example `Plug.Router` pipeline:

plug Plug.Parsers,
   parsers: [:json],
   json_decoder: Poison,
   body_reader: Clova.CachingBodyReader.spec()
plug Clova.Validator, app_id: "com.example.my_extension"
plug Clova.Dispatcher, dispatch_to: MyExtension
plug :match
plug :dispatch

post "/endpoint" do

Example `Clova` implementation for a Hello World extension:
defmodule MyExtension do
  use Clova

  def handle_launch(_request, response) do
    |> add_speech("ハロー、ワールド!")
    |> end_session
For a more detailed example, see the [AirQuality example extension](

## Installation

Add `:clova` to your `mix.exs` dependencies. This package assumes you will be using Plug - see the
[Plug documentation]( for setting up a Plug application.

  defp deps do
      {:clova, "~> 0.3.0"},
      {:plug, "~> 1.5"},
      {:cowboy, "~> 2.2"}

## Online Documentation

[Full documentation is available on HexDocs.](