@intlayer/docs 9.0.0-canary.10 → 9.0.0-canary.11

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 (63) hide show
  1. package/dist/cjs/generated/docs.entry.cjs +20 -0
  2. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  3. package/dist/esm/generated/docs.entry.mjs +20 -0
  4. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  5. package/dist/types/generated/docs.entry.d.ts +1 -0
  6. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  7. package/docs/ar/intlayer_CMS.md +16 -1
  8. package/docs/ar/releases/v9.md +58 -1
  9. package/docs/ar/self_hosting.md +349 -0
  10. package/docs/bn/intlayer_CMS.md +570 -0
  11. package/docs/bn/releases/v9.md +358 -0
  12. package/docs/cs/releases/v9.md +358 -0
  13. package/docs/de/intlayer_CMS.md +117 -1
  14. package/docs/de/releases/v9.md +61 -1
  15. package/docs/de/self_hosting.md +349 -0
  16. package/docs/en/intlayer_CMS.md +171 -1
  17. package/docs/en/releases/v9.md +45 -2
  18. package/docs/en/self_hosting.md +349 -0
  19. package/docs/en-GB/intlayer_CMS.md +16 -1
  20. package/docs/en-GB/releases/v9.md +47 -2
  21. package/docs/en-GB/self_hosting.md +349 -0
  22. package/docs/es/intlayer_CMS.md +117 -1
  23. package/docs/es/releases/v9.md +61 -1
  24. package/docs/es/self_hosting.md +349 -0
  25. package/docs/fr/intlayer_CMS.md +117 -1
  26. package/docs/fr/releases/v9.md +61 -1
  27. package/docs/fr/self_hosting.md +349 -0
  28. package/docs/hi/intlayer_CMS.md +16 -1
  29. package/docs/hi/releases/v9.md +59 -1
  30. package/docs/hi/self_hosting.md +349 -0
  31. package/docs/id/releases/v9.md +31 -1
  32. package/docs/id/self_hosting.md +349 -0
  33. package/docs/it/intlayer_CMS.md +117 -1
  34. package/docs/it/releases/v9.md +61 -1
  35. package/docs/it/self_hosting.md +349 -0
  36. package/docs/ja/intlayer_CMS.md +191 -10
  37. package/docs/ja/releases/v9.md +31 -1
  38. package/docs/ja/self_hosting.md +349 -0
  39. package/docs/ko/intlayer_CMS.md +189 -6
  40. package/docs/ko/releases/v9.md +30 -1
  41. package/docs/ko/self_hosting.md +349 -0
  42. package/docs/nl/releases/v9.md +358 -0
  43. package/docs/pl/intlayer_CMS.md +16 -1
  44. package/docs/pl/releases/v9.md +58 -1
  45. package/docs/pl/self_hosting.md +349 -0
  46. package/docs/pt/intlayer_CMS.md +117 -1
  47. package/docs/pt/releases/v9.md +61 -1
  48. package/docs/pt/self_hosting.md +349 -0
  49. package/docs/ru/intlayer_CMS.md +196 -15
  50. package/docs/ru/releases/v9.md +59 -1
  51. package/docs/ru/self_hosting.md +349 -0
  52. package/docs/tr/intlayer_CMS.md +16 -1
  53. package/docs/tr/releases/v9.md +46 -1
  54. package/docs/tr/self_hosting.md +349 -0
  55. package/docs/uk/intlayer_CMS.md +16 -1
  56. package/docs/uk/releases/v9.md +58 -1
  57. package/docs/uk/self_hosting.md +349 -0
  58. package/docs/vi/releases/v9.md +31 -1
  59. package/docs/vi/self_hosting.md +349 -0
  60. package/docs/zh/releases/v9.md +31 -1
  61. package/docs/zh/self_hosting.md +349 -0
  62. package/package.json +6 -6
  63. package/src/generated/docs.entry.ts +20 -0
