Tink.Config (Tink v1.0.0)

Copy Markdown View Source

Runtime configuration for the Tink SDK.

Set values in config/runtime.exs:

config :tink,
  client_id:      System.get_env("TINK_CLIENT_ID"),
  client_secret:  System.get_env("TINK_CLIENT_SECRET"),
  base_url:       "https://api.tink.com",
  link_base_url:  "https://link.tink.com",
  webhook_secret: System.get_env("TINK_WEBHOOK_SECRET"),
  timeout:        30_000,
  max_retries:    3,
  retry_delay:    500,
  http_adapter:   Tink.HTTP.Finch,
  cache: [
    enabled:  true,
    max_size: 1_000
  ]

Disabling cache in tests

# config/test.exs
config :tink, cache: [enabled: false]

Summary

Functions

base_url()

@spec base_url() :: String.t()

cache_enabled?()

@spec cache_enabled?() :: boolean()

cache_max_size()

@spec cache_max_size() :: pos_integer()

client_id()

@spec client_id() :: String.t()

client_secret()

@spec client_secret() :: String.t()

http_adapter()

@spec http_adapter() :: module()

max_retries()

@spec max_retries() :: non_neg_integer()

rate_limit_cfg()

@spec rate_limit_cfg() :: keyword()

retry_delay()

@spec retry_delay() :: non_neg_integer()

timeout()

@spec timeout() :: pos_integer()

webhook_secret()

@spec webhook_secret() :: String.t() | nil