# KantaSync Plugin

This plugin for [Kanta]( allows easily synchronizing translations from your dev/staging environment, directly into the production.

## Installation

Add KantaSync plugin to your deps list:
def deps do
    {:kanta_sync_plugin, "~> 0.1.0"}

Create a new migration file and add the KantaSync migrations setup:

defmodule KantaTest.Repo.Migrations.AddKantaSyncTables do
  use Ecto.Migration

  def up do
    Kanta.Sync.Migration.up(version: 1)

  def down do
    Kanta.Sync.Migration.down(version: 1)

KantaSync plugin creates table `kanta_sync_information` where information about the last fetch from the production is stored, to send only necessary changes instead of a full translations list when synchronizing. 

Make sure that you have the Kanta API endpoint configured:

scope "/" do 

## Environment variables

  Full path to Kanta API endpoint. 
  Secret token allowing communication between production and staging/dev environments. Should be generated with `mix phx.gen.secret 256`.
  Both environments must have the same `KANTA_SECRET_TOKEN` environment variables. You can also disable default authorization mechanism and use your own, by passing `disable_api_authorization: true` option into Kanta's config.