ExUrlbox.Config (ExUrlbox v0.3.0)

View Source

Retrieve config variables that are used with Urlbox's API.

All settings also accept {:system, "ENV_VAR_NAME"} to read their values from environment variables at runtime.

Summary

Functions

Returns the URLBOX_API_KEY

Returns the API endpoint with api_key for the following HTTP methods: GET, DELETE, HEAD

Urlbox's API path for POST requests

Returns the URLBOX_API_SECRET

Returns the default API endpoint. Used with POST requests

A light wrapper around Application.get_env/2, providing automatic support for {:system, "VAR"} tuples.

Returns the appropriate Tesla adapter based on the environment. In test environment, returns Tesla.Mock. In other environments, returns the configured adapter or defaults to Hackney.

Functions

api_key()

Returns the URLBOX_API_KEY

config :ex_urlbox, api_key: "URLBOX_API_KEY"

api_key_endpoint()

Returns the API endpoint with api_key for the following HTTP methods: GET, DELETE, HEAD

api_post_endpoint()

Urlbox's API path for POST requests

api_secret()

Returns the URLBOX_API_SECRET

config :ex_urlbox, api_secret: "URLBOX_API_SECRET"

base_endpoint()

Returns the default API endpoint. Used with POST requests

from_env(otp_app, key, default \\ nil)

A light wrapper around Application.get_env/2, providing automatic support for {:system, "VAR"} tuples.

get_client_adapter(opts \\ [])

Returns the appropriate Tesla adapter based on the environment. In test environment, returns Tesla.Mock. In other environments, returns the configured adapter or defaults to Hackney.