{"id":28581097,"url":"https://github.com/lessify/localess-react","last_synced_at":"2026-01-25T11:06:59.650Z","repository":{"id":289254102,"uuid":"959794731","full_name":"Lessify/localess-react","owner":"Lessify","description":"Localess React Library. It provides a simple way to interact with the Localess API from your React application.","archived":false,"fork":false,"pushed_at":"2025-05-07T09:19:59.000Z","size":146,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-06T05:20:50.753Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lessify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["Lessify"]}},"created_at":"2025-04-03T11:13:47.000Z","updated_at":"2025-05-07T09:20:04.000Z","dependencies_parsed_at":"2025-04-22T11:33:54.907Z","dependency_job_id":null,"html_url":"https://github.com/Lessify/localess-react","commit_stats":null,"previous_names":["lessify/localess-react"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lessify%2Flocaless-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lessify%2Flocaless-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lessify%2Flocaless-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lessify%2Flocaless-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lessify","download_url":"https://codeload.github.com/Lessify/localess-react/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lessify%2Flocaless-react/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259197999,"owners_count":22820155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-11T04:15:35.256Z","updated_at":"2026-01-25T11:06:59.617Z","avatar_url":"https://github.com/Lessify.png","language":"TypeScript","funding_links":["https://github.com/sponsors/Lessify"],"categories":[],"sub_categories":[],"readme":"\u003cbr/\u003e\n\u003cbr/\u003e\n\u003cimg src=\"https://github.com/Lessify/localess/wiki/img/logo-adaptive.svg\" alt=\"logo\"\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n----\n\n# Localess React\n\nThis client SDK is designed to work with the Localess API. It provides a simple way to interact with the Localess API from your React application.\n\n## Installation\n\n### NPM\n````bash\nnpm install @localess/react\n````\n\n### Yarn\n````bash\nyarn add @localess/react\n````\n\n## Usage\n\n### Initialize and Visual Editor\n````tsx\nimport { localessInit } from \"@localess/react\";\nimport { Page, Header, Teaser, Footer } from \"@/components\"\n\nlocalessInit({\n  origin: \"https://my-localess.web.app\",\n  spaceId: \"I1LoVe2LocaLess4Rever\",\n  token: \"Baz00KaT0KeN8S3CureLL\",\n  enableSync: true, //Enable Visual Editor Sync Script,\n  components: {\n    'page': Page,\n    'header': Header,\n    'teaser': Teaser,\n    'footer': Footer,\n  },\n})\n````\n\n### React Component\nExample of Header Component with Menu Items\n\n````tsx\nimport { llEditable, LocalessComponent } from \"@localess/react\";\n\nconst Header = ({data}) =\u003e {\n  return (\n    \u003cnav {...llEditable(data)}\u003e\n      {data.items.map(item =\u003e \u003cLocalessComponent key={item._id} data={item} /\u003e)}\n    \u003c/nav\u003e\n  )\n}\n````\n\n### Listen for Visual Editor Events\nYour application can subscribe to the Localess Visual Editor Events.\nExample from NextJS 15\n\n````tsx\nimport { llEditable, LocalessComponent, getLocalessClient } from \"@localess/react\";\n\nexport default async function Page({searchParams}: {\n  searchParams: Promise\u003c{ [key: string]: string | string[] | undefined }\u003e\n}) {\n  const {locale} = await searchParams\n  const {data} = await fetchData(locale?.toString());\n  const [ pageData, setPageData ] = useState(data);\n  \n  \n  if (window.localess) {\n    window.localess.on(['input', 'change'], (event) =\u003e {\n      if (event.type === 'input' || event.type === 'change') {\n        setPageData(event.data);\n      }\n    });\n  }\n  return (\n    \u003cmain {...llEditable(data)}\u003e\n      {data.body.map(item =\u003e \u003cLocalessComponent key={item._id} data={item} /\u003e)}\n    \u003c/main\u003e\n  )\n}\n\nasync function fetchData(locale?: string): Promise\u003cContent\u003cPage\u003e\u003e {\n  const client = getLocalessClient(); // Get LocalessClient Initlialized before\n  return client.getContentBySlug\u003cPage\u003e('home', {locale: locale ? locale : undefined});\n}\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flessify%2Flocaless-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flessify%2Flocaless-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flessify%2Flocaless-react/lists"}