Algoliax v0.6.0 Algoliax View Source

Algoliax is wrapper for Algolia api

Configuration

Algoliax needs only :api_key and application_id config. These configs can either be on config files or using environment varialble "ALGOLIA_API_KEY" and "ALGOLIA_APPLICATION_ID".

config :algoliax,
  api_key: "",
  application_id: ""

Link to this section Summary

Functions

Generate a secured api key with filter

Same as generate_secured_api_key/2 but returns the key or raises if invalid params

Link to this section Functions

Link to this function

generate_secured_api_key(api_key, params)

View Source
generate_secured_api_key(api_key :: String.t(), params :: map()) ::
  {:ok, binary()} | {:error, binary()}

Generate a secured api key with filter

Examples

Algoliax.generate_secured_api_key("api_key", %{filters: "reference:10"})
Algoliax.generate_secured_api_key("api_key", %{filters: "reference:10 OR nickname:john"})
Link to this function

generate_secured_api_key!(api_key, params)

View Source
generate_secured_api_key!(api_key :: String.t(), params :: map()) :: binary()

Same as generate_secured_api_key/2 but returns the key or raises if invalid params

Examples

Algoliax.generate_secured_api_key!("api_key", %{filters: "reference:10"})
Algoliax.generate_secured_api_key!("api_key", %{filters: "reference:10 OR nickname:john"})