### Run Web Examples Source: https://github.com/defillama/api-docs/blob/main/CONTRIBUTING.md Starts the development server for web examples located in the 'examples/web' directory. ```bash pnpm dev:web ``` -------------------------------- ### Install Dependencies and Build Project Source: https://github.com/defillama/api-docs/blob/main/projects/scalar-app/RELEASE.md Before starting the release process, ensure you have the latest code, all dependencies installed, and a fresh build of the project. ```bash git pull pnpm install pnpm turbo build ``` -------------------------------- ### Install, Develop, and Build Project Dependencies Source: https://github.com/defillama/api-docs/blob/main/examples/web/README.md Standard commands for managing project dependencies, starting the development server, and building for production. ```bash pnpm install pnpm dev pnpm build ``` -------------------------------- ### AdonisJS Project Setup Prompts Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/adonisjs.md Example selections for initializing an AdonisJS project for an API with Access Token authentication and SQLite database. ```plaintext Which starter kit would you like to use? ❯ API Starter Kit Select the authentication guard you want to use … ❯ Access Token Select the database driver you want to use … ❯ SQLite Do you want us to install dependencies using "npm"? ❯ Yes ``` -------------------------------- ### Basic Mock Server Setup in Node.js Source: https://github.com/defillama/api-docs/blob/main/packages/mock-server/README.md Integrate the mock server directly into your Node.js application. This example shows how to create a server with a basic OpenAPI specification and custom request logging. ```typescript import { serve } from '@hono/node-server' import { createMockServer } from '@scalar/mock-server' // Your OpenAPI document const specification = { openapi: '3.1.1', info: { title: 'Hello World', version: '1.0.0', }, paths: { '/foobar': { get: { responses: { '200': { description: 'OK', content: { 'application/json': { example: { foo: 'bar', }, }, }, }, }, }, }, }, } // Create the mocked routes const app = await createMockServer({ specification, // Custom logging onRequest({ context, operation }) { console.log(context.req.method, context.req.path) }, }) // Start the server serve( { fetch: app.fetch, port: 3000, }, (info) => { console.log(`Listening on http://localhost:${info.port}`) }, ) ``` -------------------------------- ### Actix Setup with scalar-doc Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/rust.md Install the scalar-doc crate with the 'actix' feature to enable integration with Actix web framework. This snippet shows basic setup and usage. ```bash cargo add scalar-doc -F actix ``` -------------------------------- ### Install @scalar/use-tooltip Source: https://github.com/defillama/api-docs/blob/main/packages/use-tooltip/README.md Install the package using npm. ```bash npm install @scalar/use-tooltip ``` -------------------------------- ### Install Dependencies Source: https://github.com/defillama/api-docs/blob/main/examples/nestjs/nestjs-api-reference-express/README.md Run this command to install all project dependencies. ```bash npm install ``` -------------------------------- ### Provide Custom SDK Installation Instructions with x-scalar-sdk-installation Source: https://github.com/defillama/api-docs/blob/main/documentation/openapi.md Include custom SDK installation instructions using `x-scalar-sdk-installation`. Supports Markdown for descriptions and shell scripts for installation commands. ```yaml openapi: 3.1.0 info: title: Example version: 1.0 x-scalar-sdk-installation: - lang: Node description: Install our **Custom SDK** for Node.js from npm: source: |- npm install @your-awesome-company/sdk ``` -------------------------------- ### Install Void Server Source: https://github.com/defillama/api-docs/blob/main/packages/void-server/README.md Install the Void Server package using npm. ```bash npm add @scalar/void-server ``` -------------------------------- ### Install use-codemirror Source: https://github.com/defillama/api-docs/blob/main/packages/use-codemirror/README.md Install the package using npm. ```bash npm install @scalar/use-codemirror ``` -------------------------------- ### Install Dependencies Source: https://github.com/defillama/api-docs/blob/main/CONTRIBUTING.md Install all project dependencies using pnpm. ```bash pnpm install ``` -------------------------------- ### Install @scalar/import Source: https://github.com/defillama/api-docs/blob/main/packages/import/README.md Install the package using npm. ```bash npm install @scalar/import ``` -------------------------------- ### Start Docusaurus Development Server Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/docusaurus.md Navigate to your Docusaurus project directory and start the development server. ```bash cd my-awesome-website pnpm start ``` -------------------------------- ### Install Laravel Installer Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/laravel-scribe.md Install the Laravel installer globally using Composer to create new Laravel projects. ```bash composer global require "laravel/installer=~1.1" ``` -------------------------------- ### Install Dependencies Source: https://github.com/defillama/api-docs/blob/main/integrations/fastapi/playground/README.md Install the required Python packages using pip. You may need to use `pip3` depending on your Python installation. ```bash pip install -r requirements.txt ``` -------------------------------- ### Run Development Server Source: https://github.com/defillama/api-docs/blob/main/CONTRIBUTING.md Start the development server for the project. ```bash pnpm run dev ``` -------------------------------- ### Start Void and Proxy Servers Source: https://github.com/defillama/api-docs/blob/main/CONTRIBUTING.md Starts both the void server and the proxy server, which are required for certain tests. ```bash pnpm dev:void-server pnpm dev:proxy-server ``` -------------------------------- ### Run Docusaurus Playground Example Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/docusaurus.md Execute the command to run the Docusaurus playground example. ```bash npm run playground ``` -------------------------------- ### Install @scalar/nextjs-openapi Source: https://github.com/defillama/api-docs/blob/main/packages/nextjs-openapi/README.md Install the package using npm. ```bash npm install @scalar/nextjs-openapi ``` -------------------------------- ### Install @scalar/core Source: https://github.com/defillama/api-docs/blob/main/packages/core/README.md Install the @scalar/core package using npm. ```bash npm install @scalar/core ``` -------------------------------- ### Install Mock Server Package Source: https://github.com/defillama/api-docs/blob/main/packages/mock-server/README.md Install the mock server as a dependency in your Node.js project for advanced integration and control. ```bash npm install @scalar/mock-server ``` -------------------------------- ### Install Scalar Express API Reference Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/express.md Install the necessary package using npm. This is the first step before integrating the middleware. ```bash npm install @scalar/express-api-reference ``` -------------------------------- ### Start Local Development Server Source: https://github.com/defillama/api-docs/blob/main/examples/docusaurus/README.md Starts a local development server. Changes are reflected live without a server restart. ```bash $ yarn start ``` -------------------------------- ### Install @scalar/openapi-types Source: https://github.com/defillama/api-docs/blob/main/packages/openapi-types/README.md Install the package using npm. ```bash npm add @scalar/openapi-types ``` -------------------------------- ### Install @scalar/snippetz Source: https://github.com/defillama/api-docs/blob/main/packages/snippetz/README.md Install the library using npm. This is the first step to using the snippetz package. ```bash npm install @scalar/snippetz ``` -------------------------------- ### Install Dependencies Source: https://github.com/defillama/api-docs/blob/main/examples/docusaurus/README.md Run this command to install project dependencies using Yarn. ```bash $ yarn ``` -------------------------------- ### Install @scalar/use-hooks Source: https://github.com/defillama/api-docs/blob/main/packages/use-hooks/README.md Install the @scalar/use-hooks package using npm. ```bash npm add @scalar/use-hooks ``` -------------------------------- ### Install API Reference React Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/nextjs.md Install the necessary package for React integration using npm. ```bash npm add @scalar/api-reference-react ``` -------------------------------- ### Full Example: Configure OpenAPI and Scalar for Multiple Versions Source: https://github.com/defillama/api-docs/blob/main/integrations/aspnetcore/docs/multiple-openapi-documents.md A comprehensive example demonstrating the configuration of both OpenAPI generation and Scalar.AspNetCore integration for multiple API versions within a single application. ```csharp string[] versions = ["v1", "v2"]; foreach (var version in versions) { builder.Services.Configure(options => options.AddDocument(version)); builder.Services.AddOpenApi(version, options => { // Add the appropriate API version information to the document options.AddDocumentTransformer((document, context, _) => { var descriptionProvider = context.ApplicationServices.GetRequiredService(); var versionDescription = descriptionProvider.ApiVersionDescriptions.FirstOrDefault(x => x.GroupName == version); document.Info.Version = versionDescription?.ApiVersion.ToString(); return Task.CompletedTask; }); // Indicate if the API is deprecated options.AddOperationTransformer((operation, context, _) => { var apiDescription = context.Description; operation.Deprecated = apiDescription.IsDeprecated(); return Task.CompletedTask; }); }); } ``` -------------------------------- ### Install Scalar SvelteKit Package Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/sveltekit.md Install the necessary package using npm. ```bash npm install @scalar/sveltekit ``` -------------------------------- ### Install @scalar/use-toasts Source: https://github.com/defillama/api-docs/blob/main/packages/use-toasts/README.md Install the package using npm. This command adds the necessary dependencies to your project. ```bash npm install @scalar/use-toasts ``` -------------------------------- ### Install @scalar/api-client-react Source: https://github.com/defillama/api-docs/blob/main/packages/api-client-react/README.md Install the package using npm. This is the first step to integrate the API client into your React project. ```bash npm install @scalar/api-client-react ``` -------------------------------- ### Install NestJS API Reference Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/nestjs.md Install the @scalar/nestjs-api-reference package using npm. ```bash npm install @scalar/nestjs-api-reference ``` -------------------------------- ### Navigate and Start AdonisJS Development Server Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/adonisjs.md Commands to change into the newly created project directory and start the development server. ```bash cd my-awesome-app npm run dev ``` -------------------------------- ### Install Fastify API Reference Plugin Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/fastify.md Install the Scalar Fastify API Reference package using npm. ```bash npm install @scalar/fastify-api-reference ``` -------------------------------- ### Install React API Reference Package Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/react.md Install the Scalar API Reference package for React using npm. ```bash npm install @scalar/api-reference-react ``` -------------------------------- ### Install Scalar API Client Source: https://github.com/defillama/api-docs/blob/main/packages/api-client/README.md Install the Scalar API Client package using npm. ```bash npm install @scalar/api-client ``` -------------------------------- ### Install @scalar/react-renderer Source: https://github.com/defillama/api-docs/blob/main/packages/react-renderer/README.md Install the package using npm. This is the first step before using the React renderer in your Vue project. ```bash npm install @scalar/react-renderer ``` -------------------------------- ### Install @scalar/draggable Source: https://github.com/defillama/api-docs/blob/main/packages/draggable/README.md Install the draggable component using npm. This is the first step before using it in your project. ```bash npm install @scalar/draggable ``` -------------------------------- ### Install Django Ninja Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/django-ninja.md Install the Django Ninja package, which also includes Django. ```bash pip install django-ninja ``` -------------------------------- ### Create and Start Void Server Source: https://github.com/defillama/api-docs/blob/main/packages/void-server/README.md Create an instance of the Void Server and start it using Hono's node-server. This server will listen on port 3000 and log its activity. ```typescript import { serve } from '@hono/node-server' import { createVoidServer } from '@scalar/void-server' // Create the server instance const app = await createVoidServer() // Start the server serve( { fetch: app.fetch, port: 3000, }, (info) => { console.log(`Listening on http://localhost:${info.port}`) }, ) ``` -------------------------------- ### Install Next.js API Reference Package Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/nextjs.md Install the necessary package for integrating Scalar's API reference with Next.js. ```bash npm install @scalar/nextjs-api-reference ``` -------------------------------- ### Install Scalar API Reference for Vue Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/vue.md Install the Scalar API Reference package using npm. ```bash npm install @scalar/api-reference ``` -------------------------------- ### Create a Basic Fastify Project Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/fastify.md Set up a new Fastify project, including installing Fastify and creating a basic server file with a root route. ```bash npm init npm install fastify ``` -------------------------------- ### Install @scalar/galaxy Source: https://github.com/defillama/api-docs/blob/main/packages/galaxy/README.md Install the Scalar Galaxy package using npm. This is the first step to using the OpenAPI example specification. ```bash npm install @scalar/galaxy ``` -------------------------------- ### Run Nuxt Package Source: https://github.com/defillama/api-docs/blob/main/CONTRIBUTING.md Starts the Nuxt.js package development server. ```bash pnpm dev:nuxt ``` -------------------------------- ### Start Laravel Development Server Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/laravel-scribe.md Start the built-in PHP development server for your Laravel application. ```bash php artisan serve ``` -------------------------------- ### Install Hono API Reference Middleware Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/hono.md Install the Scalar Hono API reference middleware using npm. ```bash npm install @scalar/hono-api-reference ``` -------------------------------- ### Create Docs Folder and Example File Source: https://github.com/defillama/api-docs/blob/main/documentation/guides/docs/github-sync.md Use these bash commands to create a 'docs' folder and an initial markdown file for your documentation content. ```bash # Create a docs/ folder mkdir docs # Create an example file echo "# Hello World" > docs/introduction.md ``` -------------------------------- ### Example GET Request to Proxy Source: https://github.com/defillama/api-docs/blob/main/projects/proxy-scalar-com/README.md Send a GET request to the proxy server, specifying the target URL via the scalar_url query parameter. The response will include CORS headers. ```bash curl --request GET \ --url 'localhost:1337?scalar_url=https%3A%2F%2Fgalaxy.scalar.com%2Fplanets' ``` -------------------------------- ### Quickstart Mock Server with Scalar CLI Source: https://github.com/defillama/api-docs/blob/main/packages/mock-server/README.md Use the Scalar CLI to quickly set up a mock server from an OpenAPI JSON file. The `--watch` flag enables live reloading on file changes. ```bash npx @scalar/cli document mock openapi.json --watch ``` -------------------------------- ### Get Token Prices Over Time Source: https://github.com/defillama/api-docs/blob/main/llms-free.txt Retrieves token prices at regular time intervals between a specified start and end timestamp. ```APIDOC ## GET /chart/{coins} ### Description Get token prices at regular time intervals. ### Method GET ### Endpoint https://api.llama.fi/chart/{coins} ### Parameters #### Path Parameters - **coins** (string) - Required - set of comma-separated tokens defined as {chain}:{address} Example: `ethereum:0xdF574c24545E5FfEcb9a659c229253D4111d87e1,coingecko:ethereum,bsc:0x762539b45a1dcce3d36d080f74d1aed37844b878,ethereum:0xdB25f211AB05b1c97D595516F45794528a807ad8` #### Query Parameters - **start** (number) - Optional - unix timestamp of earliest data point requested Example: `1664364537` - **end** (number) - Optional - unix timestamp of latest data point requested - **span** (number) - Optional - number of data points returned, defaults to 0 Example: `10` - **period** (string) - Optional - duration between data points, defaults to 24 hours Example: `2d` - **searchWidth** (string) - Optional - time range on either side to find price data, defaults to 10% of period Example: `600` ### Response #### Success Response (200) - Returns: {coins} ``` -------------------------------- ### Generate Node.js Undici Request Example (Lean Usage) Source: https://github.com/defillama/api-docs/blob/main/packages/snippetz/README.md Generate an HTTP request example for Node.js using 'undici' with lean usage. This method imports only the specific plugin, reducing bundle size. Ensure the 'undici' library is installed. ```typescript import { nodeUndici } from '@scalar/snippetz/plugins/node/undici' const result = nodeUndici.generate({ url: 'https://example.com', }) console.log(source) // import { request } from 'undici' // const { statusCode, body } = await request( // 'url': 'https://example.com', // ) ``` -------------------------------- ### Quickstart: Diff, Merge, and Apply OpenAPI Document Changes Source: https://github.com/defillama/api-docs/blob/main/packages/json-diff/README.md Demonstrates how to use the diff, merge, and apply functions to compare two OpenAPI documents, resolve conflicts, and create a final merged document. ```typescript import { apply, diff, merge } from '@scalar/json-diff' const baseDocument = { openapi: '3.0.0', info: { title: 'Simple API', description: 'A small OpenAPI specification example', version: '1.0.0', }, } const documentV1 = { openapi: '3.0.0', info: { title: 'Simple API', description: 'A small OpenAPI specification example', version: '1.0.0', }, change: 'This is a new property', } const documentV2 = { openapi: '3.0.0', info: { title: 'Simple API', description: 'A small OpenAPI specification example', version: '1.0.1', }, } // Merge the changes of both versions with the same parent document const { diffs, conflicts } = merge( diff(baseDocument, documentV1), diff(baseDocument, documentV2), ) // Apply changes from v1 and v2 to the parent document to get the final document const finalDocument = apply(baseDocument, diffs) ``` -------------------------------- ### Installing React Renderer Source: https://github.com/defillama/api-docs/blob/main/documentation/plugins.md Install the necessary packages for rendering custom OpenAPI extensions using React. This includes the React renderer and core React libraries. ```bash npm install @scalar/react-renderer react react-dom ``` -------------------------------- ### Provide Custom Code Samples with x-codeSamples Source: https://github.com/defillama/api-docs/blob/main/documentation/openapi.md Include custom code examples for HTTP clients, frameworks, or SDKs. This example shows usage with the ValTown JS SDK. ```yaml openapi: 3.1.0 info: title: Val Town API version: 1.0 paths: '/v1/eval': post: x-codeSamples: - label: ValTown JS SDK lang: JavaScript source: |- import ValTown from '@valtown/sdk'; const valTown = new ValTown(); async function main() { const valRunAnonymousResponse = await valTown.vals.runAnonymous({ code: 'console.log(1);' }); console.log(valRunAnonymousResponse); } main(); ``` -------------------------------- ### Get Daily Token and Address Volume Breakdown Source: https://github.com/defillama/api-docs/blob/main/llms-pro.txt Provides a 24-hour breakdown of token and address volume for a specific bridge on a given chain, starting from a specified Unix timestamp. ```APIDOC ## GET /bridges/bridgedaystats/{timestamp}/{chain} ### Description Get a 24hr token and address volume breakdown for a bridge. ### Method GET ### Endpoint `https://pro-api.llama.fi/bridges/bridgedaystats/{timestamp}/{chain}` ### Parameters #### Path Parameters - **timestamp** (integer) - Required - Unix timestamp. Data returned will be for the 24hr period starting at 00:00 UTC that the timestamp lands in. Example: `1755561600` - **chain** (string) - Required - Chain slug. Example: `Ethereum` #### Query Parameters - **id** (integer) - Optional - Bridge ID. Example: `2` ### Response #### Success Response (200) - **date** (string) - The date for the 24hr period. - **totalTokensDeposited** (number) - Total tokens deposited. - **totalTokensWithdrawn** (number) - Total tokens withdrawn. - **totalAddressDeposited** (integer) - Total unique addresses depositing. - **totalAddressWithdrawn** (integer) - Total unique addresses withdrawing. ``` -------------------------------- ### Create a New React Project with Vite Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/react.md Use Vite to quickly set up a new React project. This example uses pnpm for package management and JavaScript as the language. ```bash pnpm create vite my-awesome-app ``` ```bash ? Select a framework: › - Use arrow-keys. Return to submit. Vanilla Vue ❯ React Preact Lit Svelte Solid Qwik Others ``` ```bash ? Select a variant: › - Use arrow-keys. Return to submit. TypeScript TypeScript + SWC ❯ JavaScript JavaScript + SWC Remix ↗ ``` ```bash cd my-awesome-app pnpm install pnpm run dev ``` -------------------------------- ### Configure Example Service for OpenAPI Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/aspire.md Set up a service to expose OpenAPI documents using `AddOpenApi` or `AddEndpointsApiExplorer` and `AddSwaggerGen`. Ensure OpenAPI documents are mapped correctly in development. ```csharp // In your service's Program.cs var builder = WebApplication.CreateBuilder(args); builder.Services.AddOpenApi(); // or builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); var app = builder.Build(); if (app.Environment.IsDevelopment()) { app.MapOpenApi(); // Exposes at /openapi/{documentName}.json // or app.UseSwagger(options => { options.RouteTemplate = "/swagger/{documentName}.json"; }); } app.Run(); ``` -------------------------------- ### x-scalar-sdk-installation Source: https://github.com/defillama/api-docs/blob/main/documentation/openapi.md Include custom SDK installation instructions using `x-scalar-sdk-installation`. Supports Markdown for descriptions and shell scripts for commands. ```APIDOC ## x-scalar-sdk-installation We generate custom code examples for all languages, but you might have a custom SDK for your API. Provide installation instructions in the header like shown in the example below. You can use `description` (supports Markdown) or `source` (for shell scripts) or both. ```diff openapi: 3.1.0 info: title: Example version: 1.0 + x-scalar-sdk-installation: + - lang: Node + description: Install our **Custom SDK** for Node.js from npm: + source: |- + npm install @your-awesome-company/sdk ``` ``` -------------------------------- ### Install Scalar for Django Ninja Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/django-ninja.md Install the Scalar package for Django Ninja using pip. This command installs the necessary integration. ```bash pip install git+https://github.com/scalar/scalar.git#subdirectory=integrations/django-ninja ``` -------------------------------- ### GET /api/chainAssets Source: https://github.com/defillama/api-docs/blob/main/llms-pro.txt Get assets of all chains. ```APIDOC ## GET /api/chainAssets ### Description Get assets of all chains. ### Method GET ### Endpoint https://pro-api.llama.fi/api/chainAssets ### Response #### Success Response (200) Returns: {chain, timestamp} ``` -------------------------------- ### Run Playground for Manual Testing Source: https://github.com/defillama/api-docs/blob/main/integrations/fastapi/tests/README.md Navigate to the `playground` directory, install its dependencies, and run the Uvicorn server to access the Scalar interface locally. ```bash cd playground pip install -r requirements.txt uvicorn main:app --reload ``` -------------------------------- ### Install Scalar CLI Globally (Force) Source: https://github.com/defillama/api-docs/blob/main/documentation/guides/cli/getting-started.md Use this command to forcefully install the Scalar CLI globally, overwriting any existing conflicting installations. ```bash npm -g --force install @scalar/cli ``` -------------------------------- ### Display CLI Help Source: https://github.com/defillama/api-docs/blob/main/documentation/guides/cli/getting-started.md Run this command to see all available commands and options for the Scalar CLI. ```bash npx @scalar/cli help ``` -------------------------------- ### Run Development Server Source: https://github.com/defillama/api-docs/blob/main/examples/nextjs-api-reference/README.md Use these commands to start the Next.js development server. Open http://localhost:3000 in your browser to view the application. ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` -------------------------------- ### Start Docusaurus Development Server Source: https://github.com/defillama/api-docs/blob/main/examples/docusaurus/docs/intro.md Navigate to your new site's directory and run this command to build and serve your Docusaurus website locally. The site reloads automatically on changes. ```bash cd my-website npm run start ``` -------------------------------- ### Install OpenAPI Parser Source: https://github.com/defillama/api-docs/blob/main/packages/openapi-parser/README.md Install the @scalar/openapi-parser package using npm. ```bash npm add @scalar/openapi-parser ``` -------------------------------- ### Fastify Server Implementation Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/fastify.md Example of a Fastify server implementation using ES Modules, including instantiation, route declaration, and server listening. ```javascript // index.js import Fastify from 'fastify' // Instantiate the framework const fastify = Fastify({ logger: true, }) // Declare a route fastify.get('/', function (request, reply) { reply.send({ hello: 'world' }) }) // Run the server fastify.listen({ port: 3000 }, function (err, address) { if (err) { fastify.log.error(err) process.exit(1) } console.log(`Fastify is now listening on ${address}`) }) ``` -------------------------------- ### Start Site in French Locale Source: https://github.com/defillama/api-docs/blob/main/examples/docusaurus/docs/tutorial-extras/translate-your-site.md Run the development server with the '--locale fr' flag to preview your site in French. ```bash npm run start -- --locale fr ``` -------------------------------- ### Install Scalar Icons Source: https://github.com/defillama/api-docs/blob/main/packages/icons/src/library/README.md Install the Scalar Icons package using pnpm. ```bash pnpm i @scalar/icons ``` -------------------------------- ### Install Scalar Components Source: https://github.com/defillama/api-docs/blob/main/packages/components/README.md Install the Scalar Components package using pnpm. ```bash pnpm i @scalar/components ``` -------------------------------- ### Navigate to Project Directory Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/laravel-scribe.md Change into the newly created Laravel project directory. ```bash cd my-new-app ``` -------------------------------- ### Install Fastify Swagger Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/fastify.md Install the official @fastify/swagger package using npm. ```bash npm install @fastify/swagger ``` -------------------------------- ### Login to toDesktop Source: https://github.com/defillama/api-docs/blob/main/projects/scalar-app/RELEASE.md To build and release new versions, you need to be logged into the toDesktop service. Use these commands to log in and verify your identity. ```bash pnpm todesktop login pnpm todesktop whoami ``` -------------------------------- ### API Client Web Playground Development Commands Source: https://github.com/defillama/api-docs/blob/main/CLAUDE.md Provides commands to start the API client web playground and access it locally. Includes instructions for configuring API keys and testing with specific endpoints. ```bash # Start API client web playground pnpm dev:client:web # Access at http://localhost:5065/ # Navigate to Settings → API Keys to configure # Test with endpoints using pro-api.llama.fi server ``` -------------------------------- ### Install Scalar Themes Package Source: https://github.com/defillama/api-docs/blob/main/packages/themes/README.md Install the Scalar Themes package using pnpm. ```bash pnpm i @scalar/themes ``` -------------------------------- ### Run Development Server for CDN API Reference Source: https://github.com/defillama/api-docs/blob/main/playwright/README.md Starts the development server for the CDN API reference. Ensure this is running before executing tests that depend on it. ```bash pnpm --filter cdn-api-reference dev ``` -------------------------------- ### Install Laravel Scribe Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/laravel-scribe.md Install Laravel Scribe as a development dependency using Composer. ```bash composer require --dev --with-all-dependencies knuckleswtf/scribe ``` -------------------------------- ### Basic Step Example Source: https://github.com/defillama/api-docs/blob/main/documentation/guides/docs/components/steps.md Demonstrates a simple interactive step with a title and content. The `id` is required for internal management. ```html First, install the required dependencies by running: ```bash npm install @scalar/guide-elements ``` ``` ```html First, install the required dependencies by running: ```bash npm install @scalar/guide-elements > ``` -------------------------------- ### Install Scalar Docusaurus Plugin Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/docusaurus.md Install the Scalar Docusaurus plugin using npm. ```bash npm install @scalar/docusaurus ``` -------------------------------- ### Steps Container Example Source: https://github.com/defillama/api-docs/blob/main/documentation/guides/docs/components/steps.md Demonstrates grouping multiple `scalar-step` components within a `scalar-steps` container for a structured tutorial flow. Each step can have its own content and commands. ```bash mkdir my-project cd my-project npm init -y ``` ```bash npm install react react-dom ``` ```bash npm start ``` ```html Initialize a new project: ```bash mkdir my-project cd my-project npm init -y ``` Install the required packages: ```bash npm install react react-dom ``` Begin development: ```bash npm start ``` ``` ```html Initialize a new project: ```bash mkdir my-project cd my-project npm init -y ``` Install the required packages: ```bash npm install react react-dom ``` Begin development: ```bash npm start ``` ``` -------------------------------- ### Initialize Scalar Configuration File Source: https://github.com/defillama/api-docs/blob/main/documentation/guides/docs/github-sync.md Create the 'scalar.config.json' file to begin configuring your documentation site. ```bash touch scalar.config.json ``` -------------------------------- ### Create New Laravel Project Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/laravel-scribe.md Create a new Laravel application using the Laravel installer. ```bash laravel new my-new-app ``` -------------------------------- ### Install OpenAPI to Markdown Converter Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/hono.md Install the `@scalar/openapi-to-markdown` package to generate Markdown versions of your OpenAPI documents. ```bash npm install @scalar/openapi-to-markdown ``` -------------------------------- ### Run API Client Dev Environment Source: https://github.com/defillama/api-docs/blob/main/CONTRIBUTING.md Starts the development environment specifically for the API Client. ```bash pnpm dev:client ``` -------------------------------- ### Install Scalar CLI Globally Source: https://github.com/defillama/api-docs/blob/main/documentation/guides/cli/getting-started.md Install the Scalar CLI globally on your system for easy access to all commands. ```bash npm -g install @scalar/cli ``` -------------------------------- ### Install Playwright Dependencies Source: https://github.com/defillama/api-docs/blob/main/playwright/README.md Installs Playwright and necessary browser dependencies. Use the command appropriate for your package manager. ```bash pnpm exec playwright install ``` ```bash pnpm playwright:install ``` ```bash npx playwright install --with-deps ``` -------------------------------- ### Initialize New AdonisJS Project Source: https://github.com/defillama/api-docs/blob/main/documentation/integrations/adonisjs.md Use this command to create a new AdonisJS project. Follow the prompts to select your desired starter kit, authentication guard, and database driver. ```bash npm init adonisjs@latest my-awesome-app ``` -------------------------------- ### Install Postman to OpenAPI Converter Source: https://github.com/defillama/api-docs/blob/main/packages/postman-to-openapi/README.md Install the package using npm. This command adds the necessary dependencies to your project. ```bash npm install @scalar/postman-to-openapi ``` -------------------------------- ### Build Your Docusaurus Site for Production Source: https://github.com/defillama/api-docs/blob/main/examples/docusaurus/docs/tutorial-basics/deploy-your-site.md Run this command to generate the static files for your Docusaurus site in the `build` folder. This is the output you will deploy. ```bash npm run build ``` -------------------------------- ### Static Step Example Source: https://github.com/defillama/api-docs/blob/main/documentation/guides/docs/components/steps.md Shows how to create a non-collapsible step by setting `interactivity` to 'none'. This is useful for steps that should always remain visible. ```javascript const config = { theme: 'dark', interactive: false, } ``` ```html This step cannot be collapsed and is always visible. ```javascript const config = { theme: 'dark', interactive: false, } ``` ``` ```html This step cannot be collapsed and is always visible. ```javascript const config = { theme: 'dark', interactive: false }; > ``` -------------------------------- ### Run API Client Desktop App (Electron) Source: https://github.com/defillama/api-docs/blob/main/CONTRIBUTING.md Launches the API Client desktop application within an Electron development environment. ```bash pnpm dev:client:desktop ``` -------------------------------- ### Vue Component Structure with Composition API Source: https://github.com/defillama/api-docs/blob/main/CLAUDE.md Demonstrates the recommended structure for Vue components using the Composition API and ` ``` -------------------------------- ### Clean Build and Reinstall Source: https://github.com/defillama/api-docs/blob/main/CLAUDE.md Performs a clean build by clearing the cache, reinstalling packages, and then building all packages. ```bash pnpm clean:build ```