Skip to content

Commit ae00ae6

Browse files
committed
docs: clarify what a custom client is
1 parent dd9ce4a commit ae00ae6

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

16/umbraco-cms/customizing/foundation/fetching-data/custom-generated-client.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@ description: Learn how to create a custom generated client with TypeScript types
44

55
# Custom Generated Client
66

7-
The Umbraco Backoffice provides a built-in HTTP client that you can use to make network requests. This client is colloquially known as the Umbraco HTTP Client. It is generated using **@hey-api/openapi-ts** around the OpenAPI specification and is available through the `@umbraco-cms/backoffice/http-client` package.
7+
Umbraco uses [@hey-api/openapi-ts](https://heyapi.dev/openapi-ts/get-started) to generate its HTTP client for the OpenAPI specification of the Management API. It is available through the `@umbraco-cms/backoffice/http-client` package.
88

99
{% content-ref url="http-client.md" %}
1010
[http-client.md](http-client.md)
1111
{% endcontent-ref %}
1212

13-
The HTTP client is generated using the [@hey-api/openapi-ts](https://heyapi.dev/openapi-ts/get-started) library. This library allows anyone to generate a TypeScript client from an OpenAPI specification. The generated client provides a convenient way to make requests to that specific API with type-safety without having to manually write the requests yourself. You can consider generating a client. This can save you a lot of time and effort when working with custom API controllers.
13+
The following examples will show you how to generate a client from an OpenAPI specification and how to use it in your project. We use the **@hey-api/openapi-ts** library, but the same principles apply to any other library that generates a TypeScript client.
1414

15-
If you want to generate your own client, you can use the following command:
15+
## Generate your own client
16+
17+
The generated client provides a convenient way to make requests to that specific API with type-safety without having to manually write the requests yourself. You can consider generating a client. This can save you a lot of time and effort when working with custom API controllers.
18+
19+
To get started, you can install the generator using the following command:
1620

1721
```bash
1822
npm install @hey-api/openapi-ts
@@ -26,7 +30,7 @@ npx openapi-ts generate --url https://example.com/openapi.json --output ./my-cli
2630

2731
This will generate a TypeScript client in the `./my-client` folder. You can then import the client into your project and use it to make requests to the Management API.
2832

29-
### Connecting to the Management API
33+
## Connecting to the Management API
3034

3135
You will need to set up a few configuration options in order to connect to the Management API. The following options are required:
3236

0 commit comments

Comments
 (0)