> For the complete documentation index, see [llms.txt](https://ordino-ai.gitbook.io/ordino-ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ordino-ai.gitbook.io/ordino-ai/sdk-reference/services.md).

# Services

{% hint style="success" %}
**Good to know:** This document provides a step-by-step guide for setting up and using **`@ordino.ai/ordino-engine`** for API testing with **Cypress**. framework exposes the **Ordino Engine** directly, allowing test teams to build **custom service classes** that encapsulate business logic.
{% endhint %}

### Prerequisites

Before you begin, ensure the following dependencies and requirements are met:

| Requirement          | Version / Notes         |
| -------------------- | ----------------------- |
| **Node.js**          | `>= 22.x`               |
| **Cypress**          | `>= 13.x`               |
| **Package Manager**  | `npm` or `yarn`         |
| **Language Support** | TypeScript / JavaScript |

### Installation

Add **`@ordino.ai/ordino-engine`** to your Cypress project:

```bash
npm install @ordino.ai/ordino-engine@2.2.0-cy.8 --save-dev
```

***

A recommended directory layout for using **`@ordino.ai/ordino-engine`** with Cypress:

```bash
/ordino
  /e2e
    /api
      users.spec.ts
  /services
    add_user.ts
  /payloads
    user_info.ts
  /support
    commands.ts
cypress.config.ts
package.json
```

#### Directory / File Details

* **`/e2e/api/`**\
  Contains your **end-to-end test specifications**.
  * `users.spec.ts` → Example Cypress spec file testing user-related API endpoints.
* **`/services/`**\
  Houses **service classes** that encapsulate API calls and business logic.
  * `add_user.ts` → Example service class for handling user-related API operations.
* **`/payloads/`**\
  Stores **request/response payloads** used in tests.
  * `user_info.ts` → Example test payload for creating or validating users data.
* **`/support/`**\
  Contains Cypress **custom commands and global hooks**.
  * `commands.ts` → Extend Cypress with reusable commands for common actions.
* **`cypress.config.ts`**\
  Cypress configuration file. Define base URL, environment variables, and test settings here.
* **`package.json`**\
  Project dependencies, scripts, and metadata. Includes the installed **`@ordino.ai/ordino-engine`** package.

***

### Engine Import

In any **service** or **test file**, import the **HTTP API** from `@ordino.ai/ordino-engine`:

```typescript
import { ordinoSuite } from '@ordino.ai/ordino-engine';

const http = ordinoSuite.api(ApiServiceType.HTTP);
```

* **`ordinoSuite`** → Main entry point to the Ordino Engine.
* **`ApiServiceType.HTTP`** → Specifies that the API service should use HTTP as the communication layer.
* **`http`** → An initialized API client instance to perform requests.
