Skip to content

Commit bb38bfb

Browse files
authored
Merge pull request #1774 from hey-api/docs/platform-guide
docs: announce Hey API platform
2 parents 5848e1a + c0b36b9 commit bb38bfb

File tree

11 files changed

+213
-43
lines changed

11 files changed

+213
-43
lines changed

.changeset/good-ligers-matter.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@hey-api/client-axios': patch
3+
'@hey-api/client-fetch': patch
4+
'@hey-api/client-next': patch
5+
'@hey-api/client-nuxt': patch
6+
'@hey-api/openapi-ts': patch
7+
'@docs/openapi-ts': patch
8+
---
9+
10+
docs: announce Hey API platform

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
- generates TypeScript interfaces and SDKs
3737
- Fetch API, Axios, Nuxt, Angular, Node.js, and XHR clients available
3838
- plugin ecosystem to reduce third-party boilerplate
39+
- [platform](https://heyapi.dev/openapi-ts/integrations) for automating codegen builds
40+
41+
## Platform
42+
43+
Our platform for OpenAPI specifications is now available. Automatically update your code when the APIs it depends on change. [Find out more](https://heyapi.dev/openapi-ts/integrations).
3944

4045
## Sponsors
4146

@@ -47,10 +52,6 @@ Love Hey API? Become our [sponsor](https://github.com/sponsors/hey-api).
4752
</a>
4853
</p>
4954

50-
## GitHub Integration (coming 2025)
51-
52-
Automatically update your code when the APIs it depends on change. [Find out more](https://heyapi.dev/openapi-ts/integrations.html).
53-
5455
## Quick Start
5556

5657
The fastest way to use `@hey-api/openapi-ts` is via npx

docs/.vitepress/config/en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ export default defineConfig({
210210
items: [
211211
{
212212
link: '/openapi-ts/integrations',
213-
text: 'GitHub <span data-soon>soon</span>',
213+
text: 'GitHub',
214214
},
215215
],
216216
text: 'Integrations',

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ features:
4040
link: /openapi-ts/plugins
4141
linkText: Learn more
4242
- icon: <svg class="icon-github" width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 98 98"><path fill-rule="evenodd" clip-rule="evenodd" d="M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z" fill="#24292f"/></svg>
43-
title: Integrations <span data-soon>Soon</span>
43+
title: Integrations
4444
details: Automatically update your code when the APIs it depends on change. Works with any codegen.
4545
link: /openapi-ts/integrations
4646
linkText: Find out more

docs/openapi-ts/get-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Launch demo
2929
- generates TypeScript interfaces and SDKs
3030
- Fetch API, Axios, Nuxt, Angular, Node.js, and XHR clients available
3131
- plugin ecosystem to reduce third-party boilerplate
32+
- [platform](https://heyapi.dev/openapi-ts/integrations) for automating codegen builds
3233

3334
## Quick Start
3435

docs/openapi-ts/integrations.md

Lines changed: 166 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,38 @@
11
---
2-
title: Integrations
3-
description: Automate your client generation.
2+
title: Hey API Platform
3+
description: Automate your client generation with our OpenAPI specifications storage.
44
---
55

6-
# Integrations <span data-soon>Soon</span>
6+
# Hey API Platform
77

88
::: warning
9-
GitHub integration is not publicly available yet. We are gathering feedback from beta testers to ensure the final product meets our quality standards. To express your interest in joining the beta test, please open an issue on [GitHub](https://github.com/hey-api/upload-openapi-spec/issues).
9+
This feature is in development! :tada: Try it out and provide feedback on [GitHub](https://github.com/orgs/hey-api/discussions/1773).
1010
:::
1111

12-
Integrations allow you to automate your client generation workflow. Create dependency links between your clients and APIs, and watch the magic unfold. While we prefer to use `@hey-api/openapi-ts` for generating clients, you can use any codegen.
12+
You can automate your client generation with our platform thanks to reproducible builds. Create dependency links between your clients and APIs, and watch the magic unfold. It's completely language and codegen agnostic.
1313

14-
## Upload OpenAPI Spec
14+
## Features
1515

16-
First, you need to configure your API build workflow to send us OpenAPI specifications. This can be done by adding our [hey-api/upload-openapi-spec](https://github.com/marketplace/actions/upload-openapi-spec-by-hey-api) GitHub Action into your CI workflow.
16+
- API version history
17+
- real-time updates
18+
- reproducible builds
19+
- language and codegen agnostic (TypeScript/Python/Go/Java/etc codegens are welcome)
20+
21+
## Upload Specifications
22+
23+
Before you can generate clients, you must publish your OpenAPI specifications to Hey API.
24+
25+
### Prerequisites
26+
27+
1. Create a **free account** with [Hey API](https://app.heyapi.dev/).
28+
1. Create a new **organization** and **project** for your API provider. We recommend your naming matches your GitHub structure as it will be referenced by API clients. For example, we are using **hey-api/backend** for the platform.
29+
1. Inside your project, go to _Integrations_ > _APIs_ and generate an **API key**. Keep this value secret, it will be used to upload files.
30+
31+
### Add GitHub CI workflow
32+
33+
Once you have your API key, you can start uploading OpenAPI specifications on every API build. We'll use our [GitHub Action](https://github.com/marketplace/actions/upload-openapi-spec-by-hey-api), but you can also make the API call manually if you're not using GitHub.
34+
35+
Create a new GitHub workflow or add an upload step to an existing workflow inside your API codebase. The example below will upload your OpenAPI specification to Hey API on every pull request and push to the `main` branch.
1736

1837
```yaml
1938
name: Upload OpenAPI Specification
@@ -22,6 +41,7 @@ on:
2241
push:
2342
branches:
2443
- main
44+
pull_request:
2545

2646
jobs:
2747
upload-openapi-spec:
@@ -31,14 +51,147 @@ jobs:
3151
uses: actions/checkout@v4
3252

3353
- name: Upload OpenAPI spec
34-
uses: hey-api/upload-openapi-spec@v1
54+
uses: hey-api/upload-openapi-spec@v1.3.0
3555
with:
36-
hey-api-token: ${{ secrets.HEY_API_TOKEN }}
37-
path-to-openapi: path/to/openapi.json
56+
path-to-file: path/to/openapi.json
57+
tags: optional,custom,tags
58+
env:
59+
API_KEY: ${{ secrets.HEY_API_TOKEN }}
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
```
62+
63+
### Inputs
64+
65+
To successfully upload an OpenAPI specification, you need to provide the following inputs (see `with` in the example above)
66+
67+
#### `path-to-file`
68+
69+
A relative path to your OpenAPI file within the repository. Note that you might need an additional step in your GitHub workflow to generate this file (see [FastAPI example](https://fastapi.tiangolo.com/how-to/extending-openapi/#generate-the-openapi-schema)).
70+
71+
#### `tags` (optional)
72+
73+
A comma-separated string value representing any custom tags you wish to add to your OpenAPI specification.
74+
75+
### Environment Variables
76+
77+
In addition to the required `path-to-file` input, you must provide the following environment variables.
78+
79+
#### `API_KEY`
80+
81+
This is the project API key you obtained from [Hey API](https://app.heyapi.dev/).
82+
83+
::: warning
84+
Personal API keys can't be used to upload specifications.
85+
:::
86+
87+
#### `GITHUB_TOKEN`
88+
89+
This variable will be available inside your workflow by default. It's used to
90+
fetch information about your repository, i.e. default branch.
91+
92+
## Generate Clients
93+
94+
You can generate clients from public projects or any private projects you can access. The setup is largely the same, you want to configure the input path used by your codegen.
95+
96+
::: code-group
97+
98+
```sh [Hey API]
99+
npx @hey-api/openapi-ts \
100+
-i https://get.heyapi.dev/hey-api/backend \
101+
-o src/client \
102+
-c @hey-api/client-fetch
103+
```
104+
105+
```sh [OpenAPI TypeScript]
106+
npx openapi-typescript \
107+
https://get.heyapi.dev/hey-api/backend \
108+
-o schema.ts
109+
```
110+
111+
```sh [Orval]
112+
npx orval \
113+
--input https://get.heyapi.dev/hey-api/backend \
114+
--output ./src/client.ts
115+
```
116+
117+
```sh [Other]
118+
other-cli \
119+
--input https://get.heyapi.dev/hey-api/backend \ # [!code ++]
120+
--output refer/to/other/tools/docs
121+
```
122+
123+
:::
124+
125+
By default, we preserve the current behavior and return the latest specification. Let's have a closer look at the input path and change that.
126+
127+
## Get API
128+
129+
As you can deduce from the examples above, the default command for fetching OpenAPI specifications looks like this.
130+
131+
```
132+
https://get.heyapi.dev/<organization>/<project>
133+
```
134+
135+
If you created an organization `foo` with project `bar` earlier, your URL would look like this.
136+
137+
```
138+
https://get.heyapi.dev/foo/bar
139+
```
140+
141+
### Auth
142+
143+
Projects are private by default, you will need to be authenticated to download OpenAPI specifications. We recommend using [project API keys](#prerequisites) in CI workflows and [personal API keys](https://app.heyapi.dev/settings/user/apis) for local development.
144+
145+
Once you have your API key, you can authenticate the request using the `Authorization` header or `api_key` query parameter.
146+
147+
```
148+
https://get.heyapi.dev/foo/bar?api_key=<my_api_key>
149+
```
150+
151+
Congratulations on fetching your first OpenAPI specification! 🎉
152+
153+
### Filters
154+
155+
The default behavior returns the last uploaded specification. This might not be what you want. You can use a range of filters to narrow down the possible specifications, or pin your builds to an exact version.
156+
157+
#### `branch`
158+
159+
You can fetch the last build from branch by providing the `branch` query parameter.
160+
161+
```
162+
https://get.heyapi.dev/foo/bar?branch=production
163+
```
164+
165+
#### `commit_sha`
166+
167+
You can fetch an exact specification by providing the `commit_sha` query parameter. This will always return the same file.
168+
169+
```
170+
https://get.heyapi.dev/foo/bar?commit_sha=0eb34c2024841ce95620f3ec02a2fea164ea4e9d
38171
```
39172
40-
This step requires you to register with us in order to obtain a Hey API token. Please follow the instructions in our [GitHub Action](https://github.com/marketplace/actions/upload-openapi-spec-by-hey-api) to complete the setup. Once you have your APIs configured, you're ready to connect your clients.
173+
#### `tags`
174+
175+
If you're tagging your specifications with [custom tags](#tags-optional), you can use them to filter the results. When you provide multiple tags, only the first match will be returned.
176+
177+
```
178+
https://get.heyapi.dev/foo/bar?tags=optional,custom,tags
179+
```
180+
181+
#### `version`
182+
183+
Every OpenAPI document contains a required version field. You can use this value to fetch the last uploaded specification matching the value.
184+
185+
```
186+
https://get.heyapi.dev/foo/bar?version=1.0.0
187+
```
188+
189+
## Feedback
190+
191+
We'd love your feedback! You can contact us on social media (search Hey API), [email](mailto:[email protected]), or [GitHub](https://github.com/orgs/hey-api/discussions/1773).
192+
193+
## Pricing
41194
42-
## Configure Clients
195+
The platform is currently in beta with our focus being on delivering a great experience. We plan to announce pricing once we have gathered enough data around usage patterns. However, we can guarantee there will always be a free plan available. Our mission to bring the finest tooling for working with APIs remains unchanged.
43196
44-
More information will be provided as we finalize the tooling.
197+
<!--@include: ../sponsors.md-->

packages/client-axios/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
- granular request and response customization options
1616
- minimal learning curve thanks to extending the underlying technology
1717
- support bundling inside the generated output
18+
- [platform](https://heyapi.dev/openapi-ts/integrations) for automating codegen builds
19+
20+
## Platform
21+
22+
Our platform for OpenAPI specifications is now available. Automatically update your code when the APIs it depends on change. [Find out more](https://heyapi.dev/openapi-ts/integrations).
1823

1924
## Documentation
2025

@@ -30,10 +35,6 @@ Love Hey API? Become our [sponsor](https://github.com/sponsors/hey-api).
3035
</a>
3136
</p>
3237

33-
## GitHub Integration (coming soon)
34-
35-
Automatically update your code when the APIs it depends on change. [Find out more](https://heyapi.dev/openapi-ts/integrations.html).
36-
3738
## Migration Guides
3839

39-
[OpenAPI Typescript Codegen](https://heyapi.dev/openapi-ts/migrating.html#openapi-typescript-codegen)
40+
[OpenAPI Typescript Codegen](https://heyapi.dev/openapi-ts/migrating#openapi-typescript-codegen)

packages/client-fetch/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
- granular request and response customization options
1616
- minimal learning curve thanks to extending the underlying technology
1717
- support bundling inside the generated output
18+
- [platform](https://heyapi.dev/openapi-ts/integrations) for automating codegen builds
19+
20+
## Platform
21+
22+
Our platform for OpenAPI specifications is now available. Automatically update your code when the APIs it depends on change. [Find out more](https://heyapi.dev/openapi-ts/integrations).
1823

1924
## Documentation
2025

@@ -30,10 +35,6 @@ Love Hey API? Become our [sponsor](https://github.com/sponsors/hey-api).
3035
</a>
3136
</p>
3237

33-
## GitHub Integration (coming soon)
34-
35-
Automatically update your code when the APIs it depends on change. [Find out more](https://heyapi.dev/openapi-ts/integrations.html).
36-
3738
## Migration Guides
3839

39-
[OpenAPI Typescript Codegen](https://heyapi.dev/openapi-ts/migrating.html#openapi-typescript-codegen)
40+
[OpenAPI Typescript Codegen](https://heyapi.dev/openapi-ts/migrating#openapi-typescript-codegen)

packages/client-next/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
- granular request and response customization options
1717
- minimal learning curve thanks to extending the underlying technology
1818
- support bundling inside the generated output
19+
- [platform](https://heyapi.dev/openapi-ts/integrations) for automating codegen builds
20+
21+
## Platform
22+
23+
Our platform for OpenAPI specifications is now available. Automatically update your code when the APIs it depends on change. [Find out more](https://heyapi.dev/openapi-ts/integrations).
1924

2025
## Documentation
2126

@@ -31,10 +36,6 @@ Love Hey API? Become our [sponsor](https://github.com/sponsors/hey-api).
3136
</a>
3237
</p>
3338

34-
## GitHub Integration (coming soon)
35-
36-
Automatically update your code when the APIs it depends on change. [Find out more](https://heyapi.dev/openapi-ts/integrations.html).
37-
3839
## Migration Guides
3940

40-
[OpenAPI Typescript Codegen](https://heyapi.dev/openapi-ts/migrating.html#openapi-typescript-codegen)
41+
[OpenAPI Typescript Codegen](https://heyapi.dev/openapi-ts/migrating#openapi-typescript-codegen)

packages/client-nuxt/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
- granular request and response customization options
1717
- minimal learning curve thanks to extending the underlying technology
1818
- support bundling inside the generated output
19+
- [platform](https://heyapi.dev/openapi-ts/integrations) for automating codegen builds
20+
21+
## Platform
22+
23+
Our platform for OpenAPI specifications is now available. Automatically update your code when the APIs it depends on change. [Find out more](https://heyapi.dev/openapi-ts/integrations).
1924

2025
## Documentation
2126

@@ -31,10 +36,6 @@ Love Hey API? Become our [sponsor](https://github.com/sponsors/hey-api).
3136
</a>
3237
</p>
3338

34-
## GitHub Integration (coming soon)
35-
36-
Automatically update your code when the APIs it depends on change. [Find out more](https://heyapi.dev/openapi-ts/integrations.html).
37-
3839
## Migration Guides
3940

40-
[OpenAPI Typescript Codegen](https://heyapi.dev/openapi-ts/migrating.html#openapi-typescript-codegen)
41+
[OpenAPI Typescript Codegen](https://heyapi.dev/openapi-ts/migrating#openapi-typescript-codegen)

0 commit comments

Comments
 (0)