Hoppscotch Wiki
Relevant source files
The following files were used as context for generating this wiki page:- README.md
- package.json
- packages/hoppscotch-cli/README.md
- packages/hoppscotch-desktop/README.md
- packages/hoppscotch-agent/README.md
- packages/hoppscotch-js-sandbox/README.md
- packages/hoppscotch-sh-admin/README.md
- packages/hoppscotch-common/src/helpers/import-export/import/openapi/index.ts
- TRANSLATIONS.md
- SECURITY.md
- packages/hoppscotch-cli/CONTRIBUTING.md
- netlify.toml
Hoppscotch is a lightweight, open-source API development ecosystem designed for speed and ease of use. It provides a comprehensive suite of tools to help developers create, test, document, and share APIs faster. The project is crafted with a minimalistic UI and is available as a web app, a Progressive Web App (PWA), and dedicated desktop clients.
The ecosystem supports a wide range of API specifications and protocols, including REST, GraphQL, WebSocket, Server-Sent Events, Socket.IO, and MQTT. It is designed to be highly collaborative, with features for teams, workspaces, and cloud synchronization across devices.
Sources: README.md
Core Features
Hoppscotch offers a rich set of features to streamline the API development lifecycle.
| Feature | Description |
|---|---|
| HTTP Methods | Supports standard methods (GET, POST, PUT, PATCH, DELETE, etc.) and custom methods. |
| Real-time Protocols | Native support for WebSocket, Server-Sent Events (SSE), Socket.IO, and MQTT. |
| GraphQL | A dedicated GraphQL client with schema exploration, multi-column docs, and query validation. |
| Authorization | Built-in support for Basic Auth, Bearer Token, OAuth 2.0, and OIDC Access Token/PKCE. |
| Collections & Workspaces | Organize requests into collections and folders. Group collections and environments into workspaces for different projects. |
| Environments | Store and reuse values like tokens and base URLs in requests and scripts using environment variables. |
| Scripting | Execute JavaScript code before a request is sent (Pre-Request Scripts) and after a response is received (Post-Request Tests). |
| Teams | Collaborate on shared collections with role-based access control. |
| Proxy | A built-in proxy mode to fix CORS issues and access non-HTTPS endpoints. |
| PWA Support | Can be installed as a Progressive Web App for offline support and a native-like experience. |
| Internationalization (i18n) | The app is available in multiple languages, with community contributions for translations. |
Sources: README.md
Project Architecture
Hoppscotch is a monorepo managed with pnpm workspaces. This structure allows for modular development, where different parts of the ecosystem are maintained as separate packages within the same repository.
Sources: package.json:23-25
This diagram shows the high-level structure of the Hoppscotch monorepo.
Sources: package.json:23-25
Key Packages
The repository is organized into several key packages, each serving a distinct purpose.
| Package | Description |
|---|---|
@hoppscotch/app | The main Nuxt 3 web application. |
@hoppscotch/common | Shared components, helpers, and composables used across different clients. |
@hoppscotch/data | Contains data types, validation schemas (Zod), and migrations for public data structures. |
@hoppscotch/cli | A command-line interface to run Hoppscotch test scripts in CI/CD environments. |
@hoppscotch/desktop | A cross-platform desktop application built with Tauri v2. |
@hoppscotch/agent | A local request relay agent to bypass browser limitations like CORS. |
@hoppscotch/js-sandbox | Provides a secure JavaScript sandbox for executing pre-request and test scripts. |
@hoppscotch/sh-admin | The admin dashboard for self-hosted Hoppscotch instances. |
@hoppscotch/kernel | A cross-platform runtime kernel for platform-specific operations. |
Sources: package.json:23-25, packages/hoppscotch-cli/package.json:2, packages/hoppscotch-data/package.json:2, packages/hoppscotch-js-sandbox/package.json:2, packages/hoppscotch-sh-admin/README.md:11, packages/hoppscotch-kernel/package.json:2
Clients and Add-ons
Hoppscotch provides multiple clients and add-ons to cater to different development workflows and environments.
Desktop App
The Hoppscotch Desktop App is a cross-platform application built with Tauri v2, offering a native experience and the ability to connect to self-hosted instances.
Sources: packages/hoppscotch-desktop/README.md:5
System Requirements
| Operating System | Architecture | Minimum Version / Dependencies |
|---|---|---|
| Windows | x64 | Windows 10 1803+ or Windows 11 |
| macOS | Intel x64 or Apple Silicon | macOS 10.15 (Catalina) or later |
| Linux | x64 | GLIBC 2.38+, WebKit2GTK 2.44.0+ (Ubuntu 24.04+ recommended) |
Sources: packages/hoppscotch-desktop/README.md:92-108
Command-Line Interface (CLI)
The CLI (@hoppscotch/cli) is designed to run Hoppscotch test scripts in automated environments like CI/CD pipelines. It can execute collections from a JSON file.
Sources: packages/hoppscotch-cli/README.md:3
The following diagram illustrates the execution flow of the hopp test command.
CLI Commands and Options
| Command / Option | Description |
|---|---|
hopp test [file] | Tests a Hoppscotch collection JSON file. |
-e, --env <path> | Specifies a path to an environment JSON file. |
-d, --delay <ms> | Defers the execution of requests in a collection by a specified delay. |
--token <token> | A personal access token for connecting to a Hoppscotch account. |
--server <url> | The URL of a self-hosted instance. |
--reporter-junit [path] | Specifies a file path to store a JUnit report. |
--iteration-count <num> | Runs the collection a specified number of times. |
--iteration-data <path> | Path to a CSV file for data-driven testing. |
Sources: packages/hoppscotch-cli/README.md:5-8, 23-64
Agent
The Hoppscotch Agent is a local HTTP request relay that runs as a system service. It overcomes browser limitations by handling requests locally, which enables:
- Bypassing CORS restrictions.
- Using client certificates for mTLS.
- Accessing
localhostand local network APIs. - Setting restricted headers.
Sources: packages/hoppscotch-agent/README.md:9, 50-58
The agent uses an OTP-based registration process to establish a secure, encrypted communication channel with the Hoppscotch web app.
This sequence diagram shows the agent registration and request flow.
JavaScript Sandbox
The @hoppscotch/js-sandbox package provides a secure environment for executing user-provided JavaScript, such as pre-request scripts and tests. It uses quickjs-emscripten to create isolated sandboxes, preventing malicious code from accessing sensitive browser or system resources.
Sources: packages/hoppscotch-js-sandbox/README.md:11-15
Feature Deep Dive: OpenAPI Import
Hoppscotch can import API collections from OpenAPI (formerly Swagger) specifications, supporting both v2 and v3 in JSON or YAML format. This feature simplifies the process of migrating existing APIs into Hoppscotch.
The import process is handled by the hoppOpenAPIImporter function.
Sources: packages/hoppscotch-common/src/helpers/import-export/import/openapi/index.ts:741
This flowchart outlines the steps involved in importing an OpenAPI file.
The importer performs several key steps:
- Parsing: The input string is parsed as either JSON or YAML.
- Validation: The parsed object is validated against the OpenAPI schema using
SwaggerParser. The system attempts a best-effort import even if validation fails but the basic structure is present. - Dereferencing: It resolves all
$refreferences within the document to create a self-contained specification. If dereferencing fails, it proceeds with the original document. - Conversion: The validated and dereferenced document is converted into a
HoppCollectionobject. This involves mapping OpenAPI paths, parameters, headers, authentication methods, and request bodies to their corresponding Hoppscotch data structures.
Sources: packages/hoppscotch-common/src/helpers/import-export/import/openapi/index.ts:741-816
Development and Contribution
The project uses pnpm for package management and GitHub Actions for Continuous Integration.
Development Setup
- Clone the repository.
- Install
pnpmglobally:npm install -g pnpm. - Install dependencies:
pnpm install. - Start the development server:
pnpm run dev.
Sources: package.json:13, packages/hoppscotch-cli/CONTRIBUTING.md:21-24, packages/hoppscotch-sh-admin/README.md:33-39
Contribution Process
Contributions should follow the GitHub Flow. The general process is:
- Create a feature branch.
- Add commits with your changes.
- Open a pull request for review.
- A pull request can be merged after receiving sign-off from two other developers.
Sources: README.md:217-219, packages/hoppscotch-cli/CONTRIBUTING.md:10-16
Internationalization (i18n)
Hoppscotch supports multiple languages through community-contributed translations. To add a new language:
- Fork the repository.
- Create a new language file (e.g.,
fr.json) in the/packages/hoppscotch-common/localesdirectory. - Copy the contents from
en.jsonand translate the strings. - Add the new language entry to
/packages/hoppscotch-common/languages.json. - Submit a pull request.
Sources: TRANSLATIONS.md
Security Policy
The Hoppscotch team takes security seriously and has a defined policy for handling vulnerabilities.
- Reporting: Vulnerabilities must be reported privately using GitHub Security Advisories. Public GitHub issues should not be used for security reports.
- Invalid Vulnerabilities: Reports on dependencies (unless a practical attack is demonstrated), old runtimes, or unsupported environments are generally not considered valid.
- Incident Response: The process involves confirming the issue, auditing for similar problems, and preparing and deploying fixes as quickly as possible.
Sources: SECURITY.md