Skip to content
Merged
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Finder (MacOS) folder config
.DS_Store

# VitePress
docs/.vitepress/dist
docs/.vitepress/cache
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"cSpell.words": [
"bunx",
"konstantin",
"kriasoft",
"modelcontextprotocol",
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,9 @@ bun test
# Build
bun run build

# Run documentation locally
bun run docs:dev # Start VitePress dev server at http://localhost:5173

# Run examples
bun run example:demo # Interactive demo
bun run example:github # GitHub OAuth example
Expand Down
611 changes: 610 additions & 1 deletion bun.lock

Large diffs are not rendered by default.

82 changes: 82 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/* SPDX-FileCopyrightText: 2025-present Kriasoft */
/* SPDX-License-Identifier: MIT */

import { withMermaid } from "vitepress-plugin-mermaid";

// https://vitepress.dev/reference/site-config
export default withMermaid({
base: "/oauth-callback/",
title: "🔐 \u00A0OAuth Callback",
description:
"OAuth 2.0 callback handler for CLI tools & desktop apps. Cross-runtime (Node.js/Deno/Bun), MCP SDK integration, minimal deps, TypeScript-first.",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: "Guide", link: "/getting-started" },
{ text: "API", link: "/api/get-auth-code" },
{ text: "Examples", link: "/examples/notion" },
{
text: "v1.2.0",
items: [
{
text: "Release Notes",
link: "https://github.com/kriasoft/oauth-callback/releases",
},
{
text: "npm",
link: "https://www.npmjs.com/package/oauth-callback",
},
],
},
],

sidebar: [
{
text: "Introduction",
items: [
{ text: "What is OAuth Callback?", link: "/what-is-oauth-callback" },
{ text: "Getting Started", link: "/getting-started" },
{ text: "Core Concepts", link: "/core-concepts" },
],
},
{
text: "API Reference",
items: [
{ text: "getAuthCode", link: "/api/get-auth-code" },
{ text: "browserAuth", link: "/api/browser-auth" },
{ text: "Storage Providers", link: "/api/storage-providers" },
{ text: "OAuthError", link: "/api/oauth-error" },
{ text: "TypeScript Types", link: "/api/types" },
],
},
{
text: "Examples",
items: [
{ text: "Notion MCP", link: "/examples/notion" },
{ text: "Linear MCP", link: "/examples/linear" },
],
},
],

search: {
provider: "local",
},

editLink: {
pattern:
"https://github.com/kriasoft/oauth-callback/edit/main/docs/:path",
text: "Edit this page on GitHub",
},

socialLinks: [
{ icon: "github", link: "https://github.com/kriasoft/oauth-callback" },
{ icon: "npm", link: "https://www.npmjs.com/package/oauth-callback" },
{ icon: "discord", link: "https://discord.gg/bSsv7XM" },
],

footer: {
message: "Released under the MIT License.",
copyright: "Copyright © 2025-present Konstantin Tarkus",
},
},
});
55 changes: 55 additions & 0 deletions docs/api-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
outline: deep
---

# Runtime API Examples

This page demonstrates usage of some of the runtime APIs provided by VitePress.

The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:

```md
<script setup>
import { useData } from 'vitepress'

const { theme, page, frontmatter } = useData()
</script>

## Results

### Theme Data

<pre>{{ theme }}</pre>

### Page Data

<pre>{{ page }}</pre>

### Page Frontmatter

<pre>{{ frontmatter }}</pre>
```

<script setup>
import { useData } from 'vitepress'

const { site, theme, page, frontmatter } = useData()
</script>

## Results

### Theme Data

<pre>{{ theme }}</pre>

### Page Data

<pre>{{ page }}</pre>

### Page Frontmatter

<pre>{{ frontmatter }}</pre>

## More

Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
Loading
Loading