Skip to content

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>

Results

Theme Data

{
  "nav": [
    {
      "text": "ホーム",
      "link": "/"
    },
    {
      "text": "AI",
      "link": "/ai/"
    },
    {
      "text": "Ruby",
      "items": [
        {
          "text": "1. Ruby基礎",
          "link": "/ruby/#_1-ruby%E5%9F%BA%E7%A4%8E"
        },
        {
          "text": "2. Ruby応用",
          "link": "/ruby/#_2-ruby%E5%BF%9C%E7%94%A8"
        },
        {
          "text": "3. Rubyエコシステム",
          "link": "/ruby/#_3-ruby%E3%82%A8%E3%82%B3%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0"
        },
        {
          "text": "4. 発展トピック",
          "link": "/ruby/#_4-ruby%E7%99%BA%E5%B1%95%E3%83%88%E3%83%94%E3%83%83%E3%82%AF"
        },
        {
          "text": "5. 実践・その他",
          "link": "/ruby/#_5-%E5%AE%9F%E8%B7%B5-%E3%81%9D%E3%81%AE%E4%BB%96"
        }
      ]
    },
    {
      "text": "Rails",
      "items": [
        {
          "text": "1. Rails基礎",
          "link": "/rails/#_1-rails%E5%9F%BA%E7%A4%8E"
        },
        {
          "text": "2. Active Record / データベース",
          "link": "/rails/#_2-active-record-%E3%83%86%E3%82%99%E3%83%BC%E3%82%BF%E3%83%98%E3%82%99%E3%83%BC%E3%82%B9"
        },
        {
          "text": "3. View / フロントエンド",
          "link": "/rails/#_3-view-%E3%83%95%E3%83%AD%E3%83%B3%E3%83%88%E3%82%A8%E3%83%B3%E3%83%88%E3%82%99"
        },
        {
          "text": "4. Controller / ルーティング",
          "link": "/rails/#_4-controller-%E3%83%AB%E3%83%BC%E3%83%86%E3%82%A3%E3%83%B3%E3%82%AF%E3%82%99"
        },
        {
          "text": "5. テスト",
          "link": "/rails/#_5-%E3%83%86%E3%82%B9%E3%83%88"
        },
        {
          "text": "6. パフォーマンス",
          "link": "/rails/#_6-%E3%83%8F%E3%82%9A%E3%83%95%E3%82%A9%E3%83%BC%E3%83%9E%E3%83%B3%E3%82%B9"
        },
        {
          "text": "7. アーキテクチャ / 設計",
          "link": "/rails/#_7-%E3%82%A2%E3%83%BC%E3%82%AD%E3%83%86%E3%82%AF%E3%83%81%E3%83%A3-%E8%A8%AD%E8%A8%88"
        },
        {
          "text": "8. デプロイ / DevOps",
          "link": "/rails/#_8-%E3%83%86%E3%82%99%E3%83%95%E3%82%9A%E3%83%AD%E3%82%A4-devops"
        },
        {
          "text": "9. API",
          "link": "/rails/#_9-api"
        },
        {
          "text": "10. セキュリティ",
          "link": "/rails/#_10-%E3%82%BB%E3%82%AD%E3%83%A5%E3%83%AA%E3%83%86%E3%82%A3"
        },
        {
          "text": "11. バックグラウンドジョブ",
          "link": "/rails/#_11-%E3%83%8F%E3%82%99%E3%83%83%E3%82%AF%E3%82%AF%E3%82%99%E3%83%A9%E3%82%A6%E3%83%B3%E3%83%88%E3%82%99%E3%82%B7%E3%82%99%E3%83%A7%E3%83%95%E3%82%99"
        },
        {
          "text": "12. Gem / ライブラリ",
          "link": "/rails/#_12-gem-%E3%83%A9%E3%82%A4%E3%83%95%E3%82%99%E3%83%A9%E3%83%AA"
        },
        {
          "text": "13. その他",
          "link": "/rails/#_13-%E3%81%9D%E3%81%AE%E4%BB%96"
        }
      ]
    },
    {
      "text": "TypeScript",
      "items": [
        {
          "text": "1. TypeScript基礎",
          "link": "/typescript/#_1-typescript%E5%9F%BA%E7%A4%8E"
        },
        {
          "text": "2. TypeScript発展",
          "link": "/typescript/#_2-typescript%E7%99%BA%E5%B1%95"
        },
        {
          "text": "3. TypeScriptエコシステム",
          "link": "/typescript/#_3-typescript%E3%82%A8%E3%82%B3%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0"
        },
        {
          "text": "4. フレームワークとの連携",
          "link": "/typescript/#_4-%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%E3%83%AF%E3%83%BC%E3%82%AF%E3%81%A8%E3%81%AE%E9%80%A3%E6%90%BA"
        },
        {
          "text": "5. 開発ツールと効率化",
          "link": "/typescript/#_5-%E9%96%8B%E7%99%BA%E3%83%84%E3%83%BC%E3%83%AB%E3%81%A8%E5%8A%B9%E7%8E%87%E5%8C%96"
        },
        {
          "text": "6. 実践・応用例",
          "link": "/typescript/#_6-%E5%AE%9F%E8%B7%B5-%E5%BF%9C%E7%94%A8%E4%BE%8B"
        }
      ]
    },
    {
      "text": "GraphQL",
      "link": "/graphql/"
    },
    {
      "text": "インフラ",
      "link": "/infrastructure/"
    }
  ],
  "socialLinks": [
    {
      "icon": "github",
      "link": "https://github.com/okdyy75/ai-techblog"
    }
  ],
  "footer": {
    "message": "AI が自動生成した技術記事をまとめたテックブログ",
    "copyright": "Copyright © 2024 okdyy75"
  },
  "search": {
    "provider": "local"
  },
  "sidebar": [
    {
      "text": "AI関連記事",
      "link": "/ai/index.md",
      "items": [
        {
          "text": "プロンプトエンジニアリング入門",
          "link": "/ai/01-prompt-engineering-basics"
        },
        {
          "text": "RAG(Retrieval Augmented Generation)の仕組みと活用法",
          "link": "/ai/02-rag-mechanism-and-utilization"
        },
        {
          "text": "ファインチューニングによるLLMのカスタマイズ",
          "link": "/ai/03-fine-tuning-llm-customization"
        },
        {
          "text": "主要LLM(GPT、Gemini、Claude)の比較",
          "link": "/ai/04-major-llm-comparison"
        },
        {
          "text": "生成AIのビジネス活用事例",
          "link": "/ai/05-generative-ai-business-cases"
        },
        {
          "text": "実践・機械学習モデルのデプロイ戦略:Docker, Kubernetes, そしてサーバーレス",
          "link": "/ai/06-ml-model-deployment-strategies"
        },
        {
          "text": "大規模言語モデル(LLM)のファインチューニング入門:Hugging Face Transformersを使った実践ガイド",
          "link": "/ai/07-llm-fine-tuning-with-hugging-face"
        },
        {
          "text": "AIアプリケーションにおけるベクトルデータベースの活用法:類似検索とRAGの実現",
          "link": "/ai/08-vector-db-for-ai-applications"
        },
        {
          "text": "PyTorch vs. TensorFlow:2024年版 詳細比較とユースケース別使い分け",
          "link": "/ai/09-pytorch-vs-tensorflow-2024"
        },
        {
          "text": "AIコードアシスタントを使いこなす:GitHub Copilotとその他ツールの比較、及びチーム導入のベストプラクティス",
          "link": "/ai/10-mastering-ai-code-assistants"
        },
        {
          "text": "Gemini完全ガイド:Googleの最新AIモデルの全貌",
          "link": "/ai/11-gemini-comprehensive-guide"
        },
        {
          "text": "Grok完全ガイド:xAIの革新的AIモデルの全貌",
          "link": "/ai/12-grok-comprehensive-guide"
        },
        {
          "text": "ChatGPT完全ガイド:OpenAIの革新的AIモデルの全貌",
          "link": "/ai/13-chatgpt-comprehensive-guide"
        },
        {
          "text": "Claude完全ガイド:Anthropicの革新的AIモデルの全貌",
          "link": "/ai/14-claude-comprehensive-guide"
        }
      ],
      "collapsed": true
    },
    {
      "text": "GraphQL チュートリアル",
      "link": "/graphql/index.md",
      "items": [
        {
          "text": "【第1回】GraphQL入門   RESTとの違いと基本概念を完全解説",
          "link": "/graphql/01-introduction"
        },
        {
          "text": "【第2回】実践!Node.jsとApollo ServerでGraphQLサーバーを構築しよう",
          "link": "/graphql/02-server-setup"
        },
        {
          "text": "【第3回】GraphQLのスキーマを徹底解説!型、リゾルバ、モックサーバー",
          "link": "/graphql/03-schema-and-resolvers"
        },
        {
          "text": "【第4回】React/Apollo ClientでGraphQL APIを叩く!フロントエンド実装入門",
          "link": "/graphql/04-frontend-integration"
        },
        {
          "text": "【第5回】GraphQLの実践的テクニック   ページネーション、キャッシュ、認証",
          "link": "/graphql/05-advanced-techniques"
        },
        {
          "text": "【第6回】GraphQLのパフォーマンス最適化   N+1問題とDataLoaderの活用",
          "link": "/graphql/06-performance-optimization"
        },
        {
          "text": "【第7回】GraphQL Subscriptionでリアルタイム機能を実装する",
          "link": "/graphql/07-subscriptions"
        },
        {
          "text": "【第8回】GraphQLのテスト戦略   スキーマとリゾルバの効果的なテスト手法",
          "link": "/graphql/08-testing-strategies"
        },
        {
          "text": "【第9回】GraphQLのセキュリティとベストプラクティス   脆弱性対策と安全な運用",
          "link": "/graphql/09-security-best-practices"
        },
        {
          "text": "【第10回】GraphQLの運用・監視・デバッグ   本番環境での実践的な管理手法",
          "link": "/graphql/10-operations-monitoring"
        }
      ],
      "collapsed": true
    },
    {
      "text": "クラウドインフラ技術記事",
      "link": "/infrastructure/index.md",
      "items": [
        {
          "text": "Gcp",
          "items": [
            {
              "text": "GCP上級者向け:高度なサービスとアーキテクチャ",
              "link": "/infrastructure/gcp/gcp-advanced"
            },
            {
              "text": "Google Cloud Platform基礎知識:クラウドインフラの入門",
              "link": "/infrastructure/gcp/gcp-basics"
            },
            {
              "text": "GCPエンタープライズ:大規模システムとベストプラクティス",
              "link": "/infrastructure/gcp/gcp-enterprise"
            }
          ],
          "collapsed": true
        },
        {
          "text": "Heroku",
          "items": [
            {
              "text": "Heroku上級者向け:高度な機能とベストプラクティス",
              "link": "/infrastructure/heroku/heroku-advanced"
            },
            {
              "text": "Heroku基礎知識:クラウドプラットフォームの入門",
              "link": "/infrastructure/heroku/heroku-basics"
            },
            {
              "text": "Heroku移行戦略:他のプラットフォームへの移行と代替案",
              "link": "/infrastructure/heroku/heroku-migration"
            }
          ],
          "collapsed": true
        },
        {
          "text": "Vercel",
          "items": [
            {
              "text": "Vercel上級者向け:高度な機能とパフォーマンス最適化",
              "link": "/infrastructure/vercel/vercel-advanced"
            },
            {
              "text": "Vercel基礎知識:JAMstackとフロントエンドデプロイメント",
              "link": "/infrastructure/vercel/vercel-basics"
            },
            {
              "text": "Vercelエンタープライズ:大規模アプリケーションとチーム開発",
              "link": "/infrastructure/vercel/vercel-enterprise"
            }
          ],
          "collapsed": true
        }
      ],
      "collapsed": true
    },
    {
      "text": "Rails技術記事",
      "link": "/rails/index.md",
      "items": [
        {
          "text": "01 rails basics",
          "items": [
            {
              "text": "Rails7対応!rails newから始めるブログアプリケーション開発チュートリアル",
              "link": "/rails/01-rails-basics/01-rails7-blog-tutorial"
            },
            {
              "text": "Scaffoldは一体何をしているのか?生成されるコードを1行ずつ解説",
              "link": "/rails/01-rails-basics/02-scaffold-deep-dive"
            },
            {
              "text": "Rails開発が捗る!rails consoleの便利な使い方10選",
              "link": "/rails/01-rails-basics/06-rails-console-tips"
            },
            {
              "text": "Active Support Concernを活用してモデルのコードをDRYに保つ",
              "link": "/rails/01-rails-basics/12-active-support-concern"
            },
            {
              "text": "Active Storage徹底活用: ローカルとクラウド(S3)へのファイルアップロード",
              "link": "/rails/01-rails-basics/15-active-storage-guide"
            },
            {
              "text": "33. Action Mailer実践ガイド: メール送信とプレビュー、テスト",
              "link": "/rails/01-rails-basics/33-action-mailer-guide"
            },
            {
              "text": "34. Railsアプリケーションの国際化(i18n)対応",
              "link": "/rails/01-rails-basics/34-rails-i18n"
            },
            {
              "text": "36. Railsにおける設定管理: credentials, Figaro, dotenvの比較と実践",
              "link": "/rails/01-rails-basics/36-rails-config-management"
            },
            {
              "text": "Railsのロギング設定をカスタマイズして、本番環境のデバッグを効率化する",
              "link": "/rails/01-rails-basics/62-rails-logging-customize"
            },
            {
              "text": "Rails 8の新機能と変更点を総まとめ: 開発者が知るべきポイント",
              "link": "/rails/01-rails-basics/67-rails8-new-features"
            },
            {
              "text": "Rails初心者のためのMVCアーキテクチャ完全理解ガイド",
              "link": "/rails/01-rails-basics/77-mvc-architecture-guide"
            }
          ],
          "collapsed": true
        },
        {
          "text": "02 active record database",
          "items": [
            {
              "text": "Active Recordの基本: hasmany / belongsto を使って記事とコメント機能を実装する",
              "link": "/rails/02-active-record-database/03-active-record-associations"
            },
            {
              "text": "Active Recordバリデーション入門: よく使う検証とカスタムバリデーションの作り方",
              "link": "/rails/02-active-record-database/05-active-record-validations"
            },
            {
              "text": "ポリモーフィック関連を理解する: いいね機能やコメント機能を複数のモデルに対応させる方法",
              "link": "/rails/02-active-record-database/18-polymorphic-associations"
            },
            {
              "text": "Active Recordのロック機能(Pessimistic/Optimistic Locking)を理解して競合を防ぐ",
              "link": "/rails/02-active-record-database/22-active-record-locking"
            },
            {
              "text": "Active RecordのEnumを使いこなす: 型安全で可読性の高いコードへ",
              "link": "/rails/02-active-record-database/47-active-record-enum"
            },
            {
              "text": "Railsにおけるマルチデータベース接続のセットアップと活用法",
              "link": "/rails/02-active-record-database/48-rails-multi-db"
            },
            {
              "text": "PostgreSQLの高度な機能(JSONB、Window関数など)をRailsで活用する",
              "link": "/rails/02-active-record-database/49-postgresql-advanced"
            },
            {
              "text": "Scenic gemを使ったデータベースビューの管理",
              "link": "/rails/02-active-record-database/50-scenic-gem-guide"
            },
            {
              "text": "Rails 8のSolid Queueで実現するジョブキューの新しいアプローチ",
              "link": "/rails/02-active-record-database/68-solid-queue-rails8"
            },
            {
              "text": "Active Record Encryptionを使った機密データの暗号化",
              "link": "/rails/02-active-record-database/69-active-record-encryption"
            },
            {
              "text": "データベース移行のベストプラクティス: ゼロダウンタイム・デプロイメント",
              "link": "/rails/02-active-record-database/78-zero-downtime-migrations"
            },
            {
              "text": "Rails ActiveRecordとLaravel Eloquentの比較: ORMの思想と実装の違い",
              "link": "/rails/02-active-record-database/91-activerecord-vs-eloquent-comparison"
            },
            {
              "text": "Rails Active RecordとLaravel Eloquentのバリデーション機能比較: 実装方法と特徴の違い",
              "link": "/rails/02-active-record-database/91-rails-laravel-validation-comparison"
            },
            {
              "text": "ORM クエリメソッドの違い:with、has、group、pivotの使い分けと実装比較",
              "link": "/rails/02-active-record-database/91-with-has-group-pivot-differences"
            },
            {
              "text": "Rails Active RecordとLaravel Eloquentのマイグレーション機能比較: スキーマ管理の違いと実装方法",
              "link": "/rails/02-active-record-database/92-rails-laravel-migration-comparison"
            },
            {
              "text": "Rails Active StorageとLaravel Filesystemのファイルアップロード機能比較: 実装方法と特徴の違い",
              "link": "/rails/02-active-record-database/93-rails-laravel-file-upload-comparison"
            }
          ],
          "collapsed": true
        },
        {
          "text": "03 view frontend",
          "items": [
            {
              "text": "Viewの基本: form with を使って安全なフォームを作成する方法",
              "link": "/rails/03-view-frontend/07-rails-form-with"
            },
            {
              "text": "Hotwire(Turbo/Stimulus)で作る、SPAのようなUXを持つ動的アプリケーション",
              "link": "/rails/03-view-frontend/16-hotwire-intro"
            },
            {
              "text": "Action Cableを使ってリアルタイムなチャット機能を実装する",
              "link": "/rails/03-view-frontend/17-action-cable-chat"
            },
            {
              "text": "Rails 7のjsbundling railsを使ってReactやVue.jsをモダンに統合する方法",
              "link": "/rails/03-view-frontend/23-jsbundling-rails-react"
            },
            {
              "text": "32. ViewComponentを使った再利用可能なビューコンポーネント開発",
              "link": "/rails/03-view-frontend/32-view-component"
            },
            {
              "text": "40. Action Text入門: Trix Editorを使ったリッチテキスト編集機能",
              "link": "/rails/03-view-frontend/40-action-text-trix-editor"
            },
            {
              "text": "42. WebpackerからShakapackerへの移行ガイド",
              "link": "/rails/03-view-frontend/42-webpacker-to-shakapacker-migration"
            },
            {
              "text": "46. StimulusReflex入門: Cable readyを使ったリアクティブな体験",
              "link": "/rails/03-view-frontend/46-stimulus-reflex-cable-ready"
            },
            {
              "text": "Propshaftアセットパイプライン入門: Sprocketsからの移行とメリット",
              "link": "/rails/03-view-frontend/54-propshaft-asset-pipeline"
            },
            {
              "text": "Tailwind CSSをRails 7で使うためのモダンなセットアップ",
              "link": "/rails/03-view-frontend/55-tailwind-css-rails7"
            },
            {
              "text": "Import mapsを理解する: JavaScriptの依存関係をシンプルに管理",
              "link": "/rails/03-view-frontend/56-import-maps-guide"
            },
            {
              "text": "Phlexを使った高速なViewレンダリング",
              "link": "/rails/03-view-frontend/66-phlex-fast-views"
            },
            {
              "text": "Rails 8のインライン実行でJavaScriptとCSSの扱いがどう変わるか",
              "link": "/rails/03-view-frontend/70-rails8-inline-execution"
            },
            {
              "text": "Turbo Streamsでリアルタイム更新を実現する高度なテクニック",
              "link": "/rails/03-view-frontend/71-advanced-turbo-streams"
            },
            {
              "text": "Motion UIとTurboを連携させたリッチなUIアニメーション",
              "link": "/rails/03-view-frontend/88-motion-ui-turbo-guide"
            }
          ],
          "collapsed": true
        },
        {
          "text": "04 controller routing",
          "items": [
            {
              "text": "もう怖くない!Railsのルーティング (routes.rb) 完全ガイド",
              "link": "/rails/04-controller-routing/04-rails-routing-guide"
            },
            {
              "text": "Rails 8のコントローラレイヤー改善と新しいレスポンス処理",
              "link": "/rails/04-controller-routing/72-rails8-controller-improvements"
            }
          ],
          "collapsed": true
        },
        {
          "text": "05 testing",
          "items": [
            {
              "text": "Rails標準のテストフレームワーク「Minitest」ではじめるテスト駆動開発(TDD)",
              "link": "/rails/05-testing/13-minitest-tdd-intro"
            },
            {
              "text": "28. RSpecとFactoryBotを使った実践的なテストコードの書き方",
              "link": "/rails/05-testing/28-rspec-factorybot"
            },
            {
              "text": "System Spec(E2Eテスト)をCapybaraで書く実践ガイド",
              "link": "/rails/05-testing/51-capybara-system-spec"
            },
            {
              "text": "テストカバレッジをSimpleCovで計測し、品質を可視化する",
              "link": "/rails/05-testing/52-simplecov-test-coverage"
            },
            {
              "text": "VCRやWebMockを使った外部API連携のテスト戦略",
              "link": "/rails/05-testing/53-vcr-webmock-testing"
            },
            {
              "text": "Rails 8時代のテスト戦略: 新機能を活用したテストの書き方",
              "link": "/rails/05-testing/73-rails8-testing-strategy"
            },
            {
              "text": "RSpec Mocksの高度な使い方: double, spy, stubの活用",
              "link": "/rails/05-testing/87-rspec-mocks-guide"
            }
          ],
          "collapsed": true
        },
        {
          "text": "06 performance",
          "items": [
            {
              "text": "N+1問題はこれで解決!Bullet gemの導入と実践的な使い方",
              "link": "/rails/06-performance/09-n-plus-one-with-bullet"
            },
            {
              "text": "Active Recordクエリの高速化: joins, preload, includes, eager load の違いと使い分け",
              "link": "/rails/06-performance/10-active-record-query-optimization"
            },
            {
              "text": "パフォーマンスチューニング: Railsアプリケーションのボトルネックを特定し、改善する実践テクニック",
              "link": "/rails/06-performance/20-performance-tuning"
            },
            {
              "text": "43. Railsアプリケーションのメモリ使用量を調査・最適化する方法",
              "link": "/rails/06-performance/43-rails-memory-optimization"
            },
            {
              "text": "SentryやNew Relicを使ったエラー監視とパフォーマンスモニタリング",
              "link": "/rails/06-performance/61-sentry-newrelic-monitoring"
            },
            {
              "text": "Rails 8のパフォーマンス改善: ベンチマークから見る実際の効果",
              "link": "/rails/06-performance/74-rails8-performance-improvements"
            },
            {
              "text": "Rack mini profilerによる開発中のパフォーマンス計測",
              "link": "/rails/06-performance/86-rack-mini-profiler-guide"
            }
          ],
          "collapsed": true
        },
        {
          "text": "07 architecture design",
          "items": [
            {
              "text": "サービスクラス(Service Object)を導入してFat Controllerを解消する",
              "link": "/rails/07-architecture-design/08-service-objects-for-fat-controllers"
            },
            {
              "text": "Rails Engineを作成して、再利用可能なコンポーネントを開発する",
              "link": "/rails/07-architecture-design/19-rails-engines"
            },
            {
              "text": "Trailblazerアーキテクチャを導入して大規模Railsアプリケーションを構築する",
              "link": "/rails/07-architecture-design/57-trailblazer-architecture"
            },
            {
              "text": "Railsアプリケーションにおけるマイクロサービス化への道筋",
              "link": "/rails/07-architecture-design/59-rails-microservices"
            },
            {
              "text": "Railsにおけるドメイン駆動設計(DDD)入門",
              "link": "/rails/07-architecture-design/85-rails-ddd-guide"
            }
          ],
          "collapsed": true
        },
        {
          "text": "08 deployment devops",
          "items": [
            {
              "text": "Docker Composeを使ったRails開発環境の構築とメリット",
              "link": "/rails/08-deployment-devops/24-docker-compose-rails-development"
            },
            {
              "text": "Render.comへRailsアプリケーションをデプロイする2025年版ガイド",
              "link": "/rails/08-deployment-devops/26-deploy-rails-to-render"
            },
            {
              "text": "39. RailsアプリケーションのCI/CDパイプラインをGitHub Actionsで構築する",
              "link": "/rails/08-deployment-devops/39-rails-ci-github-actions"
            },
            {
              "text": "Kamal (旧MRSK) を使ったRailsアプリケーションのデプロイ戦略",
              "link": "/rails/08-deployment-devops/60-kamal-deployment"
            },
            {
              "text": "TerraformによるRailsのインフラ管理(IaC)",
              "link": "/rails/08-deployment-devops/84-terraform-rails-guide"
            },
            {
              "text": "HerokuへRailsアプリケーションをデプロイする2025年版ガイド",
              "link": "/rails/08-deployment-devops/86-deploy-rails-to-heroku"
            },
            {
              "text": "VercelでRailsアプリケーションをデプロイする2025年版ガイド",
              "link": "/rails/08-deployment-devops/87-deploy-rails-to-vercel"
            },
            {
              "text": "Google CloudでRailsアプリケーションをデプロイする2025年版ガイド",
              "link": "/rails/08-deployment-devops/88-deploy-rails-to-google-cloud"
            }
          ],
          "collapsed": true
        },
        {
          "text": "09 api",
          "items": [
            {
              "text": "Ruby on RailsのAPIモード",
              "link": "/rails/09-api/08-rails-api-mode"
            },
            {
              "text": "GraphQL APIをgraphql ruby gemで構築する",
              "link": "/rails/09-api/25-graphql-ruby-api"
            },
            {
              "text": "27. Rails APIモード + Next.jsで構築するモダンなWebアプリケーション",
              "link": "/rails/09-api/27-rails-api-nextjs"
            },
            {
              "text": "45. RailsにおけるAPIドキュメントの自動生成 (RSwag/Committee)",
              "link": "/rails/09-api/45-rails-api-documentation"
            },
            {
              "text": "RailsとgRPCによるハイパフォーマンスなマイクロサービス間通信",
              "link": "/rails/09-api/83-rails-grpc-guide"
            }
          ],
          "collapsed": true
        },
        {
          "text": "10 security",
          "items": [
            {
              "text": "Devise gemを使わずに自前で認証機能を実装する",
              "link": "/rails/10-security/14-authentication-from-scratch"
            },
            {
              "text": "30. Railsセキュリティ: OWASP Top 10に基づいた脆弱性対策と実践",
              "link": "/rails/10-security/30-rails-security-owasp"
            },
            {
              "text": "37. Punditを使った認可機能の実装: ポリシーベースのアクセス制御",
              "link": "/rails/10-security/37-pundit-authorization"
            },
            {
              "text": "Rodauth gemを使った柔軟でセキュアな認証システムの構築",
              "link": "/rails/10-security/64-rodauth-authentication"
            },
            {
              "text": "Action Policy: Punditに代わる次世代の認可ライブラリ",
              "link": "/rails/10-security/65-action-policy-authorization"
            },
            {
              "text": "Brakemanによる静的解析での脆弱性診断",
              "link": "/rails/10-security/82-brakeman-guide"
            }
          ],
          "collapsed": true
        },
        {
          "text": "11 background jobs",
          "items": [
            {
              "text": "Sidekiqではじめるバックグラウンドジョブ入門",
              "link": "/rails/11-background-jobs/11-introduction-to-sidekiq"
            },
            {
              "text": "35. Active Job詳解: アダプターの選び方と高度な使い方",
              "link": "/rails/11-background-jobs/35-active-job-guide"
            },
            {
              "text": "RailsとGoodJob: PostgreSQLベースのバックグラウンドジョブプロセッサ",
              "link": "/rails/11-background-jobs/63-goodjob-background-jobs"
            },
            {
              "text": "Sidekiq cronで定期的なジョブをスケジューリングする",
              "link": "/rails/11-background-jobs/81-sidekiq-cron-guide"
            }
          ],
          "collapsed": true
        },
        {
          "text": "12 gems libraries",
          "items": [
            {
              "text": "29. Sorbetを導入してRailsアプリケーションに型を導入する",
              "link": "/rails/12-gems-libraries/29-sorbet-rails"
            },
            {
              "text": "31. RailsとStripe連携: サブスクリプション課金システムを構築する",
              "link": "/rails/12-gems-libraries/31-rails-stripe-subscription"
            },
            {
              "text": "38. Avo/Administrate/Trestle: Rails製管理画面gemの比較と選択",
              "link": "/rails/12-gems-libraries/38-rails-admin-gems-comparison"
            },
            {
              "text": "41. RailsとRedis: キャッシュ、セッションストア、Sidekiqでの活用法",
              "link": "/rails/12-gems-libraries/41-rails-redis-use-cases"
            },
            {
              "text": "44. Ransackを使った高度な検索機能の実装",
              "link": "/rails/12-gems-libraries/44-ransack-advanced-search"
            },
            {
              "text": "Dry rbエコシステム(dry validation, dry structなど)の紹介",
              "link": "/rails/12-gems-libraries/58-dry-rb-ecosystem"
            },
            {
              "text": "Shopify LiquidテンプレートエンジンをRailsで活用する",
              "link": "/rails/12-gems-libraries/75-shopify-liquid-rails"
            },
            {
              "text": "CanCanCanによるシンプルで強力な認可管理",
              "link": "/rails/12-gems-libraries/80-cancancan-guide"
            }
          ],
          "collapsed": true
        },
        {
          "text": "13 others",
          "items": [
            {
              "text": "Rackミドルウェアを自作してリクエスト/レスポンスをカスタマイズする",
              "link": "/rails/13-others/21-custom-rack-middleware"
            },
            {
              "text": "Rails開発者のためのDocker最適化テクニック集",
              "link": "/rails/13-others/76-docker-optimization-rails"
            },
            {
              "text": "I18n tasks gemでRailsの多言語対応を効率化する",
              "link": "/rails/13-others/79-i18n-tasks-guide"
            },
            {
              "text": "Railsアプリケーションにおける設定ファイルのベストプラクティス",
              "link": "/rails/13-others/89-rails-settings-best-practices"
            },
            {
              "text": "RailsにおけるAPIバージョニング戦略",
              "link": "/rails/13-others/90-api-versioning-strategies"
            }
          ],
          "collapsed": true
        }
      ],
      "collapsed": true
    },
    {
      "text": "Ruby技術記事",
      "link": "/ruby/index.md",
      "items": [
        {
          "text": "01 basics",
          "items": [
            {
              "text": "Rubyのパターンマッチング",
              "link": "/ruby/01-basics/01-pattern-matching"
            },
            {
              "text": "Rubyのインストールとバージョン管理",
              "link": "/ruby/01-basics/01-ruby-setup"
            },
            {
              "text": "Rubyの基本構文",
              "link": "/ruby/01-basics/02-ruby-syntax"
            },
            {
              "text": "Rubyのデータ型",
              "link": "/ruby/01-basics/03-ruby-data-types"
            },
            {
              "text": "Rubyの制御構文",
              "link": "/ruby/01-basics/04-ruby-control-flow"
            },
            {
              "text": "Rubyのブロック、Proc、Lambda",
              "link": "/ruby/01-basics/05-ruby-blocks-procs-lambdas"
            },
            {
              "text": "Rubyのクラスとモジュール",
              "link": "/ruby/01-basics/06-ruby-classes-modules"
            },
            {
              "text": "Rubyの例外処理",
              "link": "/ruby/01-basics/07-ruby-exception-handling"
            },
            {
              "text": "Rubyの標準ライブラリ紹介",
              "link": "/ruby/01-basics/08-ruby-standard-library"
            },
            {
              "text": "Rubyの委譲(Delegation)",
              "link": "/ruby/01-basics/09-ruby-delegation"
            },
            {
              "text": "Ruby 3.xの主要な新機能",
              "link": "/ruby/01-basics/31-ruby3-new-features"
            }
          ],
          "collapsed": true
        },
        {
          "text": "02 applications",
          "items": [
            {
              "text": "Ruby製CLIツールの作り方",
              "link": "/ruby/02-applications/03-cli-tool-creation"
            },
            {
              "text": "RubyのSocketプログラミング",
              "link": "/ruby/02-applications/07-socket-programming"
            },
            {
              "text": "Rubyメタプログラミング入門",
              "link": "/ruby/02-applications/09-ruby-metaprogramming"
            },
            {
              "text": "Rubyの並行処理と並列処理",
              "link": "/ruby/02-applications/10-ruby-concurrency"
            },
            {
              "text": "RubyのGem作成と公開方法",
              "link": "/ruby/02-applications/11-ruby-gem-creation"
            },
            {
              "text": "Rackの基礎とミドルウェア",
              "link": "/ruby/02-applications/12-rack-middleware"
            },
            {
              "text": "Rubyにおけるデザインパターン",
              "link": "/ruby/02-applications/13-ruby-design-patterns"
            },
            {
              "text": "Rubyのメモリ管理とガベージコレクション",
              "link": "/ruby/02-applications/14-ruby-memory-management"
            },
            {
              "text": "Rubyにおける関数型プログラミング",
              "link": "/ruby/02-applications/33-ruby-functional-programming"
            },
            {
              "text": "Rubyのパフォーマンスチューニング",
              "link": "/ruby/02-applications/34-ruby-performance-tuning"
            },
            {
              "text": "RubyとC言語連携(拡張ライブラリ作成)",
              "link": "/ruby/02-applications/35-ruby-c-extension"
            },
            {
              "text": "RubyのDSL(ドメイン固有言語)作成法",
              "link": "/ruby/02-applications/39-ruby-dsl-creation"
            }
          ],
          "collapsed": true
        },
        {
          "text": "03 ecosystem",
          "items": [
            {
              "text": "BundlerによるGemの依存関係管理",
              "link": "/ruby/03-ecosystem/15-bundler-gem-management"
            },
            {
              "text": "Rakeタスクの作り方と活用法",
              "link": "/ruby/03-ecosystem/16-rake-tasks"
            },
            {
              "text": "RuboCopを使った静的コード解析",
              "link": "/ruby/03-ecosystem/17-rubocop-static-analysis"
            },
            {
              "text": "Pry/IRBでのデバッグテクニック",
              "link": "/ruby/03-ecosystem/18-debugging-with-pry-irb"
            },
            {
              "text": "MinitestとRSpecの比較と使い方",
              "link": "/ruby/03-ecosystem/19-minitest-vs-rspec"
            },
            {
              "text": "Sinatraで作る軽量Webアプリケーション",
              "link": "/ruby/03-ecosystem/20-sinatra-webapp"
            },
            {
              "text": "RubyでのTDD(テスト駆動開発)実践ガイド",
              "link": "/ruby/03-ecosystem/32-ruby-tdd-guide"
            },
            {
              "text": "Hanamiフレームワーク入門",
              "link": "/ruby/03-ecosystem/36-hanami-framework-intro"
            },
            {
              "text": "RubyによるWebスクレイピング",
              "link": "/ruby/03-ecosystem/37-ruby-web-scraping"
            },
            {
              "text": "Ruby製静的サイトジェネレータ",
              "link": "/ruby/03-ecosystem/38-ruby-static-site-generators"
            }
          ],
          "collapsed": true
        },
        {
          "text": "04 advanced",
          "items": [
            {
              "text": "RBSによる型定義",
              "link": "/ruby/04-advanced/02-rbs-type-definition"
            },
            {
              "text": "Rubyのリフレクション機能",
              "link": "/ruby/04-advanced/06-ruby-reflection"
            },
            {
              "text": "RubyのFiberと非同期処理",
              "link": "/ruby/04-advanced/10-ruby-fiber"
            },
            {
              "text": "Ruby on Railsの基礎",
              "link": "/ruby/04-advanced/21-ruby-on-rails-basics"
            },
            {
              "text": "Active Recordの基礎",
              "link": "/ruby/04-advanced/22-active-record-basics"
            },
            {
              "text": "Railsのルーティング",
              "link": "/ruby/04-advanced/23-rails-routing"
            },
            {
              "text": "Railsのビューとテンプレート",
              "link": "/ruby/04-advanced/24-rails-views-and-templates"
            },
            {
              "text": "Railsのコントローラ",
              "link": "/ruby/04-advanced/25-rails-controllers"
            },
            {
              "text": "Railsのテスト入門",
              "link": "/ruby/04-advanced/26-rails-testing-introduction"
            },
            {
              "text": "Railsのデプロイ戦略",
              "link": "/ruby/04-advanced/27-rails-deployment-strategies"
            },
            {
              "text": "Rubyの非同期処理",
              "link": "/ruby/04-advanced/28-ruby-asynchronous-processing"
            },
            {
              "text": "Sorbetを使ったRubyの型付け",
              "link": "/ruby/04-advanced/29-sorbet-for-ruby-typing"
            },
            {
              "text": "Mruby/CRubyの違い",
              "link": "/ruby/04-advanced/30-mruby-vs-cruby"
            },
            {
              "text": "Ruby on Railsのセキュリティベストプラクティス",
              "link": "/ruby/04-advanced/40-rails-security-best-practices"
            }
          ],
          "collapsed": true
        },
        {
          "text": "05 others",
          "items": [
            {
              "text": "Prismパーサー: Rubyの新しいデフォルトパーサー",
              "link": "/ruby/05-others/01-prism-parser"
            },
            {
              "text": "Garnet VM: 次世代Ruby仮想マシン",
              "link": "/ruby/05-others/02-garnet-vm"
            },
            {
              "text": "Universal Symbol: Ruby 3.3での変更点",
              "link": "/ruby/05-others/03-universal-symbol"
            },
            {
              "text": "YJITの進化とパフォーマンス向上",
              "link": "/ruby/05-others/04-yjit-evolution"
            },
            {
              "text": "Trilogy: 新しいMySQLデータベースアダプタ",
              "link": "/ruby/05-others/05-trilogy-db-adapter"
            },
            {
              "text": "Debug.gem: Rubyの標準デバッガ",
              "link": "/ruby/05-others/07-debug-gem"
            },
            {
              "text": "RubyにおけるWebAssembly (Wasm) の活用",
              "link": "/ruby/05-others/08-ruby-and-wasm"
            },
            {
              "text": "Ractorのパフォーマンスと実用例",
              "link": "/ruby/05-others/09-ractor-performance"
            },
            {
              "text": "RubyでのgRPCサーバー・クライアント実装",
              "link": "/ruby/05-others/10-grpc-implementation"
            }
          ],
          "collapsed": true
        }
      ],
      "collapsed": true
    },
    {
      "text": "TypeScript技術記事",
      "link": "/typescript/index.md",
      "items": [
        {
          "text": "01 basics",
          "items": [
            {
              "text": "TypeScriptのインストールとセットアップ",
              "link": "/typescript/01-basics/01-typescript-setup"
            },
            {
              "text": "TypeScriptの基本構文",
              "link": "/typescript/01-basics/02-typescript-syntax"
            },
            {
              "text": "型システムの基礎",
              "link": "/typescript/01-basics/03-type-system-basics"
            },
            {
              "text": "プリミティブ型とリテラル型",
              "link": "/typescript/01-basics/04-primitive-and-literal-types"
            },
            {
              "text": "オブジェクト型とインターフェース",
              "link": "/typescript/01-basics/05-object-types-and-interfaces"
            },
            {
              "text": "配列とタプル型",
              "link": "/typescript/01-basics/06-arrays-and-tuples"
            },
            {
              "text": "関数型とオーバーロード",
              "link": "/typescript/01-basics/07-function-types-and-overloads"
            },
            {
              "text": "ユニオン型とインターセクション型",
              "link": "/typescript/01-basics/08-union-and-intersection-types"
            },
            {
              "text": "型エイリアスとタイプガード",
              "link": "/typescript/01-basics/09-type-aliases-and-type-guards"
            },
            {
              "text": "ジェネリクスの基礎",
              "link": "/typescript/01-basics/10-generics-basics"
            }
          ],
          "collapsed": true
        },
        {
          "text": "02 advanced",
          "items": [
            {
              "text": "高度なジェネリクス",
              "link": "/typescript/02-advanced/01-advanced-generics"
            },
            {
              "text": "条件型 (Conditional Types)",
              "link": "/typescript/02-advanced/02-conditional-types"
            }
          ],
          "collapsed": true
        },
        {
          "text": "04 frameworks",
          "items": [
            {
              "text": "React + TypeScript",
              "link": "/typescript/04-frameworks/01-react-typescript"
            }
          ],
          "collapsed": true
        },
        {
          "text": "05 tools",
          "items": [
            {
              "text": "Zod: ランタイム型検証",
              "link": "/typescript/05-tools/06-zod-runtime-validation"
            }
          ],
          "collapsed": true
        },
        {
          "text": "06 practice",
          "items": [
            {
              "text": "大規模TypeScriptプロジェクトの構成",
              "link": "/typescript/06-practice/06-large-project-structure"
            }
          ],
          "collapsed": true
        }
      ],
      "collapsed": true
    }
  ]
}

Page Data

{
  "title": "Runtime API Examples",
  "description": "",
  "frontmatter": {
    "outline": "deep"
  },
  "headers": [],
  "relativePath": "api-examples.md",
  "filePath": "api-examples.md"
}

Page Frontmatter

{
  "outline": "deep"
}

More

Check out the documentation for the full list of runtime APIs.

AI が自動生成した技術記事をまとめたテックブログ