In order to start this package we can either start it under a supervision tree (most common).The GenServer takes a map with two properties.
token: Your Unkey root key used to make requests. You can create one hererequired
base_url: The base URL endpoint you will be hitting i.e. https://api.unkey.dev/v1/keys (optional).
Copy
Ask AI
children = [ {UnkeyElixirSdk, %{token: "yourunkeyrootkey"}} ]# Now we start the supervisor with the children and a strategy{:ok, pid} = Supervisor.start_link(children, strategy: :one_for_one)# After started, we can query the supervisor for informationSupervisor.count_children(pid)#=> %{active: 1, specs: 1, supervisors: 0, workers: 1}
You can also call the start_link function instead.