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
8 changes: 7 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@ compressionLevel: mixed

enableGlobalCache: false

nodeLinker: pnpm
nodeLinker: pnpm

# The plugin imports @docusaurus/logger without declaring it
packageExtensions:
"@signalwire/docusaurus-plugin-llms-txt@*":
dependencies:
"@docusaurus/logger": ^3.0.0
2 changes: 1 addition & 1 deletion docs/best-practices/security/compromised-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Compromised SDK Keys
sidebar_label: Compromised SDK Keys
sidebar_position: 2
description: How to address compromised SDK keys in your environmentden
description: How to address compromised SDK keys in your environment
---

# **Compromised SDK Keys**
Expand Down
2 changes: 1 addition & 1 deletion docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ DevCycle is a feature flag platform built for teams of any size, helping you eas

</div>
<div className="image-container">
<img src="code-sample-hero.png" alt="Your image description"/>
<img src="code-sample-hero.png" alt=""/>
</div>
</div>
4 changes: 1 addition & 3 deletions docs/integrations/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ DevCycle APIs, as well as third party integrations to connect DevCycle to the to
<p>
If you would like to contribute to an existing integration or tool, all of
DevCycle's tools and integrations are{' '}
<a href="https://github.com/devcycleHQ">
open source on the DevCycle Github repository.
</a>
<a href="https://github.com/devcycleHQ">open source on GitHub</a>.
</p>
<p>
Further, if you'd like to create a new tool or integration, a great
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/vercel-edge-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ If you do not have the Vercel CLI set up for this project, [follow their steps](

### Setup SDK

If you haven't already installed the DevCycle [Node.js](https://docs.devcycle.com/sdk/server-side-sdks/node/) or [Next.js](https://docs.devcycle.com/sdk/server-side-sdks/nestjs/) SDK you can follow the installation and usage guides for those SDKs in our [documentation here](https://docs.devcycle.com/sdk/). You can also find helpful setup information like where to find DevCycle SDK keys in our [Quickstart Tutorial](https://docs.devcycle.com/introduction/quickstart).
If you haven't already installed the DevCycle [Node.js](https://docs.devcycle.com/sdk/server-side-sdks/node/) or [Next.js](https://docs.devcycle.com/sdk/client-side-sdks/nextjs/) SDK you can follow the installation and usage guides for those SDKs in our [documentation here](https://docs.devcycle.com/sdk/). You can also find helpful setup information like where to find DevCycle SDK keys in our [Quickstart Tutorial](https://docs.devcycle.com/quickstart).

In order to use the integration in a DevCycle SDK, you must install the `@devcycle/vercel-edge-config` package and provide it
during SDK initialization. Using that package requires the `@vercel/global-config` package to be installed as well:
Expand Down
4 changes: 2 additions & 2 deletions docs/sdk/client-side-sdks/javascript/javascript-typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sidebar_custom_props: { icon: cib:typescript }
The DevCycle JS SDK is written in Typescript and includes a full Typescript interface.

It is also possible to enhance the type safety of the SDK by using the
[Devcycle CLI](https://docs.devcycle.com/tools-and-integrations/cli) to generate a type definition
[Devcycle CLI](https://docs.devcycle.com/cli) to generate a type definition
based on the complete set of variables defined in your project. Using this method, you can ensure that your code
cannot access a variable key that is not defined in DevCycle, or treat a variable as a different type.

Expand Down Expand Up @@ -80,7 +80,7 @@ dvc generate types

See the [documentation](https://github.com/DevCycleHQ/cli/blob/main/docs/generate.md#dvc-generate-types) for this command

Ensure that the CLI is properly setup and authenticated to your project before running this command. See the [CLI docs](https://docs.devcycle.com/tools-and-integrations/cli)
Ensure that the CLI is properly setup and authenticated to your project before running this command. See the [CLI docs](https://docs.devcycle.com/cli)
for further instructions on setting up the CLI.

This command will generate a file called `dvcVariableTypes.ts` in the configured output directory.
Expand Down
4 changes: 2 additions & 2 deletions docs/sdk/client-side-sdks/nextjs/nextjs-typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sidebar_custom_props: {icon: cib:typescript}
The DevCycle Next.js SDK is written in Typescript and includes a full Typescript interface.

It is also possible to enhance the type safety of the SDK by using the
[Devcycle CLI](https://docs.devcycle.com/tools-and-integrations/cli) to generate a type definition
[Devcycle CLI](https://docs.devcycle.com/cli) to generate a type definition
based on the complete set of variables defined in your project. Using this method, you can ensure that your code
cannot access a variable key that is not defined in DevCycle, or treat a variable as a different type.

Expand Down Expand Up @@ -73,7 +73,7 @@ dvc generate types

See the [documentation](https://github.com/DevCycleHQ/cli/blob/main/docs/generate.md#dvc-generate-types) for this command

Ensure that the CLI is properly setup and authenticated to your project before running this command. See the [CLI docs](https://docs.devcycle.com/tools-and-integrations/cli)
Ensure that the CLI is properly setup and authenticated to your project before running this command. See the [CLI docs](https://docs.devcycle.com/cli)
for further instructions on setting up the CLI.

This command will generate a file called `dvcVariableTypes.ts` in the configured output directory. The generated output will contain the `declare module` statement to automatically augment the SDK's types.
Expand Down
4 changes: 2 additions & 2 deletions docs/sdk/client-side-sdks/react/react-typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sidebar_custom_props: {icon: cib:typescript}
The DevCycle React SDK is written in Typescript and includes a full Typescript interface.

It is also possible to enhance the type safety of the SDK by using the
[Devcycle CLI](https://docs.devcycle.com/tools-and-integrations/cli) to generate a type definition
[Devcycle CLI](https://docs.devcycle.com/cli) to generate a type definition
based on the complete set of variables defined in your project. Using this method, you can ensure that your code
cannot access a variable key that is not defined in DevCycle, or treat a variable as a different type.

Expand Down Expand Up @@ -68,7 +68,7 @@ dvc generate types

See the [documentation](https://github.com/DevCycleHQ/cli/blob/main/docs/generate.md#dvc-generate-types) for this command

Ensure that the CLI is properly setup and authenticated to your project before running this command. See the [CLI docs](https://docs.devcycle.com/tools-and-integrations/cli)
Ensure that the CLI is properly setup and authenticated to your project before running this command. See the [CLI docs](https://docs.devcycle.com/cli)
for further instructions on setting up the CLI.

This command will generate a file called `dvcVariableTypes.ts` in the configured output directory. The generated output will contain the `declare module` statement to automatically augment the SDK's types.
Expand Down
4 changes: 2 additions & 2 deletions docs/sdk/server-side-sdks/nestjs/nestjs-typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sidebar_custom_props: {icon: cib:typescript}
The DevCycle NestJS SDK is written in Typescript and includes a full Typescript interface.

It is also possible to enhance the type safety of the SDK by using the
[Devcycle CLI](https://docs.devcycle.com/tools-and-integrations/cli) to generate a type definition
[Devcycle CLI](https://docs.devcycle.com/cli) to generate a type definition
based on the complete set of variables defined in your project. Using this method, you can ensure that your code
cannot access a variable key that is not defined in DevCycle, or treat a variable as a different type.

Expand Down Expand Up @@ -70,7 +70,7 @@ dvc generate types

See the [documentation](https://github.com/DevCycleHQ/cli/blob/main/docs/generate.md#dvc-generate-types) for this command

Ensure that the CLI is properly setup and authenticated to your project before running this command. See the [CLI docs](https://docs.devcycle.com/tools-and-integrations/cli)
Ensure that the CLI is properly setup and authenticated to your project before running this command. See the [CLI docs](https://docs.devcycle.com/cli)
for further instructions on setting up the CLI.

This command will generate a file called `dvcVariableTypes.ts` in the configured output directory.
Expand Down
4 changes: 2 additions & 2 deletions docs/sdk/server-side-sdks/node/node-typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sidebar_custom_props: {icon: cib:typescript}
The DevCycle Node.js SDK is written in Typescript and includes a full Typescript interface.

It is also possible to enhance the type safety of the SDK by using the
[Devcycle CLI](https://docs.devcycle.com/tools-and-integrations/cli) to generate a type definition
[Devcycle CLI](https://docs.devcycle.com/cli) to generate a type definition
based on the complete set of variables defined in your project. Using this method, you can ensure that your code
cannot access a variable key that is not defined in DevCycle, or treat a variable as a different type.

Expand Down Expand Up @@ -80,7 +80,7 @@ dvc generate types

See the [documentation](https://github.com/DevCycleHQ/cli/blob/main/docs/generate.md#dvc-generate-types) for this command

Ensure that the CLI is properly setup and authenticated to your project before running this command. See the [CLI docs](https://docs.devcycle.com/tools-and-integrations/cli)
Ensure that the CLI is properly setup and authenticated to your project before running this command. See the [CLI docs](https://docs.devcycle.com/cli)
for further instructions on setting up the CLI.

This command will generate a file called `dvcVariableTypes.ts` in the configured output directory.
Expand Down
1 change: 1 addition & 0 deletions docs/sdk/server-side-sdks/python/python-gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ sidebar_custom_props: { icon: material-symbols:rocket }
## Initializing Local Bucketing SDK

Code sample for importing and setting up the DevCycleLocalClient.

[//]: # 'wizard-initialize-start'

```python
Expand Down
169 changes: 162 additions & 7 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
require('dotenv').config()
const path = require('path')
const {
rehypeLlmsCleanup,
rehypeLlmsFixIndexLinks,
} = require('./plugins/rehype-llms-cleanup')
import remarkEmbedder from '@remark-embedder/core'
const YouTubeTransformer = {
name: 'YouTubeTransformer',
Expand Down Expand Up @@ -55,6 +59,95 @@ const VSCODE_EXTENSION_VERSION = 'v1.4.10' // auto updated by extension release

const AI_PROMPTS_VERSION = 'main' // AI prompts repository branch

const SITE_URL = process.env.CF_PAGES
? 'https://docs.devcycle.com'
: 'http://localhost:3000'

/**
* Section names for llms.txt. Routes not listed here are grouped by their
* top-level path segment.
*/
const LLMS_SDK_NAMES = {
'client-side-sdks': {
android: 'Android',
angular: 'Angular',
flutter: 'Flutter',
ios: 'iOS',
javascript: 'JavaScript',
nextjs: 'Next.js',
react: 'React',
'react-native': 'React Native',
roku: 'Roku',
},
'server-side-sdks': {
dotnet: '.NET',
go: 'Go',
java: 'Java',
nestjs: 'NestJS',
node: 'Node.js',
php: 'PHP',
python: 'Python',
ruby: 'Ruby',
},
}

const LLMS_EXCLUDE_ROUTES = [
'/search',
'/management-api/**',
'/bucketing-api/**',
// Example app pages only link out to GitHub repos and sandboxes
'/sdk/**/*-example',
// Generated `dvc --help` output; cli-guides covers the same commands
'/cli/docs/**',
// Build and deploy notes for the hosted MCP worker itself
'/cli/mcp-worker{,/}',
// Video-only page
'/platform/experimentation/tutorial-experiment-setup',
]

const LLMS_ROUTE_RULES = [
{ route: '/quickstart', categoryName: 'Quickstart' },
{ route: '/essentials/**', categoryName: 'Essentials' },
{ route: '/platform/**', categoryName: 'Platform', depth: 2 },
...Object.entries({
'account-management': 'Account Management',
experimentation: 'Experimentation',
extras: 'Extras',
'feature-flags': 'Feature Flags',
'security-and-guardrails': 'Security and Guardrails',
'testing-and-qa': 'Testing and QA',
}).map(([dir, categoryName]) => ({
route: `/platform/${dir}/**`,
categoryName,
depth: 2,
})),
{ route: '/sdk/**', categoryName: 'SDKs' },
{ route: '/sdk/sdk-proxy/**', categoryName: 'SDK Proxy', depth: 2 },
{
route: '/sdk/client-side-sdks/**',
categoryName: 'Client-Side SDKs',
depth: 3,
},
{
route: '/sdk/server-side-sdks/**',
categoryName: 'Server-Side SDKs',
depth: 3,
},
...Object.entries(LLMS_SDK_NAMES).flatMap(([group, sdks]) =>
Object.entries(sdks).map(([dir, categoryName]) => ({
route: `/sdk/${group}/${dir}/**`,
categoryName,
depth: 3,
})),
),
{ route: '/integrations/**', categoryName: 'Integrations' },
{ route: '/cli-mcp/**', categoryName: 'MCP Server' },
{ route: '/cli-guides/**', categoryName: 'CLI Guides' },
{ route: '/cli/**', categoryName: 'CLI' },
{ route: '/best-practices/**', categoryName: 'Best Practices' },
{ route: '/examples', categoryName: 'Examples' },
]

const removeDocsSections = (content, sectionNames, headerIdentifier = '##') => {
let result = content
for (const sectionName of sectionNames) {
Expand Down Expand Up @@ -99,6 +192,64 @@ const config = {
}
},
path.resolve(__dirname, 'plugins', 'custom-gtm'),
[
path.resolve(__dirname, 'plugins', 'llms-txt.js'),
{
siteTitle: 'DevCycle Docs',
siteDescription:
'DevCycle is a feature flag management and experimentation platform with SDKs for every major language, native OpenFeature providers, a CLI, and an MCP server for AI coding tools.',
depth: 1,
includeOrder: [
'/',
'/quickstart',
'/essentials/**',
'/platform/**',
'/sdk/**',
'/integrations/**',
'/cli-mcp/**',
'/cli-guides/**',
'/cli/**',
'/best-practices/**',
'/examples',
],
optionalLinks: [
{
title: 'Management API OpenAPI spec',
url: 'https://api.devcycle.com/openapi.json',
description:
'Manage projects, features, variables, environments, and targeting',
},
{
title: 'Bucketing API OpenAPI spec',
url: 'https://bucketing-api.devcycle.com/openapi.yaml',
description:
'Evaluate variables and track events for a user, used by Cloud Bucketing SDKs',
},
{
title: 'DevCycle on GitHub',
url: 'https://github.com/DevCycleHQ',
},
],
content: {
enableLlmsFullTxt: true,
relativePaths: false,
excludeRoutes: LLMS_EXCLUDE_ROUTES,
beforeDefaultRehypePlugins: [
[rehypeLlmsCleanup, { siteUrl: SITE_URL }],
],
rehypePlugins: [
[
rehypeLlmsFixIndexLinks,
{
siteUrls: [SITE_URL, 'https://docs.devcycle.com'],
excludeRoutes: LLMS_EXCLUDE_ROUTES,
},
],
],
routeRules: LLMS_ROUTE_RULES,
},
},
],
[
'docusaurus-plugin-remote-content',
{
Expand Down Expand Up @@ -134,10 +285,16 @@ const config = {
performCleanup: true,
modifyContent: (filename, content) => {
if (filename.includes('README')) {
return {
// reduce headers to use with table of contents
content: content.replace(/#\s/g, '## '),
}
// reduce headers to use with table of contents, skipping code blocks
let inFence = false
const reduced = content
.split('\n')
.map((line) => {
if (/^\s*(```|~~~)/.test(line)) inFence = !inFence
return inFence ? line : line.replace(/^(#{1,5})\s/, '#$1 ')
})
.join('\n')
return { content: reduced }
}
return undefined
},
Expand Down Expand Up @@ -343,9 +500,7 @@ const config = {
},
DEVCYCLE_CLIENT_SDK_KEY: process.env.DEVCYCLE_CLIENT_SDK_KEY,
},
url: process.env.CF_PAGES
? 'https://docs.devcycle.com'
: 'http://localhost:3000',
url: SITE_URL,
baseUrl: '/',
favicon: 'devcycle_favicon.svg',
scripts: [
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"@docusaurus/tsconfig": "^3.9.2",
"@docusaurus/types": "^3.9.2",
"@iconify-icon/react": "^1.0.8",
"@signalwire/docusaurus-plugin-llms-txt": "^1.2.2",
"@types/react": "^18.3.20",
"typescript": "~5.8.2"
},
Expand Down
Loading
Loading