@@ -0,0 +1,349 @@
1
+ ---
2
+ createdAt: 2026-06-30
3
+ updatedAt: 2026-06-30
4
+ title: Self-Hosting Intlayer
5
+ description: Esegui un'istanza Intlayer completa sulla tua infrastruttura con un singolo comando. Non è richiesto alcun account Intlayer Cloud.
6
+ keywords:
7
+ - Self-Hosting
8
+ - Docker
9
+ - Docker Compose
10
+ - Intlayer
11
+ - CMS
12
+ - Installation
13
+ - Infrastructure
14
+ slugs:
15
+ - doc
16
+ - self-hosting
17
+ author: aymericzip
18
+ ---
19
+
20
+ # Self-Hosting Intlayer
21
+
22
+ Intlayer può essere eseguito interamente sulla tua infrastruttura — non è richiesto alcun account Intlayer Cloud. Un singolo comando avvia uno stack pronto per la produzione:
23
+
24
+ ```sh
25
+ curl -fsSL https://intlayer.org/install.sh | sh
26
+ ```
27
+
28
+ L'installer scarica un `docker-compose.yml` e un `.env`, genera automaticamente i segreti richiesti e avvia tutti i container con `docker compose up -d`.
29
+
30
+ ## Indice dei Contenuti
31
+
32
+ <TOC/>
33
+
34
+ ---
35
+
36
+ ## Architettura
37
+
38
+ ```
39
+ ┌─────────────────────────────┐
40
+ browser ──────▶ │ app (TanStack Start) :3000│ ──┐
41
+ └─────────────────────────────┘ │ VITE_BACKEND_URL
42
+ ┌─────────────────────────────┐ │
43
+ │ backend (Fastify/Bun) :3100│ ◀─┘
44
+ └──────────────┬──────────────┘
45
+ ┌──────────┬─────────┼──────────┬───────────┐
46
+ ▼ ▼ ▼ ▼ ▼
47
+ mongo:27017 redis:6379 minio:9000 mailpit:1025 Chromium
48
+ (1-node RS) (S3 API) (SMTP) (in-image)
49
+ minio:9001 mailpit:8025
50
+ (console) (web UI)
51
+ ```
52
+
53
+ Chromium (utilizzato per la generazione di screenshot con Puppeteer) è incluso nell'immagine del backend — non è necessario un container separato.
54
+
55
+ ---
56
+
57
+ ## Prerequisiti
58
+
59
+ - **Docker** ≥ 24 e **Docker Compose** ≥ v2. Se uno dei due manca, l'installer stampa il link di installazione ed esce.
60
+ - Porte `3000`, `3100`, `8025`, `9000` e `9001` disponibili sull'host.
61
+ - Un host Linux o macOS (o WSL2 su Windows).
62
+
63
+ ---
64
+
65
+ ## Avvio rapido
66
+
67
+ ```sh
68
+ curl -fsSL https://intlayer.org/install.sh | sh
69
+ ```
70
+
71
+ Cosa fa l'installer:
72
+
73
+ 1. Verifica che `docker` e `docker compose` siano presenti.
74
+ 2. Scarica `docker-compose.yml` e `.env.example` in `./intlayer/`.
75
+ 3. Se non esiste un `.env`, copia l'esempio e genera segreti casuali per `BETTER_AUTH_SECRET`, `S3_ACCESS_KEY_ID` e `S3_SECRET_ACCESS_KEY` tramite `openssl rand`.
76
+ 4. Esegue `docker compose pull` + `docker compose up -d`.
77
+ 5. Stampa gli URL: dashboard `:3000`, API `:3100`, interfaccia utente email `:8025`, console MinIO `:9001`.
78
+
79
+ Dopo che lo stack è attivo, apri **http://localhost:3000** e crea il tuo primo account.
80
+
81
+ ---
82
+
83
+ ## Servizi
84
+
85
+ | Servizio | Immagine | Porta/e host | Scopo |
86
+ | ----------- | ------------------------------------ | ------------------------------ | ------------------------------------------------------------- |
87
+ | **app** | built from `apps/app/Dockerfile` | `3000` | Dashboard TanStack Start (UI del CMS) |
88
+ | **backend** | built from `apps/backend/Dockerfile` | `3100` | API REST Fastify (endpoint `/health`) |
89
+ | **mongo** | `mongo:7` | internal | Replica set a nodo singolo (`rs0`) |
90
+ | **redis** | `redis:7-alpine` | internal | Code di lavoro (BullMQ) e caching (ioredis) |
91
+ | **minio** | `minio/minio` | `9000` (S3), `9001` (console) | Storage di oggetti compatibile con S3 per avatar e screenshot |
92
+ | **mailpit** | `axllent/mailpit` | `1025` (SMTP), `8025` (web UI) | Sink di email transazionali locale |
93
+
94
+ Le porte interne (mongo, redis) non sono esposte all'host per impostazione predefinita.
95
+
96
+ > La porta `9000` di MinIO deve essere raggiungibile dal browser perché gli asset caricati (avatar, screenshot) vengono caricati direttamente da `S3_PUBLIC_URL=http://localhost:9000/intlayer`.
97
+
98
+ ---
99
+
100
+ ## Variabili d'ambiente
101
+
102
+ L'installer genera un `.env` pronto all'uso. La tabella seguente descrive ogni variabile.
103
+
104
+ ### Obbligatorie (generate automaticamente o richieste)
105
+
106
+ | Variabile | Esempio | Descrizione |
107
+ | ---------------------- | ----------------------------------------------- | ----------------------------------------------------------------------- |
108
+ | `NODE_ENV` | `production` | Ambiente di runtime |
109
+ | `PORT` | `3100` | Porta di ascolto del backend |
110
+ | `BACKEND_URL` | `http://localhost:3100` | URL pubblico dell'API del backend |
111
+ | `APP_URL` | `http://localhost:3000` | URL pubblico della dashboard |
112
+ | `DOMAIN` | `localhost` | Dominio del cookie |
113
+ | `MONGODB_URI` | `mongodb://mongo:27017/intlayer?replicaSet=rs0` | URI di connessione completo di MongoDB |
114
+ | `REDIS_URL` | `redis://redis:6379` | URL di connessione di Redis |
115
+ | `BETTER_AUTH_SECRET` | _(generated)_ | Segreto di 32 byte per la firma della sessione |
116
+ | `MAIL_PROVIDER` | `smtp` | Trasporto email: `smtp` o `resend` |
117
+ | `MAIL_SMTP_HOST` | `mailpit` | Hostname SMTP (nome del container Mailpit) |
118
+ | `MAIL_SMTP_PORT` | `1025` | Porta SMTP |
119
+ | `MAIL_FROM` | `Intlayer <no-reply@localhost>` | Indirizzo del mittente |
120
+ | `S3_ENDPOINT` | `http://minio:9000` | Endpoint compatibile con S3 |
121
+ | `S3_PUBLIC_URL` | `http://localhost:9000/intlayer` | URL pubblico per il caricamento degli asset del browser |
122
+ | `S3_BUCKET_NAME` | `intlayer` | Nome del bucket |
123
+ | `S3_ACCESS_KEY_ID` | _(generated)_ | Chiave di accesso MinIO |
124
+ | `S3_SECRET_ACCESS_KEY` | _(generated)_ | Chiave segreta MinIO |
125
+ | `VITE_BACKEND_URL` | `http://localhost:3100` | URL del backend integrato nella dashboard al momento della compilazione |
126
+ | `VITE_DOMAIN` | `localhost` | Dominio integrato nella dashboard al momento della compilazione |
127
+
128
+ ### Opzionali (le funzionalità degradano elegantemente se assenti)
129
+
130
+ | Variabile | Funzionalità |
131
+ | -------------------------------------------------------- | ------------------------------------------------------------------------- |
132
+ | `OPENAI_API_KEY` | Traduzione assistita da AI e audit del contenuto |
133
+ | `STRIPE_SECRET_KEY`, `STRIPE_WEBHOOK_SECRET`, `STRIPE_*` | Gestione della fatturazione e degli abbonamenti |
134
+ | `RESEND_API_KEY` | Email transazionali tramite Resend (sostituisce Mailpit quando impostato) |
135
+ | `GITHUB_CLIENT_ID`, `GITHUB_CLIENT_SECRET` | Accesso OAuth di GitHub |
136
+ | `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` | Accesso OAuth di Google |
137
+ | `GITLAB_CLIENT_ID`, `GITLAB_CLIENT_SECRET` | Accesso OAuth di GitLab |
138
+ | `MICROSOFT_CLIENT_ID`, `MICROSOFT_CLIENT_SECRET` | Accesso OAuth di Microsoft |
139
+ | `LINKEDIN_CLIENT_ID`, `LINKEDIN_CLIENT_SECRET` | Accesso OAuth di LinkedIn |
140
+ | `ATLASSIAN_CLIENT_ID`, `ATLASSIAN_CLIENT_SECRET` | Accesso OAuth di Atlassian |
141
+
142
+ ---
143
+
144
+ ## Collegamento del tuo progetto Intlayer
145
+
146
+ Una volta che lo stack è in esecuzione, punta il tuo progetto al backend e alla dashboard self-hosted invece di `intlayer.org`.
147
+
148
+ ### Configurazione del progetto
149
+
150
+ ```typescript fileName="intlayer.config.ts" codeFormat={["typescript", "esm", "commonjs"]}
151
+ import type { IntlayerConfig } from "intlayer";
152
+
153
+ const config: IntlayerConfig = {
154
+ editor: {
155
+ clientId: process.env.INTLAYER_CLIENT_ID,
156
+ clientSecret: process.env.INTLAYER_CLIENT_SECRET,
157
+
158
+ /**
159
+ * URL della dashboard CMS self-hosted.
160
+ * Predefinito: https://app.intlayer.org
161
+ */
162
+ cmsURL: process.env.INTLAYER_CMS_URL, // e.g. http://localhost:3000
163
+
164
+ /**
165
+ * URL dell'API del backend self-hosted.
166
+ * Predefinito: https://back.intlayer.org
167
+ */
168
+ backendURL: process.env.INTLAYER_BACKEND_URL, // e.g. http://localhost:3100
169
+ },
170
+ };
171
+
172
+ export default config;
173
+ ```
174
+
175
+ Imposta le variabili d'ambiente nel `.env` del tuo progetto:
176
+
177
+ ```sh
178
+ INTLAYER_CMS_URL=http://localhost:3000
179
+ INTLAYER_BACKEND_URL=http://localhost:3100
180
+ INTLAYER_CLIENT_ID=<your-client-id>
181
+ INTLAYER_CLIENT_SECRET=<your-client-secret>
182
+ ```
183
+
184
+ Crea le credenziali di accesso nella tua dashboard self-hosted sotto **Progetti → Chiavi di accesso** all'indirizzo `http://localhost:3000/projects`.
185
+
186
+ ### SDK `@intlayer/api`
187
+
188
+ Quando si utilizza l'SDK `@intlayer/api` in modo programmatico, passa `backendURL` esplicitamente:
189
+
190
+ ```typescript fileName="cms.ts" codeFormat="typescript"
191
+ import { createIntlayerCMS } from "@intlayer/api";
192
+ import { dictionaryEndpoint } from "@intlayer/api/dictionary";
193
+
194
+ const cms = createIntlayerCMS({
195
+ editor: {
196
+ clientId: process.env.INTLAYER_CLIENT_ID,
197
+ clientSecret: process.env.INTLAYER_CLIENT_SECRET,
198
+ backendURL: process.env.INTLAYER_BACKEND_URL, // http://localhost:3100
199
+ },
200
+ });
201
+
202
+ const { data: dictionaries } = await dictionaryEndpoint(cms).getDictionaries();
203
+ ```
204
+
205
+ ---
206
+
207
+ ## Aggiornamento
208
+
209
+ Eseguire nuovamente l'installer su un'implementazione esistente esegue un aggiornamento rolling:
210
+
211
+ ```sh
212
+ curl -fsSL https://intlayer.org/install.sh | sh
213
+ ```
214
+
215
+ Questo scarica le immagini più recenti e riavvia i container con `docker compose pull && docker compose up -d`. I volumi esistenti (`mongo-data`, `redis-data`, `minio-data`) vengono preservati — nessuna perdita di dati.
216
+
217
+ Per aggiornare manualmente dalla directory `./intlayer/`:
218
+
219
+ ```sh
220
+ docker compose pull
221
+ docker compose up -d
222
+ ```
223
+
224
+ ---
225
+
226
+ ## Backup e ripristino
227
+
228
+ Tutti i dati persistenti risiedono in tre volumi Docker nominati.
229
+
230
+ ### Backup
231
+
232
+ ```sh
233
+ docker run --rm \
234
+ -v intlayer_mongo-data:/data \
235
+ -v "$(pwd)":/backup \
236
+ busybox tar czf /backup/mongo-data.tar.gz /data
237
+
238
+ docker run --rm \
239
+ -v intlayer_redis-data:/data \
240
+ -v "$(pwd)":/backup \
241
+ busybox tar czf /backup/redis-data.tar.gz /data
242
+
243
+ docker run --rm \
244
+ -v intlayer_minio-data:/data \
245
+ -v "$(pwd)":/backup \
246
+ busybox tar czf /backup/minio-data.tar.gz /data
247
+ ```
248
+
249
+ ### Ripristino
250
+
251
+ ```sh
252
+ docker run --rm \
253
+ -v intlayer_mongo-data:/data \
254
+ -v "$(pwd)":/backup \
255
+ busybox tar xzf /backup/mongo-data.tar.gz -C /
256
+
257
+ # Ripetere per redis-data e minio-data
258
+ ```
259
+
260
+ ---
261
+
262
+ ## Utilizzo di un reverse proxy (Nginx / Caddy)
263
+
264
+ Per le implementazioni in produzione, posiziona un reverse proxy davanti ai container dell'app e del backend invece di esporli direttamente.
265
+
266
+ ### Esempio Nginx
267
+
268
+ ```nginx
269
+ server {
270
+ listen 80;
271
+ server_name cms.example.com;
272
+
273
+ location / {
274
+ proxy_pass http://localhost:3000;
275
+ proxy_set_header Host $host;
276
+ proxy_set_header X-Real-IP $remote_addr;
277
+ }
278
+ }
279
+
280
+ server {
281
+ listen 80;
282
+ server_name api.example.com;
283
+
284
+ location / {
285
+ proxy_pass http://localhost:3100;
286
+ proxy_set_header Host $host;
287
+ proxy_set_header X-Real-IP $remote_addr;
288
+ }
289
+ }
290
+ ```
291
+
292
+ Aggiorna le seguenti variabili `.env` per corrispondere ai tuoi domini pubblici:
293
+
294
+ ```sh
295
+ BACKEND_URL=https://api.example.com
296
+ APP_URL=https://cms.example.com
297
+ DOMAIN=example.com
298
+ VITE_BACKEND_URL=https://api.example.com
299
+ VITE_DOMAIN=example.com
300
+ ```
301
+
302
+ > Le variabili `VITE_*` sono integrate nell'immagine della dashboard al momento della compilazione. Se le modifichi dopo che l'immagine è stata compilata, devi ricostruire l'immagine `app` (`docker compose build app`) o utilizzare l'iniezione della configurazione a runtime.
303
+
304
+ ---
305
+
306
+ ## Risoluzione dei problemi
307
+
308
+ ### Il backend si riavvia in loop al primo avvio
309
+
310
+ MongoDB e Redis devono essere sani prima che il backend si avvii. Il file compose utilizza `depends_on` con `condition: service_healthy`. Se vedi ripetuti riavvii del backend, verifica che i controlli di integrità di `mongo` e `redis` passino:
311
+
312
+ ```sh
313
+ docker compose ps
314
+ docker compose logs mongo
315
+ docker compose logs redis
316
+ ```
317
+
318
+ ### La dashboard non riesce a raggiungere l'API
319
+
320
+ Verifica che `VITE_BACKEND_URL` corrisponda all'URL dove il backend è raggiungibile dal **browser** (non dalla rete Docker). Se hai cambiato la porta del backend o aggiunto un reverse proxy, ricostruisci l'immagine della dashboard:
321
+
322
+ ```sh
323
+ docker compose build app
324
+ docker compose up -d app
325
+ ```
326
+
327
+ ### Email non inviate
328
+
329
+ Per impostazione predefinita, tutte le email in uscita vengono catturate da Mailpit. Apri `http://localhost:8025` per vedere i messaggi inviati. Per inviare email reali, imposta `MAIL_PROVIDER=resend` e `RESEND_API_KEY=<la-tua-chiave>` in `.env`, quindi riavvia il backend:
330
+
331
+ ```sh
332
+ docker compose restart backend
333
+ ```
334
+
335
+ ### Bucket MinIO mancante
336
+
337
+ Se il servizio one-shot `minio-init` non è stato eseguito (o è stato eseguito prima che MinIO fosse pronto), crea il bucket manualmente:
338
+
339
+ ```sh
340
+ docker compose run --rm minio-init
341
+ ```
342
+
343
+ ---
344
+
345
+ ## Link utili
346
+
347
+ - [Documentazione Intlayer CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/intlayer_CMS.md)
348
+ - [Riferimento alla configurazione](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/configuration.md)
349
+ - [SDK CMS — `@intlayer/api`](https://github.com/aymericzip/intlayer/blob/main/docs/docs/it/intlayer_CMS.md#programmatic-access-con-l-sdk-intlayerapi)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2025-08-23
3
- updatedAt: 2025-08-23
3
+ updatedAt: 2026-06-29
4
4
  title: Intlayer CMS | コンテンツをIntlayer CMSに外部化する
5
5
  description: コンテンツ管理をチームに委任するために、コンテンツをIntlayer CMSに外部化します。
6
6
  keywords:
@@ -18,6 +18,12 @@ slugs:
18
18
  - cms
19
19
  youtubeVideo: https://www.youtube.com/watch?v=UDDTnirwi_4
20
20
  history:
21
+ - version: 9.0.0
22
+ date: 2026-06-30
23
+ changes: "「セルフホスティング」セクションを追加: Docker Composeブートストラップ、サービスインベントリ、SDK設定、オプション機能、アップグレードノート"
24
+ - version: 9.0.0
25
+ date: 2026-06-29
26
+ changes: "プログラムによるCMSアクセスに関する @intlayer/api SDK (createIntlayerCMS) セクションを追加"
21
27
  - version: 6.0.1
22
28
  date: 2025-09-22
23
29
  changes: "ライブ同期のドキュメントを追加"
@@ -241,12 +247,162 @@ bun x intlayer dictionary push -d my-first-dictionary-key --env production
241
247
 
242
248
  その後、[Intlayer CMS](https://app.intlayer.org/content) で辞書を確認および管理できるようになります。
243
249
 
250
+ ## `@intlayer/api` SDK を使用したプログラムによるアクセス
251
+
252
+ CLI およびビジュアルエディターを超えて、Intlayer は [`@intlayer/api`](https://www.npmjs.com/package/@intlayer/api) パッケージで型付き SDK を提供しています。これにより、CMS を**ヘッドレスコンテンツデータベース**として扱うことができます。プロジェクトの取得、辞書の取得、および独自のアプリケーション、スクリプト、または CI パイプラインから直接、それらをプッシュまたは更新できます。
253
+
254
+ SDK は認証を処理します。`clientId` と `clientSecret` が利用可能であれば(Intlayer の設定または環境変数で)、OAuth2 アクセストークンを自動的に取得および更新し、すべてのリクエストに署名します。
255
+
256
+ ### インストール
257
+
258
+ ```bash packageManager="npm"
259
+ npm install @intlayer/api
260
+ ```
261
+
262
+ ```bash packageManager="yarn"
263
+ yarn add @intlayer/api
264
+ ```
265
+
266
+ ```bash packageManager="pnpm"
267
+ pnpm add @intlayer/api
268
+ ```
269
+
270
+ ```bash packageManager="bun"
271
+ bun add @intlayer/api
272
+ ```
273
+
274
+ ### 仕組み: オーセンティケーター + エンドポイント
275
+
276
+ SDK は、バンドルサイズを小さくするために、意図的に**2つの別々のインポート**に分割されています。
277
+
278
+ 1. `createIntlayerCMS` — 軽量な**オーセンティケーター**を作成します。これは認証情報と管理されたアクセストークンのみを保持し、特定のドメインについては何も知りません。
279
+ 2. `dictionaryEndpoint`、`projectEndpoint`、… — ドメインごとの**エンドポイントバインダー**で、それぞれ独自のサブパス(`@intlayer/api/dictionary`、`@intlayer/api/project`、…)からインポートされます。必要なエンドポイントにオーセンティケーターを渡します。
280
+
281
+ 各エンドポイントは個別にインポートされるため、バンドルには実際に使用するドメインのみが含まれます。`dictionaryEndpoint` をインポートしても、プロジェクト、AI、その他のドメインクライアントがプルインされることはありません。
282
+
283
+ ```typescript fileName="cms.ts" codeFormat="typescript"
284
+ import { createIntlayerCMS } from "@intlayer/api";
285
+
286
+ // 設定はオプションです: 省略した場合、認証情報は
287
+ // `@intlayer/config/built` から読み込まれます。これは INTLAYER_CLIENT_ID および
288
+ // INTLAYER_CLIENT_SECRET 環境変数を解決します。
289
+ export const cmsAuthenticator = createIntlayerCMS();
290
+ ```
291
+
292
+ > [!WARNING]
293
+ > CMS の認証情報 (`clientId` / `clientSecret`) はコンテンツへの**書き込みアクセス**を許可します。オーセンティケーターは**サーバー側**(サーバーアクション、ルートハンドラー、スクリプト、CI)でのみ作成してください。クライアント側コードにインポートしたり、認証情報をブラウザに公開したりしないでください。
294
+
295
+ ビルド時の設定に依存しない場合は、認証情報を明示的に渡します。
296
+
297
+ ```typescript fileName="cms.ts" codeFormat="typescript"
298
+ import { createIntlayerCMS } from "@intlayer/api";
299
+
300
+ export const cmsAuthenticator = createIntlayerCMS({
301
+ editor: {
302
+ clientId: process.env.INTLAYER_CLIENT_ID,
303
+ clientSecret: process.env.INTLAYER_CLIENT_SECRET,
304
+ // オプション、セルフホスティングされたバックエンドの場合:
305
+ // backendURL: process.env.INTLAYER_BACKEND_URL,
306
+ },
307
+ });
308
+ ```
309
+
310
+ > 認証情報は、[Intlayer Dashboard - Projects](https://app.intlayer.org/projects) で新しいアクセスキーを作成して取得できます。
311
+
312
+ ### プロジェクトの取得
313
+
314
+ ```typescript fileName="projects.ts" codeFormat="typescript"
315
+ import { createIntlayerCMS } from "@intlayer/api";
316
+ import { projectEndpoint } from "@intlayer/api/project";
317
+
318
+ const cmsAuthenticator = createIntlayerCMS();
319
+
320
+ // 認証情報でアクセス可能なプロジェクトをリストアップ
321
+ const { data: projects } =
322
+ await projectEndpoint(cmsAuthenticator).getProjects();
323
+
324
+ // 選択したプロジェクトの集約されたローカライゼーションインサイトを読み取る
325
+ const { data: insights } =
326
+ await projectEndpoint(cmsAuthenticator).getProjectInsights();
327
+ ```
328
+
329
+ ### 辞書の取得
330
+
331
+ ```typescript fileName="read-dictionaries.ts" codeFormat="typescript"
332
+ import { createIntlayerCMS } from "@intlayer/api";
333
+ import { dictionaryEndpoint } from "@intlayer/api/dictionary";
334
+
335
+ const cmsAuthenticator = createIntlayerCMS();
336
+
337
+ // プロジェクトのすべてのリモート辞書をリストアップ
338
+ const { data: dictionaries } =
339
+ await dictionaryEndpoint(cmsAuthenticator).getDictionaries();
340
+
341
+ // またはキーで単一の辞書を取得
342
+ const { data: dictionary } = await dictionaryEndpoint(
343
+ cmsAuthenticator
344
+ ).getDictionary("my-first-dictionary-key");
345
+ ```
346
+
347
+ ### 辞書のプッシュと更新
348
+
349
+ CMS をデータベースとして使用してコンテンツを書き戻します。
350
+
351
+ ```typescript fileName="write-dictionaries.ts" codeFormat="typescript"
352
+ import { createIntlayerCMS } from "@intlayer/api";
353
+ import { dictionaryEndpoint } from "@intlayer/api/dictionary";
354
+
355
+ const cmsAuthenticator = createIntlayerCMS();
356
+
357
+ // 新しい辞書を作成
358
+ await dictionaryEndpoint(cmsAuthenticator).addDictionary({
359
+ key: "my-first-dictionary-key",
360
+ content: { title: "Hello world" },
361
+ });
362
+
363
+ // 辞書の一括Upsert (1回の呼び出しで作成または更新)
364
+ await dictionaryEndpoint(cmsAuthenticator).pushDictionaries([
365
+ { key: "home", content: { title: "Home" } },
366
+ { key: "about", content: { title: "About" } },
367
+ ]);
368
+
369
+ // 既存の辞書を更新
370
+ await dictionaryEndpoint(cmsAuthenticator).updateDictionary({
371
+ id: "<dictionary-id>",
372
+ key: "home",
373
+ content: { title: "Updated title" },
374
+ });
375
+ ```
376
+
377
+ > ヒント: 繰り返しを避けるためにバインドされたエンドポイントを再利用します。
378
+ >
379
+ > ```typescript codeFormat="typescript"
380
+ > const dictionary = dictionaryEndpoint(cmsAuthenticator);
381
+ > await dictionary.pushDictionaries([myDictionary]);
382
+ > const { data } = await dictionary.getDictionaries();
383
+ > ```
384
+
385
+ ### 単一メソッドの抽出
386
+
387
+ すべてのエンドポイントメソッドはすでに認証されており、スタンドアロンであるため(独自のトークン処理を保持しているため)、1つを抽出して渡すことができます。例えば、依存関係として注入する場合などです。
388
+
389
+ ```typescript fileName="push.ts" codeFormat="typescript"
390
+ import { createIntlayerCMS } from "@intlayer/api";
391
+ import { dictionaryEndpoint } from "@intlayer/api/dictionary";
392
+
393
+ const dictionary = dictionaryEndpoint(createIntlayerCMS());
394
+
395
+ // すでに認証済み — 呼び出しごとに自動的にトークンを更新します
396
+ export const pushDictionaries = dictionary.pushDictionaries;
397
+
398
+ // 使用方法
399
+ await pushDictionaries([{ key: "home", content: { title: "Home" } }]);
400
+ ```
401
+
244
402
  ## ライブ同期
245
403
 
246
404
  ライブ同期は、アプリが実行時に CMS のコンテンツ変更を反映できるようにします。再ビルドや再デプロイは不要です。有効にすると、更新がライブ同期サーバーにストリームされ、アプリケーションが読み込む辞書が更新されます。
247
405
 
248
- > Live Syncは継続的なサーバー接続を必要とし、エンタープライズプランで利用可能です。
249
-
250
406
  Intlayerの設定を更新してLive Syncを有効にします:
251
407
 
252
408
  ```typescript fileName="intlayer.config.ts" codeFormat={["typescript", "esm", "commonjs"]}
@@ -271,7 +427,7 @@ const config: IntlayerConfig = {
271
427
  /**
272
428
  * 辞書のインポート方法を制御します:
273
429
  *
274
- * - "live":辞書はLive Sync APIを使用して動的に取得されます。
430
+ * - "fetch":辞書はLive Sync APIを使用して動的に取得されます。
275
431
  * useIntlayerの代わりにuseDictionaryDynamicを使用します。
276
432
  *
277
433
  * 注意:ライブモードはLive Sync APIを使用して辞書を取得します。API呼び出しが
@@ -288,6 +444,19 @@ export default config;
288
444
 
289
445
  アプリケーションをラップするために Live Sync サーバーを起動します:
290
446
 
447
+ スタンドアロンサーバーを使用した例:
448
+
449
+ ```json5 fileName="package.json"
450
+ {
451
+ "scripts": {
452
+ // ... その他のスクリプト
453
+ "live:start": "npx intlayer live",
454
+ },
455
+ }
456
+ ```
457
+
458
+ `--process` 引数を使用して、アプリケーションサーバーと並行して使用することもできます。
459
+
291
460
  Next.js を使用した例:
292
461
 
293
462
  ```json5 fileName="package.json"
@@ -320,11 +489,11 @@ CMSからの変更通知を受け取るために、Live Syncサーバーはバ
320
489
 
321
490
  フローチャート(CMS/バックエンド -> Live Syncサーバー -> アプリケーションサーバー -> フロントエンド):
322
491
 
323
- ![Live Sync ロジックスキーマ](https://github.com/aymericzip/intlayer/blob/main/docs/assets/live_sync_logic_schema.svg)
492
+ ![Live Sync フロー CMS/バックエンド/Live Syncサーバー/アプリケーションサーバー/フロントエンド スキーマ](https://github.com/aymericzip/intlayer/blob/main/docs/assets/live_sync_flow_scema.svg)
324
493
 
325
494
  動作の仕組み:
326
495
 
327
- ![Live Sync フロー CMS/バックエンド/Live Syncサーバー/アプリケーションサーバー/フロントエンド スキーマ](https://github.com/aymericzip/intlayer/blob/main/docs/assets/live_sync_flow_scema.svg)
496
+ ![Live Sync ロジックスキーマ](https://github.com/aymericzip/intlayer/blob/main/docs/assets/live_sync_logic_schema.svg)
328
497
 
329
498
  ### 開発ワークフロー(ローカル)
330
499
 
@@ -356,7 +525,7 @@ const config: IntlayerConfig = {
356
525
  importMode: "fetch",
357
526
  },
358
527
  build: {
359
- optimize: true,
528
+ optimize: true, // default: process.env.NODE_ENV === 'production'
360
529
  },
361
530
  };
362
531
 
@@ -373,6 +542,18 @@ export default config;
373
542
  - `live`フラグはビルド時に各辞書ごとに評価されます。ビルド時にリモートコンテンツが`live=true`に設定されていなかった場合、その辞書のライブ同期を有効にするには再ビルドが必要です。
374
543
  - ライブ同期サーバーは`.intlayer`に書き込み可能でなければなりません。コンテナ環境では`/.intlayer`への書き込み権限を確保してください。
375
544
 
545
+ ## セルフホスティング
546
+
547
+ Intlayer は、独自のインフラストラクチャ上で完全に実行できます。Docker Compose を使用して、フルスタック(ダッシュボード、API、データベース、オブジェクトストレージ、メール)を1行でブートストラップできます。
548
+
549
+ ```sh
550
+ curl -fsSL https://intlayer.org/install.sh | sh
551
+ ```
552
+
553
+ 完全なセットアップガイド、環境変数リファレンス、アップグレード手順、バックアップ/復元手順については、[セルフホスティングガイド](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/self_hosting.md)を参照してください。
554
+
555
+ ---
556
+
376
557
  ## デバッグ
377
558
 
378
559
  CMSで問題が発生した場合は、以下を確認してください:
@@ -381,9 +562,9 @@ CMSで問題が発生した場合は、以下を確認してください:
381
562
 
382
563
  - [`editor`](https://intlayer.org/doc/concept/configuration#editor-configuration)の設定がIntlayerの設定ファイルで正しく行われていること。
383
564
  - 必須フィールド:
384
- - アプリケーションのURLは、エディター設定の `applicationURL` と一致している必要があります。
385
- - CMSのURL
565
+ - アプリケーションのURLは、エディター設定の `applicationURL` と一致している必要があります。
566
+ - CMSのURL
386
567
 
387
568
  - プロジェクトの設定がIntlayer CMSにプッシュされていることを確認してください。
388
569
 
389
- - ビジュアルエディターはiframeを使用してウェブサイトを表示します。ウェブサイトのコンテンツセキュリティポリシー(CSP)がCMSのURLを `frame-ancestors`(デフォルトは 'https://intlayer.org')として許可していることを確認してください。エディターのコンソールでエラーがないか確認してください。
570
+ - ビジュアルエディターはiframeを使用してウェブサイトを表示します。ウェブサイトのコンテンツセキュリティポリシー(CSP)がCMSのURLを `frame-ancestors`(デフォルトは 'https://app.intlayer.org')として許可していることを確認してください。エディターのコンソールでエラーがないか確認してください。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  createdAt: 2026-06-14
3
- updatedAt: 2026-06-26
3
+ updatedAt: 2026-06-29
4
4
  title: Intlayer v9の新機能
5
5
  description: Intlayer v9の新機能をご覧ください。主要なi18nライブラリ向けのドロップイン互換性パッケージと、コレクション、バリアントのサポートを導入します。
6
6
  keywords:
@@ -9,6 +9,7 @@ keywords:
9
9
  - Migration
10
10
  - Collections
11
11
  - Variants
12
+ - CMS SDK
12
13
  - i18next
13
14
  - next-intl
14
15
  - vue-i18n
@@ -299,6 +300,34 @@ npm install intlayer react-native-intlayer
299
300
 
300
301
  ---
301
302
 
303
+ ## CMS SDK: Intlayer をヘッドレスコンテンツデータベースとして使う
304
+
305
+ Intlayer v9 は、CMS をプログラムから操作するためのクリーンで自動認証される SDK を `@intlayer/api` に同梱しています。プロジェクトの取得、辞書の取得、そして自分のサーバー・スクリプト・CI からのプッシュや更新が可能です。認証(OAuth2 `client_credentials`)は自動的に処理・更新されます。
306
+
307
+ SDK は **2 つの独立したインポート** に分かれており、実際に使用するドメインだけがバンドルに含まれます。
308
+
309
+ 1. `createIntlayerCMS` — 資格情報と管理されるトークンを保持する軽量な **認証器**(ドメインクライアントは同梱されません)。
310
+ 2. `dictionaryEndpoint`、`projectEndpoint`、… — ドメインごとの **エンドポイントバインダー**。それぞれ独自のサブパスからインポートします。
311
+
312
+ ```ts fileName="cms.ts"
313
+ import { createIntlayerCMS } from "@intlayer/api";
314
+ import { dictionaryEndpoint } from "@intlayer/api/dictionary";
315
+
316
+ // 設定は任意です。資格情報は INTLAYER_CLIENT_ID /
317
+ // INTLAYER_CLIENT_SECRET(`@intlayer/config/built` により解決)にフォールバックします。
318
+ const cms = createIntlayerCMS();
319
+
320
+ // 読み取り
321
+ const { data: dictionaries } = await dictionaryEndpoint(cms).getDictionaries();
322
+
323
+ // 書き込み — CMS をデータベースのように使う
324
+ await dictionaryEndpoint(cms).pushDictionaries([myDictionary]);
325
+ ```
326
+
327
+ > セキュリティ: CMS の資格情報はコンテンツへの書き込みアクセスを許可します。認証器は必ず **サーバーサイド** でのみ作成し、`clientId` / `clientSecret` をブラウザーに送らないでください。
328
+
329
+ ---
330
+
302
331
  ## v8からの移行に関する注意点
303
332
 
304
333
  v8からアップグレードする場合、v9には破壊的変更は含まれていません。ただし、主な変更点は次のとおりです。
@@ -314,3 +343,4 @@ v8からアップグレードする場合、v9には破壊的変更は含まれ
314
343
  - [互換アダプターパッケージガイド](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/compat/index.md)
315
344
  - [動的辞書 - コレクション、バリアント](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/dynamic_dictionaries/index.md)
316
345
  - [設定リファレンス](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/configuration.md)
346
+ - [CMS SDK - @intlayer/api によるプログラムからのアクセス](https://github.com/aymericzip/intlayer/blob/main/docs/docs/ja/intlayer_CMS.md)