-
Update NPM access
-
In the root of your Sanity project, create a
.npmrcfile if it doesn’t exist. -
Generate a classic GitHub token.
-
Add the scope
read:packages. -
Paste the token into
.npmrc://npm.pkg.github.com/:_authToken={yout-auth-token} @lilt:registry=https://npm.pkg.github.com always-auth=true
-
-
Install the plugin You can use either NPM or Yarn:
npm install @lilt/[email protected] # or yarn add @lilt/[email protected]
-
Update
sanity.config.tsImport and register the plugin:import { defineConfig } from 'sanity' import { liltPlugin } from '@lilt/sanity-plugin' export default defineConfig({ // ... plugins: [ liltPlugin(), // other plugins... ] // ... })
This plugin depends on Sanity’s documentInternationalization plugin to handle multilingual document structures.
Make sure you have it installed and configured before enabling the Lilt plugin:
npm install @sanity/document-internationalizationThen add it to your sanity.config.ts:
import { documentInternationalization } from '@sanity/document-internationalization'
export default defineConfig({
// ...
plugins: [
documentInternationalization({
// configure your supported languages here
supportedLanguages: [
{ id: 'en', title: 'English' },
{ id: 'de', title: 'German' },
{ id: 'fr', title: 'French' },
],
schemaTypes: ['page', 'post'], // schema types you want to translate
}),
liltPlugin(),
]
})