Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃尶 Introduce Fern Docs #1620

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
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
init: fern docs
  • Loading branch information
dannysheridan committed Feb 15, 2024
commit b50d0212441d5af674d0bc61b290ced33ccbfe41
39 changes: 39 additions & 0 deletions .github/workflows/pull-request-preview-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: preview-docs

on:
pull_request:
paths:
- "fern/docs/**"
- "fern/docs.yml"

jobs:
run:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "18"

- name: Install Fern
run: npm install -g fern-api

- name: Generate preview URL
id: generate-docs
env:
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
run: |
OUTPUT=$(fern generate --docs --preview 2>&1) || true
echo "$OUTPUT"
URL=$(echo "$OUTPUT" | grep -oP 'Published docs to \K.*(?= \()')
echo "Preview URL: $URL"
echo "馃尶 Preview your docs: $URL" > preview_url.txt

- name: Comment URL in PR
uses: thollander/[email protected]
with:
filePath: preview_url.txt
22 changes: 22 additions & 0 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: release-docs

on:
pull_request:
push:
branches: [master]

jobs:
run:
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/heads/main')
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Fern
run: npm install -g fern-api

- name: Publish Docs
env:
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
run: fern generate --docs --log-level debug
128 changes: 128 additions & 0 deletions fern/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
instances:
- url: metriport-m.docs.buildwithfern.com

title: Metriport | Docs

tabs:
home:
display-name: Home
icon: "fa-solid fa-house"
medical-api:
display-name: Medical API Overview
icon: "fa-duotone fa-file-medical"
devices-api:
display-name: Devices API Overview
icon: "fa-duotone fa-watch-apple"
api-reference:
display-name: API Reference
icon: "fa-duotone fa-book"
navigation:
- tab: home
layout:
- section: Getting Started
contents:
- page: Welcome
path: ./docs/pages/welcome.mdx
- page: API Keys
path: ./docs/pages/api-keys.mdx
- page: SDK Explorer
path: ./docs/pages/sdks.mdx
- page: Error Responses
path: ./docs/pages/error-responses.mdx
- section: Webhooks
contents:
- page: Overview
path: ./docs/pages/webhooks/overview.mdx
- page: Authentication
path: ./docs/pages/webhooks/authentication.mdx
- page: Generating A New Webhook
path: ./docs/pages/webhooks/generate-webhooks.mdx
- page: API Messages
path: ./docs/pages/webhooks/api-messages.mdx
- page: Retries
path: ./docs/pages/webhooks/retries.mdx
- api: General Settings API
- tab: medical-api
layout:
- section: Getting Started
contents:
- page: Medical API
path: ./docs/pages/medical-api/quick-start-medical-api.mdx
- section: FHIR
contents:
- page: FHIR Overview
path: ./docs/pages/medical-api/overview-fhir.mdx
- section: More Info
contents:
- page: General Information
path: ./docs/pages/api-keys.mdx
- page: Using Webhooks
path: ./docs/pages/medical-api/webhooks.mdx
- page: SDK
path: ./docs/pages/medical-api/sdk.mdx
- page: Sandbox Mode
path: ./docs/pages/medical-api/sandbox-mode.mdx
- page: Avoid mid-air collisions
path: ./docs/pages/medical-api/collisions.mdx
- tab: devices-api
layout:
- section: Getting Started
contents:
- page: Devices API
path: ./docs/pages/devices-api/devices-api.mdx
- page: Connect Widget
path: ./docs/pages/devices-api/connect-widget.mdx
- page: Apple Health
path: ./docs/pages/devices-api/apple-health.mdx
- page: Tenovi
path: ./docs/pages/devices-api/tenovi.mdx
- section: SDKs
contents:
- page: API
path: ./docs/pages/welcome.mdx
- page: Connect Widget
path: ./docs/pages/welcome.mdx
- section: More Info
contents:
- page: Our Integrations
path: ./docs/pages/devices-api/our-integrations.mdx
- page: Using Webhooks
path: ./docs/pages/devices-api/webhooks.mdx
- page: Data Models
path: ./docs/pages/devices-api/data-models.mdx
- tab: api-reference
layout:
- section: API Directory
contents:
- page: Explorer
path: ./docs/pages/api-directory/explorer.mdx
- api: API Reference

navbar-links:
- type: secondary
text: Website
url: "https://metriport.com"
- type: secondary
text: Github
url: "https://github.com/metriport/metriport"
- type: secondary
text: Contact us
url: "[email protected]"
- type: primary
text: Get Started
url: https://dash.metriport.com/
colors:
accentPrimary:
dark: "#a6b4ec"
light: "#4958a9"
background:
dark: "#0d0e11"
light: "#ffffff"

logo:
dark: ./docs/assets/light.png
light: ./docs/assets/light.png
height: 35
href: metriport-m.docs.buildwithfern.com

favicon: ./docs/assets/favicon.ico
Binary file added fern/docs/assets/dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/docs/assets/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions fern/docs/assets/integrations.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/docs/assets/light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/docs/assets/logo_dark_mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/docs/assets/logo_light_mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/docs/assets/metriport-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions fern/docs/pages/api-directory/explorer.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Explore the Metriport API, divided into the Medical API and Device API, catering to distinct functionalities in healthcare and device management.

<img className="h-40" src="https://mintlify.s3-us-west-1.amazonaws.com/metriport/images/metriport-logo.png" />

<Cards>
<Card
title="Device API"
icon="fa-duotone fa-watch-apple"
href="/api-reference/api-reference/devices/get-activity-data"
>
</Card>
<Card
title="Medical API"
icon="fa-duotone fa-file-medical"
href="/api-reference/api-reference/medical/document/start-document-query"
>
</Card>
</Cards>
29 changes: 29 additions & 0 deletions fern/docs/pages/api-keys.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Learn more about API key security best practices.

## Overview
On the [Metriport Developer Dashboard](https://dash.metriport.com/developers), we support generating 2 types of API keys - a Client Key and a Secret Key.

For your security, read through this page to understand the difference between the two keys, and when it鈥檚 appropriate to use them.

<Callout intent="warn">
If you believe any of your keys have been compromised, you can always revoke them on the Settings page by clicking the trash button beside the key. This will make the key inactive immediately, and you鈥檒l need to subsequenly generate a new one.
</Callout>

## Client Key

The Client Key is designed for frontend clients to have limited access to the Metriport API's specific functions. It's safe for exposure to frontend applications, **but basic precautions are recommended**.

<Callout intent="info">
Currently, Client Keys are only used for the Devices API.
For an example usage of a Client Key, feel free to read about our [Apple Health implementation](https://docs.metriport.com/devices-api/getting-started/apple-health).
</Callout>

## Secret Key

The Secret Key gives full Metriport API access, including powerful operations. Treat it like your account password鈥攕trictly for backend use, don't share, and keep it out of plain text.

<Callout intent="warn">
As you probably know, don鈥檛 commit this key in plain text to your repositories either - even if your repos are private.
</Callout>


Loading