> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rankbuddy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Publish your first article

> After your SDK-powered blog is deployed, connect RankBuddy and ship your first SEO-optimized post.

You deployed blog routes that read from the RankBuddy API. This guide connects your [RankBuddy](https://rankbuddy.io) workspace so content you publish appears on your site.

## Prerequisites

<Check>
  Blog routes are live at `{your-domain}{blogPath}` (for example `https://acme.com/blog`).
</Check>

<Check>
  `RANKBUDDY_API_KEY` is set in your **production** environment (server-only, never `NEXT_PUBLIC_`).
</Check>

<Check>
  Your RankBuddy project uses the **same website URL and blog path** you configured during onboarding.
</Check>

## Steps

<Steps>
  <Step title="Create a RankBuddy account">
    Sign up at [rankbuddy.io/auth/signup](https://rankbuddy.io/auth/signup). The free trial includes full access to article generation and publishing.
  </Step>

  <Step title="Confirm project settings">
    In RankBuddy, open your project and verify:

    * **Website** matches your live domain (e.g. `https://acme.com`)
    * **Content path** matches your blog route (e.g. `/blog`)

    Published articles resolve to: `website + content path + slug` → `https://acme.com/blog/my-article`.
  </Step>

  <Step title="Generate your first article">
    1. Open the AI writer or content planner.
    2. Pick a keyword cluster or enter a target keyword.
    3. Generate a draft, review and edit it in the editor.
    4. Set SEO fields (title, description, slug, cover image) before publishing.
  </Step>

  <Step title="Publish">
    Change status to **Published** (or schedule a time). RankBuddy stores the article in the API your blog already reads.

    Nothing goes live on your site until you explicitly publish — drafts never appear in `getArticlesList` or `getArticleBySlug`.
  </Step>

  <Step title="Verify on your site">
    1. Open `{blogPath}` — your new post should appear in the listing.
    2. Open `{blogPath}/{slug}` — full article, cover image, and metadata should render.

    <Note>
      If you use on-demand caching (`revalidate = false`), you may need to redeploy or call your revalidation endpoint once before the first publish appears. For the simplest first launch, use time-based revalidation (`revalidate = 3600`) as described in the [blog setup guide](/guides/setup-blog-with-sdk#caching).
    </Note>
  </Step>

  <Step title="Keep publishing">
    Use the content planner to schedule posts, track clusters, and grow organic traffic from [rankbuddy.io](https://rankbuddy.io).
  </Step>
</Steps>

## Get your API key

1. In RankBuddy, open **Settings → API keys** (or your project's integration settings).
2. Create a key with access to read published articles.
3. Add it to your hosting provider as `RANKBUDDY_API_KEY`.
4. Redeploy if the variable was added after the last deploy.

<Warning>
  Never expose `RANKBUDDY_API_KEY` in client components, browser bundles, or public repos.
</Warning>

## Troubleshooting

| Symptom                     | Likely cause                            | Fix                                                              |
| --------------------------- | --------------------------------------- | ---------------------------------------------------------------- |
| Empty blog index            | Wrong API key or project not publishing | Check env var and publish status in RankBuddy                    |
| 404 on article URL          | Slug mismatch or article still draft    | Confirm slug in RankBuddy matches URL                            |
| Stale content after publish | Static cache not refreshed              | Lower `revalidate` interval or add tag-based revalidation        |
| Build fails locally         | Missing API key at build time           | Provide key in CI or guard `generateStaticParams` with try/catch |
