DiscordTwitterMIT License

ClashOfClans.ex

An functional Clash of Clans APi Wrapper written in pure Elixir.

clashofclans.ex


Getting started

BSF: This is a WIP and currently in v1 (development) mode. This means that the API is not stable and may change at any time.

Installing

def deps do
[{:clashofclans, "~> 0.1.0"}]
end
$ mix deps.get

Configuration

Since we (currently) only support authentication through APi tokens, you will need to get one from the Clash of Clans API website. Once you have your token, you can add it to your config/config.exs file like so:

config/config.exs

# Without sourcing
import Config
config :clashofclans, api_key: System.get_env("API_KEY")

config/config.exs

# With sourcing
import Config
config :clashofclans, api_key: "super-secret-api-key-here"

With this method you have to run source .env before running/building your application.

Note: If you want to use a custom ENV environment on runtime, then use a custom library like https://hex.pm/packages/dotenv_parser.

.env example

export API_KEY="super-secret-api-key-here"

You can directly pass in the APi key if you use a custom/runtime environment, but make sure the .env is in your root directory.

Queries, functions, modules

1.) Modules
2.) Functions