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

# Introduction

Our SDKs provide a type-safe way to use our conversion services directly through installable packages.
In essence, they're lightweight wrappers around our REST API — but with type safety, auto-completion, and an enhanced developer experience (DX).

## Available SDKs

We offer official SDKs for the following languages:

| Language              | Package                                                         |
| --------------------- | --------------------------------------------------------------- |
| TypeScript/JavaScript | [@ip2geo/sdk](https://npmjs.com/package/@ip2geo/sdk)            |
| Ruby                  | [ip2geo](https://rubygems.org/gems/ip2geo)                      |
| Python                | [ip2geo-sdk](https://pypi.org/project/ip2geo-sdk/)              |
| PHP                   | [ip2geo-dev/sdk](https://packagist.org/packages/ip2geo-dev/sdk) |

## Why Use the SDK Instead of the REST API?

* **Type Safety:** Get full TypeScript/Ruby/Python support to catch issues early and reduce runtime errors.
* **Simplified Integration:** Includes pre-built functions for requests, authentication, and response handling — no need to manually set up HTTP calls.
* **Faster Development:** Focus on your app's logic while the SDK handles the boilerplate.
* **Better Documentation:** Clear examples and typings make it easy to discover and use available methods.
* **Automatic Updates:** The SDKs stay in sync with the API, giving you access to the latest endpoints and improvements.

<Warning>
  The only reason not to use the SDK is if your environment doesn't support npm, RubyGems, or PyPI, or if your use case requires direct REST API calls.
</Warning>

## Installation

<Tabs>
  <Tab title="TypeScript">
    The TypeScript SDK works with all major JavaScript runtimes that support npm, including Node.js, Deno, Bun, and the browser (with public keys).

    <Tabs>
      <Tab title="npm">
        ```bash theme={null}
        npm install @ip2geo/sdk@latest
        ```
      </Tab>

      <Tab title="bun">
        ```bash theme={null}
        bun add @ip2geo/sdk@latest
        ```
      </Tab>

      <Tab title="deno">
        ```bash theme={null}
        deno install @ip2geo/sdk@latest
        ```
      </Tab>

      <Tab title="yarn">
        ```bash theme={null}
        yarn add @ip2geo/sdk@latest
        ```
      </Tab>

      <Tab title="pnpm">
        ```bash theme={null}
        pnpm add @ip2geo/sdk@latest
        ```
      </Tab>
    </Tabs>
  </Tab>

  <Tab title="Ruby">
    The Ruby SDK works with Ruby 2.7 and above. Install via Bundler or directly with gem.

    <Tabs>
      <Tab title="Bundler">
        Add to your Gemfile:

        ```ruby theme={null}
        gem 'ip2geo'
        ```

        Then run:

        ```bash theme={null}
        bundle install
        ```
      </Tab>

      <Tab title="gem">
        ```bash theme={null}
        gem install ip2geo
        ```
      </Tab>
    </Tabs>
  </Tab>

  <Tab title="Python">
    The Python SDK works with Python 3.8 and above. Install via pip.

    <Tabs>
      <Tab title="pip">
        ```bash theme={null}
        pip install ip2geo-sdk
        ```
      </Tab>

      <Tab title="pip (requirements.txt)">
        Add to your requirements.txt:

        ```
        ip2geo-sdk
        ```

        Then run:

        ```bash theme={null}
        pip install -r requirements.txt
        ```
      </Tab>
    </Tabs>
  </Tab>

  <Tab title="PHP">
    The PHP SDK works with PHP 8.0 and above. Install via Composer.

    <Tabs>
      <Tab title="composer">
        ```bash theme={null}
        composer require ip2geo-dev/sdk
        ```
      </Tab>
    </Tabs>
  </Tab>
</Tabs>
