> For the complete documentation index, see [llms.txt](https://docs.opensoutheners.com/oss/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.opensoutheners.com/oss/flex-url/getting-started/installation.md).

# Installation

Install the TypeScript or PHP flex-url package.

{% tabs %}
{% tab title="TypeScript" %}

## Requirements

* Node.js 24.x (Active LTS) or 26.x (Current)

## Installing the package

```bash
npm install flex-url
```

The package ships both ESM and CJS builds with full type declarations — no separate `@types` package needed.

## Importing

```ts
import {flexUrl, url, FlexUrl} from 'flex-url';
// `url` is an alias for `flexUrl`.
```

The JSON:API `links`/`meta` pagination helpers live at a separate entry point so they can be tree-shaken out when unused:

```ts
import {links, meta, nextUrl, prevUrl} from 'flex-url/links';
```

See [JSON:API Links Helper](https://docs.opensoutheners.com/oss/flex-url/advanced/json-api-links.md).
{% endtab %}

{% tab title="PHP" %}

## Requirements

* PHP 8.2 or higher

## Installing the package

```bash
composer require open-southeners/flex-url
```

## Importing

```php
use OpenSoutheners\FlexUrl\FlexUrl;
use OpenSoutheners\FlexUrl\FlexUrlOptions;

// A global helper alias for `FlexUrl::make($url)` is also autoloaded:
use function flex_url;
```

No service provider, facade, or Laravel integration is required — the package has zero runtime dependencies and works in any PHP 8.2+ codebase.
{% endtab %}
{% endtabs %}

## Next steps

Continue to [Quick Start](https://docs.opensoutheners.com/oss/flex-url/getting-started/quick-start.md) for a tour of the builder and reader API.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.opensoutheners.com/oss/flex-url/getting-started/installation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
