@flocon-ai/react 0.0.0 → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +13 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -29,6 +29,13 @@ FLOCON_TOKEN=your_read_token
29
29
 
30
30
  Never commit it. Never send it to the browser.
31
31
 
32
+ Token not in `FLOCON_TOKEN`? Every helper that calls the API takes an optional `token`:
33
+
34
+ ```ts
35
+ await getPage({ path, token: myToken })
36
+ await floconSitemap({ url, token: myToken })
37
+ ```
38
+
32
39
  ## Page route (React Router v7, framework mode)
33
40
 
34
41
  ```tsx
@@ -54,6 +61,8 @@ export function meta({ data }: Route.MetaArgs) {
54
61
  return [
55
62
  { title: m.title },
56
63
  { name: "description", content: m.description },
64
+ // Free plan only: `m.generator` is "Flocon AI".
65
+ ...(m.generator ? [{ name: "generator", content: m.generator }] : []),
57
66
  { property: "og:type", content: m.openGraph.type },
58
67
  { property: "og:title", content: m.openGraph.title },
59
68
  { property: "og:description", content: m.openGraph.description },
@@ -75,9 +84,9 @@ export default function Page({ loaderData }: Route.ComponentProps) {
75
84
 
76
85
  - `getPage({ path, locale? })` returns the page, or `null` when it does not exist (return a 404).
77
86
  - `locale` is optional. No `locale` = the default locale of your website.
78
- - `<FloconPage page={page} />` does no fetching. It renders the blocks, the JSON-LD script and (Free plan) the "Made with Flocon AI" badge.
87
+ - `<FloconPage page={page} />` does no fetching. It renders the blocks, the JSON-LD script and (Free plan) the "❄ Made with Flocon AI · flocon-ai.com" badge (link to flocon-ai.com).
79
88
  - `url({ locale, path })` is **your** URL rule. The lib adds no prefix of its own.
80
- - `getFloconMetadata({ page, url })` returns plain data: `title`, `description`, `keywords`, `canonical`, `languages` (hreflang, with `x-default`), `openGraph`, `twitter`. Put it in the `<head>` the way your framework does. It sets no OG image.
89
+ - `getFloconMetadata({ page, url })` returns plain data: `title`, `description`, `keywords`, `canonical`, `languages` (hreflang, with `x-default`), `openGraph`, `twitter`. Put it in the `<head>` the way your framework does. It sets no OG image. On the Free plan, it also returns `generator: "Flocon AI"` (for `<meta name="generator">`).
81
90
 
82
91
  ## Sitemap and llms.txt
83
92
 
@@ -102,6 +111,7 @@ export async function loader() {
102
111
  ```
103
112
 
104
113
  Both list **published** pages only. `floconSitemap` returns XML with hreflang links.
114
+ On the Free plan, `llms.txt` ends with a "Made with [Flocon AI](https://flocon-ai.com)" line.
105
115
  `getAllPages()` gives you the same list if you need it.
106
116
 
107
117
  ## Theming
@@ -124,7 +134,7 @@ The CSS is added by `<FloconPage />`. Nothing to import.
124
134
  | `getAllPages` | All published pages (light) |
125
135
  | `floconSitemap`, `floconLlmsTxt` | Sitemap XML and `llms.txt` text |
126
136
  | `createFloconClient` | Typed Packages API client (server only) |
127
- | types | `PageEntry`, `UrlOption`, `FloconPageData`, `paths`, `components` |
137
+ | types | `PageEntry`, `UrlOption`, `TokenOption`, `FloconPageData`, `paths`, `components` |
128
138
 
129
139
  ## Docs
130
140
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flocon-ai/react",
3
- "version": "0.0.0",
3
+ "version": "0.0.1",
4
4
  "description": "Flocon AI pages for server-rendered React",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",