# Install the SDK

Bunny provides server side libraries that abstract much of the authentication, authorization and request formation boilerplate code required to make API requests.

You can find the source code for the two SDKs here:

* [Node SDK](https://github.com/bunnyapp/bunny-node)
* [Ruby SDK](https://github.com/bunnyapp/bunny-ruby)

Installing the SDKs is straighforward.

{% tabs %}
{% tab title="Node.js" %}
Install the Bunny SDK via NPM

```
npm install @bunnyapp/api-client --save
```

Set the access token

```javascript
const Bunny = require("bunny");

const bunny = new Bunny({
  accessToken: "<access-token>",
  baseUrl: "https://<subdomain>.bunny.com"  
});
```

Or alternatively use client credentials. This will enable automatic refresh of expired access tokens.

```javascript
const Bunny = require("bunny");

const bunny = new Bunny({
  clientId: "<bunny-client-id>",
  clientSecret: "<bunny-client-secret>",
  scope: "standard:read standard:write",
  baseUrl: "https://<subdomain>.bunny.com"  
});
```

Source: <https://github.com/bunnyapp/bunny-node>
{% endtab %}

{% tab title="Ruby" %}
Install the Bunny SDK via RubyGems

```
gem install bunnyapp
```

Use Rails generator to create `initializers/bunny_app.rb`

```
bin/rails g bunny_app:install
```

Set access token

```ruby
require 'bunny_app'

BunnyApp.config do |c|
  c.access_token = 'xxx'
  c.base_uri = 'https://<subdomain>.bunny.com'
end
```

Or alternatively use client credentials. This will enable automatic refresh of expired access tokens.

```ruby
require 'bunny_app'

BunnyApp.config do |c|
  c.client_id = 'xxx'
  c.client_secret = 'xxx'
  c.scope = 'standard:read standard:write'
  c.base_uri = 'https://<subdomain>.bunny.com'
end
```

Source: <https://github.com/bunnyapp/bunny-ruby>
{% endtab %}
{% endtabs %}

We recommend using one of our official SDKs, however if you want to write your own code then you will need to [generate an access token and include it in the Authorization header of your GraphQL requests](/developer/using-the-graphql-api/authorizing-api-requests.md). You should also keep in mind handling access token expiry errors and retries.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bunny.com/developer/bunny-sdk/install-the-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
