# NexoFlow developer docs: Content API, SDK and site key

Source: https://nexoflow.ai/docs

What a site built from code needs to show the posts its NexoFlow team publishes: the Content API (https://nexoflow.net/api/v1), the nexoflow-sdk TypeScript package (v0.3.8) and the site key. A site whose code is on GitHub gets the code from a NexoFlow pull request and only needs the key in its hosting.

## Quick start

1. Install the package: npm install nexoflow-sdk (or pnpm add nexoflow-sdk). It has no dependencies and full TypeScript types, and runs on the server: Node 18+, edge runtimes, Deno and Bun.
2. Add your site key: in NexoFlow, Connections, Website, Site key. It's shown once, so put it straight into your hosting as NEXOFLOW_API_KEY.
3. Read your posts on the server: new NexoFlow({ apiKey: process.env.NEXOFLOW_API_KEY }) then nf.posts.list({ limit: 12 }). List them, fetch one by slug with its HTML, or iterate through all of them. Each post comes with its SEO fields and a ready-made path.

Without the SDK: curl "https://nexoflow.net/api/v1/content/posts?limit=12" -H "Authorization: Bearer $NEXOFLOW_API_KEY".

If your site's code is on GitHub, NexoFlow writes the code for you in a pull request, with plain fetch and no package added. Only step 2, the key in your hosting, is yours.

## Your site key

The site key is the Content API key for one website. It starts with pk_live_ and goes in every request as Authorization: Bearer. In NexoFlow, open Connections, then Website, then Site key: choose Create key, or Show key for a key nobody has seen yet. NexoFlow shows a key once, so copy it straight into your hosting's environment settings as NEXOFLOW_API_KEY.

- Server only: the key is a secret. Never put it in a browser bundle, a client component or a URL. The API refuses keys sent as ?key=, and it doesn't answer browsers calling from other sites.
- Lost it: choose Make new key under Site key. Only one key works at a time, so the old one stops working right away and the site stops loading posts until the hosting has the new one. Revoke key turns the key off without a replacement.
- Connected: any request the site makes with the key tells NexoFlow the site is connected. The Site key row shows when the site last used it.

```bash
curl https://nexoflow.net/api/v1/content/site-settings \
  -H "Authorization: Bearer $NEXOFLOW_API_KEY"
```

## Connecting through GitHub

When the site's code is on GitHub, you don't write the integration. In Connections, under Website, sign in with GitHub, choose your site's code and press Connect my site. NexoFlow prepares the change that adds your blog in an isolated workspace that never sees your secrets, and it arrives as a pull request for you to review. Nothing changes on the site until you merge it. The pull request adds:

- A small server-only helper that reads the Content API with fetch. No package is added and no lockfile changes.
- The blog list at /blog, or at the address the blog already has, with page links.
- Post pages at the address the permalink setting gives (each post's path), with the title, meta description and robots tags taken from the post.
- The posts in the sitemap, and a Blog link in the navigation if it has none.
- A check address, /api/nexoflow/health, that tells NexoFlow whether the site can read its posts. It never returns the key.

Posts the site already has, in Markdown files or from another service, stay at their addresses. The key is never in the code: the pull request only names the setting.

1. After you merge: in your hosting's environment settings, add NEXOFLOW_API_KEY with your site key as its value, then redeploy (Vercel: Settings, Environment Variables; Netlify: Site configuration, Environment variables; Cloudflare Pages: Settings, Variables and Secrets; your own server: the app's .env file).
2. Until the key is there, a new blog shows "No posts yet." and the build still passes.
3. After the deploy, /api/nexoflow/health on the site answers "connected": true, and the Website row in Connections turns green once the site loads its first posts.

Wiring it up by hand: follow the quick start, and add the same check address so Chat can tell whether the site reads its posts. It calls the posts list with the key on the server and answers one of these, never with the key or any part of it:

```json
{ "ok": true, "provider": "nexoflow", "connected": true, "configured": true }
{ "ok": false, "provider": "nexoflow", "connected": false, "configured": false }
```

## Browse the docs

- [Content API reference](https://nexoflow.ai/docs/reference): base URL, the Bearer key, every endpoint (posts, site settings, structured data, llms.txt, images, revalidate, verify), its fields and its errors.
- [nexoflow-sdk overview](https://nexoflow.ai/docs/sdk): install, quick start, server-side rules and the response envelope.
- [Configuration](https://nexoflow.ai/docs/sdk/configuration): timeouts, retries, ISR hints, a custom fetch, debug logs and hooks.
- [Posts](https://nexoflow.ai/docs/sdk/posts): list, get, all, slugs and iter, the fields worth knowing, and examples.
- [Errors](https://nexoflow.ai/docs/sdk/errors): NexoFlowError, its status, code, trace id and flags, and the API's statuses.
- [Frameworks & types](https://nexoflow.ai/docs/sdk/frameworks): Next.js, Nuxt, SvelteKit, Astro, Remix, Express and edge runtimes.

The package is on npm as nexoflow-sdk, under the MIT license.

## Where the Content API fits

NexoFlow changes a website in one of three ways, depending on how the site is built. Only a site built from code reads its posts through the Content API; on WordPress and on Wix or Squarespace there's nothing to code.

- WordPress: changes arrive through the NexoFlow plugin (or an application password). Install the plugin; no code.
- Built from code, on GitHub: pull requests NexoFlow opens, and posts through the Content API. Merge the pull request that adds your blog, then add the site key to your hosting.
- Wix or Squarespace: the NexoFlow blog widget. Add the widget to your site.

Code changes run in isolated workspaces that never see your secrets, and pull requests stay drafts until your site's checks pass. Merges happen only on your OK.

## Using an AI assistant instead

From Claude, Cursor or any MCP client, connect to https://nexoflow.net/mcp. It signs in with OAuth, and its tokens can be rotated or revoked. It reads your Search Console keywords, reviews and content, and it can draft and schedule posts, but never publish on the spot: scheduling is at least 30 minutes ahead, so it can be cancelled. Every client's setup is at https://nexoflow.ai/mcp. It's separate from the site key.

Apart from MCP, there's no public API for your SEO data. The Content API serves your published posts, site settings, structured data, llms.txt and post images to your own site.

## Need a hand?

For how the app works, see the help centre (https://nexoflow.ai/help). For anything else, email hello@nexoflow.net or read the FAQ (https://nexoflow.ai/faq). Security questions are answered at https://nexoflow.ai/security.