In about five minutes, you fetch published posts from a Lynkow site, first with curl, then with the lynkow SDK. You need no account. Next: Which API Should I Use?

Reference - This guide is a tutorial. For exhaustive, always-current signatures and field lists, see the auto-generated reference:

Prerequisites

  • A terminal with curl

  • Node.js 18 or later, with npm, for steps 2 and 3

Your first request

The steps use the docs demo site, a read-only Lynkow site anyone can read. Its Site ID is a779c43c-430e-45d1-8749-2144d7f60a0f.

1. Call the API with curl

Bash
curl "https://api.lynkow.com/storefront/a779c43c-430e-45d1-8749-2144d7f60a0f/contents?limit=3&locale=en"

The answer is JSON. data holds the three most recent published posts, and meta tells you where you are in the list:

text
{
  "data": [
    { "title": "...", "slug": "...", "publishedAt": "...", ... },
    ...
  ],
  "meta": { "total": ..., "perPage": 3, "currentPage": 1, "lastPage": ..., ... }
}

The response is shortened here: Pagination explains meta. Reading published content needs the Site ID only: no key and no token.

2. Install the SDK

Bash
mkdir lynkow-first-request && cd lynkow-first-request
npm init -y
npm install lynkow

3. Fetch the same posts with the SDK

Create first-request.mjs:

JavaScript
import { createClient } from 'lynkow'

const lynkow = createClient({ siteId: 'a779c43c-430e-45d1-8749-2144d7f60a0f', locale: 'en' })

const { data, meta } = await lynkow.contents.list({ limit: 3 })

console.log(`${meta.total} posts in total`)
for (const post of data) {
  console.log(`- ${post.title} (${post.slug})`)
}

Run it:

Bash
node first-request.mjs

You get the same posts as in step 1. The SDK builds the URL, parses the JSON, retries a read that failed for a temporary reason, and throws a LynkowError on an error (Errors).

Read products with the publishable key

Shop data (products, cart, checkout) also needs the site's publishable key, in the X-Lynkow-Pk header. The demo's key is lkw_pk_w5vgnv06vf4y8vg4xc8ast9p. It is public by design:

Bash
curl "https://api.lynkow.com/storefront/a779c43c-430e-45d1-8749-2144d7f60a0f/products?limit=3" \
  -H "X-Lynkow-Pk: lkw_pk_w5vgnv06vf4y8vg4xc8ast9p"

With the SDK, pass it to the client:

JavaScript
const lynkow = createClient({
  siteId: 'a779c43c-430e-45d1-8749-2144d7f60a0f',
  publishableKey: 'lkw_pk_w5vgnv06vf4y8vg4xc8ast9p',
})

const { data } = await lynkow.products.list({ limit: 3 })
console.log(data.map((product) => product.title))

Use your own site

  1. Create an account and a site at app.lynkow.com/register. The last screen of site creation shows the Site ID and a .env file for your project.

  2. Find the Site ID later under Settings > Developers > Storefront. The publishable key is on the same page, under Storefront keys.

  3. Install the SDK in your project with npm install lynkow, and replace a779c43c-430e-45d1-8749-2144d7f60a0f with your Site ID.

The examples above call the API from a terminal or a server. A browser call to the content routes is refused with 403 unless it comes from the site's domain or from a hostname listed under Allowed origins, on the same settings page. Add localhost there to call the API from your browser during development.

Authentication and Keys lists every credential, where to find it, and which ones to keep secret.

Start a new site from a template

create-lynkow-app generates a complete site wired to your Lynkow site: blog, pages, forms, reviews, search, a shop, sitemap and llms.txt. The code is yours to change.

Bash
npx create-lynkow-app@latest my-site --site-id <your-site-id>

It needs Node.js 20.9 or later, or 22.23.4 or later with --template astro. The main options:

Option

What it does

--template next or astro

The starter to generate. Default: next

--site-url <origin>

The site's public origin, such as https://www.example.com

--publishable-key <key>

The publishable key (lkw_pk_...), to serve the shop

--skills claude, cursor, agents or none

Install the Lynkow AI skills for your assistant. Default: claude

--yes

Use the defaults and never prompt

npx create-lynkow-app@latest --help lists every option. The pages read their content from site blocks: the generated AGENTS.md explains how to create them, and the project's README.md covers deployment. Build a Site with Astro walks through the Astro starter.

To add Lynkow to a project you already have, follow Add Lynkow to an Existing Project.

Optional: let your AI assistant do it

An AI coding assistant can generate the site and create its content blocks for you through the Lynkow MCP server, https://mcp.lynkow.com/mcp.

  1. Connect the server. In Claude Code, add it, then run /mcp and sign in with your Lynkow account, selecting only the site you are building:

    Bash
    claude mcp add --transport http lynkow https://mcp.lynkow.com/mcp

    An assistant that cannot sign in uses an API token instead, sent as Authorization: Bearer <token>. Create it under Settings > Developers > API with only sites.view, contents.view, site_blocks.view, site_blocks.create and site_blocks.publish, and avoid the MCP (Model Context Protocol) preset, which grants full access. Put the token in your user-level MCP configuration, never in a file inside the project, and revoke it once the setup is done.

  2. Give it this prompt, with your values:

    text
    Create my Lynkow site with create-lynkow-app, using the options listed in
    https://docs.lynkow.com/sdk/getting-started/quick-start.md
    Then follow the AGENTS.md of the generated project to create and publish its site blocks.
    
    - Lynkow site (its name or its ID): <your-site>
    - Folder to create: my-site

MCP Tools lists what the assistant can do on your site. Non-developers can connect Claude or ChatGPT from the dashboard: see Connect Claude or ChatGPT.

Next Steps