You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: integrations/sdks/speakeasy.mdx
+57-70Lines changed: 57 additions & 70 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,95 +3,82 @@ title: Speakeasy
3
3
description: Automate your SDK usage snippets in the API playground
4
4
---
5
5
6
-
You can integrate Speakeasy-generated code snippets from your SDKs directly into your Mintlify API reference documentation. SDK usage snippets are shown in the [interactive playground](https://mintlify.com/docs/api-playground/overview) of your Mintlify-powered documentation.
6
+
Autogenerated code snippets from Speakeasy SDKs can be integrated directly into Mintlify API reference documentation. SDK usage snippets are shown in the [interactive playground](https://mintlify.com/docs/api-playground/overview) of Mintlify-powered documentation sites.
7
7
8
-
## Speakeasy SDK Repository Changes
8
+
<Screenshoturl="docs.myapi.com"docs={true}>
9
+

11
+
</Screenshot>
9
12
10
-
In your Speakeasy SDK repos, add the following to the `targets` section of your `.speakeasy/workflow.yaml` file to ensure code samples are automatically produced alongside SDK generations.
13
+
## Prerequisites
11
14
12
-
```yaml .speakeasy/workflow.yaml
13
-
targets:
14
-
my-target:
15
-
target: typescript
16
-
source: my-source
17
-
codeSamples:
18
-
output: codeSamples.yaml
19
-
```
15
+
To integrate Mintlify with Speakeasy, you'll need the following:
20
16
21
-
Code samples will be generated in the form of an [OpenAPI overlay file](https://www.speakeasyapi.dev/openapi/overlays) that will be used in the Mintlify docs repository.
17
+
- A [Mintlify documentation repository](https://mintlify.com/docs/quickstart#creating-the-repository).
18
+
- A Speakeasy-generated SDK with a configured [automated code sample URL](https://www.speakeasy.com/docs/code-samples/automated-code-sample-urls).
22
19
23
-
## Mintlify Docs Repository Changes
20
+
## Setting up the integration
24
21
25
-
The workflow files produced will automatically bundle your source OpenAPI spec and Speakeasy code samples into a single output file, `openapi.yaml`. Mintlify will use this output file when constructing your API reference.
22
+
### Get the API's combined spec public URL from the registry
26
23
27
-
### Interactive CLI Set Up
24
+
Navigate to the [Speakeasy Dashboard](https://app.speakeasy.com) and open the **API Registry** tab. Open the `*-with-code-samples` entry for the API.
28
25
29
-
Run the following commands to set up the `.speakeasy/workflow.yaml` and `.github/workflows/sdk_generation.yaml` files through the interactive Speakeasy CLI.
Set up your source spec. The source spec is the OpenAPI spec that code samples will be generated for, and it's often the same specification used to power Mintlify docs.
35
+
From the registry entry's page, copy the provided public URL.
37
36
38
-

37
+
<Screenshotdarkeneddocs={true}>
38
+

40
+
</Screenshot>
39
41
40
-
Add the overlay created by Speakeasy to inject code snippets into your spec.
41
42
42
-

43
+
### Update the `mint.json` configuration file
43
44
44
-
Provide a name and path for the OpenAPI spec. This will be the final spec used by Mintlify.
45
+
Add the combined spec URL to **Anchors** or **Tabs** in the `mint.json` file of a Mintlify repository. Anchors are displayed as a list of links on the left side of the documentation, while Tabs are displayed as tabs along the top of the documentation.
45
46
46
-

47
+
Add the combined spec URL to **Anchors** by updating the `anchor` field in the `mint.json` file as follows:
47
48
48
-
Finally, Add your `SPEAKEASY_API_KEY` as a repository secret to your Minlify repo under `Settings > Secrets & Variables > Actions`. Find the Speakeasy API key in the Speakeasy dashboard under the **API Keys** tab.
49
+
```json mint.json
50
+
{
51
+
"anchors": [
52
+
{
53
+
"name": "API Reference",
54
+
// !mark
55
+
"openapi": "SPEAKEASY_COMBINED_SPEC_URL",
56
+
"url": "api-reference",
57
+
"icon": "square-terminal"
58
+
}
59
+
]
60
+
}
61
+
```
49
62
50
-
## Manual Set Up
63
+
Add the combined spec URL to **Tabs** by updating the `tab` field in the `mint.json` file as follows:
64
+
65
+
```json mint.json
66
+
{
67
+
"tabs": [
68
+
{
69
+
"name": "API Reference",
70
+
"url": "api-reference",
71
+
// !mark
72
+
"openapi": "SPEAKEASY_COMBINED_SPEC_URL"
73
+
}
74
+
]
75
+
}
76
+
```
51
77
52
-
Alternatively, you can manually set up the following files in your Mintlify docs repo.
78
+
Speakeasy-generated code snippets can now be viewed in the Mintlify API reference documentation. See the code snippets in action in the [interactive playground](https://mintlify.com/docs/api-playground/overview) of the Mintlify-powered documentation site.
53
79
80
+
## Next steps
54
81
55
-
```yaml .speakeasy/workflow.yaml
56
-
workflowVersion: 1.0.0
57
-
sources:
58
-
docs-source:
59
-
inputs:
60
-
- location: {{your_api_spec}} # local or remote references supported
Mintlify offers flexible customization options for API references generated from OpenAPI documents. For more information, refer to the [Mintlify documentation](https://mintlify.com/docs/api-playground/openapi/setup).
Finally, make sure you add your `SPEAKEASY_API_KEY` as a repository secret to your Minlify repo under `Settings > Secrets & Variables > Actions`. Find the Speakeasy API key in the Speakeasy dashboard under the **API Keys** tab.
0 commit comments