> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usekana.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup

> We currently have no publicly accessible Ruby SDK library, so it may be beneficial for you to use one of the various GraphQL clients as provided through the link below, or to setup your own.

<Card
  title="GraphQL Code Libraries, Tools and Services"
  href="https://graphql.org/code/"
  icon={
<svg
  class="h-7 w-7"
  xmlns="http://www.w3.org/2000/svg"
  height="64"
  width="64"
  viewBox="0 0 29.999 30"
  fill="#e10098"
>
  <path d="M4.08 22.864l-1.1-.636L15.248.98l1.1.636z" />
  <path d="M2.727 20.53h24.538v1.272H2.727z" />
  <path d="M15.486 28.332L3.213 21.246l.636-1.1 12.273 7.086zm10.662-18.47L13.874 2.777l.636-1.1 12.273 7.086z" />
  <path d="M3.852 9.858l-.636-1.1L15.5 1.67l.636 1.1z" />
  <path d="M25.922 22.864l-12.27-21.25 1.1-.636 12.27 21.25zM3.7 7.914h1.272v14.172H3.7zm21.328 0H26.3v14.172h-1.272z" />
  <path d="M15.27 27.793l-.555-.962 10.675-6.163.555.962z" />
  <path d="M27.985 22.5a2.68 2.68 0 0 1-3.654.981 2.68 2.68 0 0 1-.981-3.654 2.68 2.68 0 0 1 3.654-.981c1.287.743 1.724 2.375.98 3.654M6.642 10.174a2.68 2.68 0 0 1-3.654.981A2.68 2.68 0 0 1 2.007 7.5a2.68 2.68 0 0 1 3.654-.981 2.68 2.68 0 0 1 .981 3.654M2.015 22.5a2.68 2.68 0 0 1 .981-3.654 2.68 2.68 0 0 1 3.654.981 2.68 2.68 0 0 1-.981 3.654c-1.287.735-2.92.3-3.654-.98m21.343-12.326a2.68 2.68 0 0 1 .981-3.654 2.68 2.68 0 0 1 3.654.981 2.68 2.68 0 0 1-.981 3.654 2.68 2.68 0 0 1-3.654-.981M15 30a2.674 2.674 0 1 1 2.674-2.673A2.68 2.68 0 0 1 15 30m0-24.652a2.67 2.67 0 0 1-2.674-2.674 2.67 2.67 0 1 1 5.347 0A2.67 2.67 0 0 1 15 5.347" />
</svg>
}
>
  graphql
</Card>

For our examples in Ruby, we're going to be using a very simple custom client to make our calls to the Kana GraphQL API - specify the following as its own class:

```ruby theme={null}
# Install the following gems beforehand and require them
require 'httparty'
require 'json'

# Setup the GraphQL API client in Ruby
class KanaGraphqlClient
  def initialize(api_key)
    @api_key = api_key
  end

  def execute(query:, variables: nil)
    HTTParty.post(
      "https://api.usekana.com/graphql",
      headers: {
        'Content-Type'  => 'application/json',
        'Authorization' => @api_key
      },
      body: {
        query: query,
        variables: variables
      }.to_json
    )
  end
end
```

We can now initialize this when required by providing a Kana API Key - we'll tie this initialized object to the `client` variable like so:

```ruby theme={null}
client = KanaGraphqlClient.new(#{API_KEY})
```

<Warning>
  Make sure to either replace #*\{APIKEY}* or define *API\_KEY* with the Kana API
  Key you were provisioned. [More on authentication can be found
  here](/admin-api-backend/authorization-backend).
</Warning>

You're now ready to go!
