View Source Jellyfish.Client (Jellyfish Server SDK v0.1.1)

Defines a Jellyfish.Client.t/0.

By default, Mint adapter for Tesla is used to make HTTP requests, but it can be changed:

# config.exs
config :jellyfish_server_sdk, tesla_adapter: Tesla.Adapter.Hackney

# mix.exs
defp deps do
  [
    {:hackney, "~> 1.10"}
  ]
end

For the list of supported Tesla adapters refer to Tesla docs.

Link to this section Summary

Link to this section Types

@type t() :: %Jellyfish.Client{http_client: Tesla.Client.t()}

Link to this section Functions

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

Creates a new instance of Jellyfish.Client.t/0.

Uses token set in config.exs. To explicitly pass the token, see new/2.

# in config.exs
config :jellyfish_server_sdk, server_api_token: "your-jellyfish-token"

client = Jellyfish.Client.new("http://address-of-your-server.com")

See new/2 for description of parameters.

Link to this function

new(address, server_api_token)

View Source
@spec new(String.t(), String.t()) :: t()

Creates a new instance of Jellyfish.Client.t/0.

parameters

Parameters

  • address - url or IP address of the Jellyfish server instance
  • server_api_token - token used for authorizing HTTP requests. It's the same token as the one configured in Jellyfish.