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
3 changes: 2 additions & 1 deletion apps/docs/app/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[] }>
if (!page) notFound()

const data = page.data as unknown as PageData & {
lastModified?: Date
_openapi?: { method?: string }
getAPIPageProps?: () => ApiPageProps
}
Expand Down Expand Up @@ -246,6 +247,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[] }>
title={data.title}
description={data.description || ''}
url={`${BASE_URL}${page.url}`}
dateModified={data.lastModified?.toISOString()}
breadcrumb={breadcrumbs}
/>
<DocsPage
Expand Down Expand Up @@ -373,7 +375,6 @@ export async function generateMetadata(props: { params: Promise<{ slug?: string[
creator: '@simdotai',
site: '@simdotai',
},
canonical: fullUrl,
alternates: {
canonical: fullUrl,
},
Expand Down
18 changes: 8 additions & 10 deletions apps/docs/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Navbar } from '@/components/navbar/navbar'
import { SimWordmark } from '@/components/ui/sim-logo'
import { serializeJsonLd } from '@/lib/json-ld'
import { source } from '@/lib/source'
import { DOCS_BASE_URL } from '@/lib/urls'
import { DOCS_BASE_URL, SIM_SITE_URL } from '@/lib/urls'
import { season } from '@/app/fonts/season'
import './global.css'

Expand All @@ -31,7 +31,7 @@ const structuredData = {
publisher: {
'@type': 'Organization',
name: 'Sim',
url: 'https://sim.ai',
url: SIM_SITE_URL,
logo: {
'@type': 'ImageObject',
url: `${DOCS_BASE_URL}/static/logo.png`,
Expand Down Expand Up @@ -138,7 +138,7 @@ export const metadata = {
'AI agent deployment',
'AI tools',
],
authors: [{ name: 'Sim Team', url: 'https://sim.ai' }],
authors: [{ name: 'Sim Team', url: SIM_SITE_URL }],
creator: 'Sim',
publisher: 'Sim',
category: 'Developer Tools',
Expand Down Expand Up @@ -185,18 +185,16 @@ export const metadata = {
site: '@simdotai',
images: [`${DOCS_BASE_URL}/api/og?title=Sim%20Documentation`],
},
/**
* Preview hints only. Indexable is the default, and asserting `index` or a
* root canonical here would also reach the not-found page, contradicting
* the `noindex` Next adds there; each doc page sets its own canonical.
*/
robots: {
index: true,
follow: true,
googleBot: {
index: true,
follow: true,
'max-video-preview': -1,
'max-image-preview': 'large',
'max-snippet': -1,
},
},
alternates: {
canonical: DOCS_BASE_URL,
},
}
4 changes: 2 additions & 2 deletions apps/docs/app/llms.txt/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ ${Object.entries(sections)

- [Full documentation content](${baseUrl}/llms-full.txt)
- Individual page content: ${baseUrl}/llms.mdx/[page-path]
- [API documentation](${baseUrl}/api-reference/)
- [Tool integrations](${baseUrl}/tools/)
- [API documentation](${baseUrl}/api-reference/getting-started)
- [Integrations](${baseUrl}/integrations)

## Statistics

Expand Down
1 change: 1 addition & 0 deletions apps/docs/app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export const revalidate = 3600
export default function sitemap(): MetadataRoute.Sitemap {
return source.getPages().map((page) => ({
url: `${DOCS_BASE_URL}${page.url}`,
lastModified: 'lastModified' in page.data ? page.data.lastModified : undefined,
}))
}
3 changes: 2 additions & 1 deletion apps/docs/components/navbar/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { usePathname } from 'next/navigation'
import { SearchTrigger } from '@/components/ui/search-trigger'
import { SimWordmark } from '@/components/ui/sim-logo'
import { ThemeToggle } from '@/components/ui/theme-toggle'
import { SIM_SITE_URL } from '@/lib/urls'
import { cn } from '@/lib/utils'

/**
Expand Down Expand Up @@ -82,7 +83,7 @@ export function Navbar() {

<div className='flex items-center gap-2'>
<ThemeToggle />
<ChipLink href='https://sim.ai' variant='primary'>
<ChipLink href={SIM_SITE_URL} variant='primary'>
Get started
</ChipLink>
</div>
Expand Down
1 change: 0 additions & 1 deletion apps/docs/components/structured-data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export function StructuredData({
headline: title,
description: description,
url: url,
...(dateModified && { datePublished: dateModified }),
...(dateModified && { dateModified }),
author: {
'@type': 'Organization',
Expand Down
10 changes: 5 additions & 5 deletions apps/docs/content/docs/api-reference/python.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ from simstudio import SimStudioClient
# Initialize the client
client = SimStudioClient(
api_key="your-api-key-here",
base_url="https://sim.ai" # optional, defaults to https://sim.ai
base_url="https://www.sim.ai" # optional; the default https://sim.ai redirects to this host
)

# Execute a workflow
Expand All @@ -53,7 +53,7 @@ SimStudioClient(api_key: str, base_url: str = "https://sim.ai")

**Parameters:**
- `api_key` (str): Your Sim API key
- `base_url` (str, optional): Base URL for the Sim API
- `base_url` (str, optional): Base URL for the Sim API (defaults to `https://sim.ai`, which redirects to `https://www.sim.ai`; set the `www` host explicitly)

#### Methods

Expand Down Expand Up @@ -678,7 +678,7 @@ def stream_workflow():

def generate():
response = requests.post(
'https://sim.ai/api/v2/workflows/WORKFLOW_ID/execute',
'https://www.sim.ai/api/v2/workflows/WORKFLOW_ID/execute',
headers={
'Content-Type': 'application/json',
'X-API-Key': os.getenv('SIM_API_KEY')
Expand Down Expand Up @@ -732,7 +732,7 @@ Configure the client using environment variables:
# Development configuration
client = SimStudioClient(
api_key=os.getenv("SIM_API_KEY"),
base_url=os.getenv("SIM_BASE_URL", "https://sim.ai")
base_url=os.getenv("SIM_BASE_URL", "https://www.sim.ai")
)
```
</Tab>
Expand All @@ -748,7 +748,7 @@ Configure the client using environment variables:

client = SimStudioClient(
api_key=api_key,
base_url=os.getenv("SIM_BASE_URL", "https://sim.ai")
base_url=os.getenv("SIM_BASE_URL", "https://www.sim.ai")
)
```
</Tab>
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/content/docs/api-reference/typescript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { SimStudioClient } from 'simstudio-ts-sdk';
// Initialize the client
const client = new SimStudioClient({
apiKey: 'your-api-key-here',
baseUrl: 'https://sim.ai' // optional, defaults to https://sim.ai
baseUrl: 'https://www.sim.ai' // optional; the default https://sim.ai redirects to this host
});

// Execute a workflow
Expand All @@ -68,7 +68,7 @@ new SimStudioClient(config: SimStudioConfig)

**Configuration:**
- `config.apiKey` (string): Your Sim API key
- `config.baseUrl` (string, optional): Base URL for the Sim API (defaults to `https://sim.ai`)
- `config.baseUrl` (string, optional): Base URL for the Sim API (defaults to `https://sim.ai`, which redirects to `https://www.sim.ai`; set the `www` host explicitly)

#### Methods

Expand Down Expand Up @@ -492,7 +492,7 @@ Configure the client using environment variables:

const client = new SimStudioClient({
apiKey,
baseUrl: process.env.SIM_BASE_URL || 'https://sim.ai'
baseUrl: process.env.SIM_BASE_URL || 'https://www.sim.ai'
});
```
</Tab>
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/chat/workflows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Sim can deploy a workflow as any of the three deployment types:

| Deployment type | What it creates |
|----------------|----------------|
| **API** | A REST endpoint at `https://sim.ai/api/v2/workflows/{id}/execute` |
| **API** | A REST endpoint at `https://www.sim.ai/api/v2/workflows/{id}/execute` |
| **Chat** | A hosted conversational interface with a shareable URL |
| **MCP tool** | An MCP server that exposes the workflow as a tool |

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/desktop/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Sim Desktop is the macOS app for your Sim workspace. Everything the web app does

## Download

**[Download Sim Desktop for macOS](https://sim.ai/api/desktop/update/download)**
**[Download Sim Desktop for macOS](https://www.sim.ai/api/desktop/update/download)**

One universal build runs natively on both Apple Silicon and Intel Macs. It is signed and notarized by Sim, so Gatekeeper accepts it with no override.

Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/files/passing-files.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ When calling a workflow via API that expects file input, include files in your r
<Tabs items={['Base64', 'URL']}>
<Tab value="Base64">
```bash
curl -X POST "https://sim.ai/api/v2/workflows/YOUR_WORKFLOW_ID/execute" \
curl -X POST "https://www.sim.ai/api/v2/workflows/YOUR_WORKFLOW_ID/execute" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
Expand All @@ -101,7 +101,7 @@ When calling a workflow via API that expects file input, include files in your r
</Tab>
<Tab value="URL">
```bash
curl -X POST "https://sim.ai/api/v2/workflows/YOUR_WORKFLOW_ID/execute" \
curl -X POST "https://www.sim.ai/api/v2/workflows/YOUR_WORKFLOW_ID/execute" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/integrations/hubspot-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This guide covers installing the integration, connecting a HubSpot account, conf

You need:

- A [Sim](https://sim.ai) account and a workspace where you have **Write** or **Admin** permission.
- A [Sim](https://www.sim.ai) account and a workspace where you have **Write** or **Admin** permission.
- A HubSpot account. To grant the requested scopes, your HubSpot user needs permission to install apps (typically a super admin).

## Install the app and connect HubSpot
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/introduction/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ For anything not built in, [MCP support](/agents/mcp) connects any external serv

## Deployment options

- **Cloud-hosted.** Launch immediately at [sim.ai](https://sim.ai) with managed infrastructure, scaling, and observability.
- **Cloud-hosted.** Launch immediately at [sim.ai](https://www.sim.ai) with managed infrastructure, scaling, and observability.
- **Self-hosted.** Deploy on your own infrastructure with Docker Compose or Kubernetes, with support for local models.

## Next steps
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/platform/costs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ Pro and Team plan users can buy additional credits at any time in **Settings →

## Next Steps

- Review your current usage in [Settings → Subscription](https://sim.ai/settings/subscription)
- Review your current usage in [Settings → Subscription](https://www.sim.ai/settings/subscription)
- Learn about [Logging](/logs-debugging/logging) to track run details
- Explore the [External API](/api-reference/getting-started) for programmatic cost monitoring
- Check out [workflow optimization techniques](/workflows#blocks) to reduce costs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ On the workflow API, setting `includeThinking` or `includeToolCalls` **without**
### Workflow API

```bash
curl -N https://sim.ai/api/v2/workflows/{id}/execute \
curl -N https://www.sim.ai/api/v2/workflows/{id}/execute \
-H "X-API-Key: $SIM_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Sim-Stream-Protocol: agent-events-v1" \
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/workflows/deployment/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ Every surface runs the same live snapshot. You manage them from the tabs of the
The most common surface is the **API**. Once deployed, your workflow answers at:

```
POST https://sim.ai/api/v2/workflows/{workflow-id}/execute
POST https://www.sim.ai/api/v2/workflows/{workflow-id}/execute
```

Send the workflow's [Input Format](/workflows/triggers/start) as the request body's `input` value. The response includes workflow output and execution metadata; see [API deployment](/workflows/deployment/api) for response modes.

```bash
curl -X POST https://sim.ai/api/v2/workflows/{workflow-id}/execute \
curl -X POST https://www.sim.ai/api/v2/workflows/{workflow-id}/execute \
-H "X-API-Key: $SIM_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "input": { "message": "Refund request from customer #4821" } }'
Expand Down
31 changes: 28 additions & 3 deletions apps/docs/lib/redirects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ import type { NextConfig } from 'next'
type DocsRedirect = Awaited<ReturnType<NonNullable<NextConfig['redirects']>>>[number]

/**
* Every redirect the docs site serves, in match order — Next applies the first
* Every unprefixed path redirect, in match order — Next applies the first
* matching rule.
*
* This lives outside `next.config.ts` so it can be read without evaluating that
* module. `createMDX()` runs at import time and bundles `source.config.ts`
* against `process.cwd()`, so importing the config from the root Vitest project
* fails with `The entry point "source.config.ts" cannot be marked as external`.
* `scripts/openapi/docs-redirects.test.ts` reads this array directly to keep the
* `scripts/openapi/docs-redirects.test.ts` reads `DOCS_REDIRECTS` directly to keep the
* `/api-reference/` rules honest against the specs.
*
* The whole table lives here rather than only the `/api-reference/` block: Next
* applies the first matching rule, so splitting one ordered list across two
* modules would make match order an emergent property of two files.
*/
export const DOCS_REDIRECTS: DocsRedirect[] = [
const PATH_REDIRECTS: DocsRedirect[] = [
...Object.entries(integrationNavigation.redirects).map(([from, to]) => ({
source: `/integrations/${from}`,
destination: `/integrations/${to}`,
Expand Down Expand Up @@ -390,3 +390,28 @@ export const DOCS_REDIRECTS: DocsRedirect[] = [
permanent: false,
},
]

/**
* Locale prefixes the docs served before translations were removed in #7247
* (`lib/i18n.ts` declared `en`, `es`, `fr`, `de`, `ja`, `zh`; `en` was hidden).
* Search engines still hold these URLs, so each one 308s to its English page.
*/
const RETIRED_LOCALE_PREFIX = '/:lang(en|es|fr|de|ja|zh)'

/**
* Every redirect the docs site serves, in match order — Next applies the first
* matching rule and does not chain them internally.
*
* Each path redirect is repeated under the retired locale prefix with the same
* destination, so `/fr/tools/x` lands on `/integrations/x` in one hop rather
* than stripping the locale and redirecting again. The trailing catch-all
* strips the prefix from every other path, which already resolves.
*/
export const DOCS_REDIRECTS: DocsRedirect[] = [
...PATH_REDIRECTS,
...PATH_REDIRECTS.map((rule) => ({
...rule,
source: rule.source === '/' ? RETIRED_LOCALE_PREFIX : `${RETIRED_LOCALE_PREFIX}${rule.source}`,
})),
{ source: `${RETIRED_LOCALE_PREFIX}/:path*`, destination: '/:path*', permanent: true },
]
14 changes: 7 additions & 7 deletions apps/docs/lib/urls.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export const DOCS_BASE_URL = process.env.NEXT_PUBLIC_DOCS_URL ?? 'https://docs.sim.ai'
import { SIM_DOCS_URL, SIM_SITE_URL } from '@sim/utils/site'

export const DOCS_BASE_URL = process.env.NEXT_PUBLIC_DOCS_URL ?? SIM_DOCS_URL

/**
* The public marketing site's fixed canonical origin — not `NEXT_PUBLIC_APP_URL`.
* That env var reflects wherever *this* deployment (self-hosted or otherwise)
* happens to run, but the footer's marketing links (`/blog`, `/enterprise`,
* `/models`, `/terms`, `/privacy`, …) only ever exist on sim.ai itself, so
* they must stay hardcoded to it regardless of where docs is hosted.
* The marketing site's canonical origin, never `NEXT_PUBLIC_APP_URL`: marketing
* links only exist on sim.ai, wherever docs is hosted.
*/
export const SIM_SITE_URL = 'https://sim.ai'
export { SIM_SITE_URL }
1 change: 1 addition & 0 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"dependencies": {
"@sim/db": "workspace:*",
"@sim/emcn": "workspace:*",
"@sim/utils": "workspace:*",
"@sim/workflow-renderer": "workspace:*",
"@xyflow/react": "12.11.3",
"class-variance-authority": "^0.7.1",
Expand Down
Loading
Loading