> 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](/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](/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 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.opensoutheners.com/oss/flex-url/getting-started/installation.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.
