openapi-api

OpenAPI client and app API wiring. Use when adding or using API endpoints, editing the openapi client, or wiring new APIs in the app.

lazzr-labs/photon-app1 installsMITSynced Aug 26

Works with

Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
---
name: openapi-api
description: OpenAPI client and app API wiring. Use when adding or using API endpoints, editing the openapi client, or wiring new APIs in the app.
license: MIT
---

# OpenAPI and API

**Client:** The **openapi** folder holds the generated API client (do not edit by hand; regenerate from the OpenAPI spec). All API classes and types live there.

**Wiring:** **api.ts** is the single place that instantiates and exports API clients. It creates one **Configuration**, one Axios instance, and a **url** (e.g. **process.env.EXPO_PUBLIC_API_URL**). Each API class is constructed with **(config, url, axiosInstance)** and exported (e.g. **authApi**, **usersApi**).

* When the spec or generator adds a new API, add the same pattern in **api.ts**: import the **XxxApi** class, **new XxxApi(config, url, axiosInstance)**, then **export { ..., xxxApi }**.

## Usage

* Import API instances from **~/src/api** (e.g. **authApi**, **usersApi**). Call the generated methods (e.g. **authApi.signInAPI(...)**); auth is usually passed per call (e.g. token as last argument) where required.
* Most API calls are made inside **Zustand stores**; some are used directly in screens or components. Use **ErrorGet** from **~/src/scripts/error** and **Toast** for user-facing errors.

More API Design skills

← All API Design skills

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY