> For the complete documentation index, see [llms.txt](https://docs.bunny.com/developer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bunny.com/developer/bunny-sdk/install-the-sdk.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
