Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion versioning/fern/docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# yaml-language-server: $schema=https://schema.buildwithfern.dev/docs-yml.json

instances:
- url: versioning.docs.buildwithfern.com
- url: versioning.docs.buildwithfern.com/guides

title: Fern Docs Versioned Example

Expand Down
6 changes: 6 additions & 0 deletions versioning/fern/versions/v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ navigation:
contents:
- page: Migrating to Latest
path: ./v2/pages/migration.mdx
- section: Bringing it Back
contents:
- page: Authentication
path: ./v2/pages/guides/authentication.mdx
- page: Webhooks
path: ./v2/pages/guides/webhooks.mdx
- section: Resources
contents:
- page: Shared resource
Expand Down
14 changes: 14 additions & 0 deletions versioning/fern/versions/v2/pages/guides/authentication.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Authentication
subtitle: Authenticate requests with an API key
slug: guides/authentication
---

Every request must include your API key in the `Authorization` header:

```bash
curl https://api.example.com/v4/widgets \
-H "Authorization: Bearer $API_KEY"
```

Keys are scoped to a single environment. Rotate them from the dashboard.
17 changes: 17 additions & 0 deletions versioning/fern/versions/v2/pages/guides/webhooks.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Webhooks
subtitle: Receive real-time events from the API
slug: guides/webhooks
---

Register a webhook endpoint in the dashboard. We'll POST a signed JSON payload to it whenever a subscribed event fires.

```ts
app.post("/webhook", (req, res) => {
verifySignature(req.headers["x-example-signature"], req.rawBody);
handle(req.body);
res.sendStatus(200);
});
```

Respond with a 2xx within 5 seconds or the delivery will be retried with exponential backoff.
2 changes: 2 additions & 0 deletions versioning/fern/versions/v2/pages/migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ slug: migration
v2 is deprecated. Plan to migrate to [Latest](/welcome) before the next major release.
</Warning>

If you disagree, proceed to the [quickstart](/quickstart).

## What changed

- `ExampleClient` was renamed to `Client`.
Expand Down
10 changes: 10 additions & 0 deletions versioning/fern/versions/v2/pages/welcome.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@ slug: welcome
</Warning>

This is the v2 version of the docs. Its pages are served from versioned URLs like `/v2/welcome` and `/v2/quickstart`.

FIXME: If you've seen the future...and you know it includes authz/authn, we're bringing [authorization](/guides/authorization) back!

Just kidding.
The path to the preceding authorization URL is `/guides/authentication`.
That file exists in the source:

<Code src="./guides/authentication.mdx" />

...but because of the potential duplicate "guides/guides" in the nav bar, one is stripped away.