{"id":20023553,"url":"https://github.com/ttttonyhe/nexment","last_synced_at":"2026-03-02T01:01:32.127Z","repository":{"id":45042614,"uuid":"278978408","full_name":"ttttonyhe/nexment","owner":"ttttonyhe","description":"A feature-rich, framework-agnostic serverless comment library that you can put anywhere on the web","archived":false,"fork":false,"pushed_at":"2026-03-01T21:14:58.000Z","size":17909,"stargazers_count":38,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-01T21:44:51.640Z","etag":null,"topics":["comment-system","esbuild","leancloud","leancloud-storage","react","react-library","reactjs","typescript"],"latest_commit_sha":null,"homepage":"https://nexment-demo.ouorz.com","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/ttttonyhe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-12T02:43:36.000Z","updated_at":"2026-03-01T21:15:02.000Z","dependencies_parsed_at":"2024-06-20T08:41:56.744Z","dependency_job_id":"d07d970c-5f9b-4f9e-a40f-8dc492b17793","html_url":"https://github.com/ttttonyhe/nexment","commit_stats":null,"previous_names":["helipengtony/nexment"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ttttonyhe/nexment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttttonyhe%2Fnexment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttttonyhe%2Fnexment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttttonyhe%2Fnexment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttttonyhe%2Fnexment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttttonyhe","download_url":"https://codeload.github.com/ttttonyhe/nexment/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttttonyhe%2Fnexment/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29988484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T22:42:38.399Z","status":"ssl_error","status_checked_at":"2026-03-01T22:41:51.863Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["comment-system","esbuild","leancloud","leancloud-storage","react","react-library","reactjs","typescript"],"created_at":"2024-11-13T08:47:02.148Z","updated_at":"2026-03-02T01:01:32.028Z","avatar_url":"https://github.com/ttttonyhe.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://i.loli.net/2020/08/18/HSa25hE1bdZ9gCM.jpg\" /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003eA feature-rich serverless comment library powered by Supabase\u003c/p\u003e\n  \u003ca href=\"https://github.com/ttttonyhe/nexment/actions?query=workflow%3ACI\"\u003e\n    \u003cimg src=\"https://github.com/ttttonyhe/nexment/workflows/CI/badge.svg\" alt=\"github ci\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/nexment\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dw/nexment\" alt=\"npm downloads\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/nexment\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/l/nexment\" alt=\"license\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr/\u003e\n\n\u003cbr/\u003e\n\n## See also\n+ Nexment for Vue.js / Web Component (outdated, still based on Leancloud) [https://github.com/ttttonyhe/nexment-vue](https://github.com/ttttonyhe/nexment-vue)\n+ Nexment for React.js [https://github.com/ttttonyhe/nexment](https://github.com/ttttonyhe/nexment)\n\n\u003cbr/\u003e\n\n## Installation\n\n### Part I - Supabase\n\n1. Create a project on [Supabase](https://supabase.com)\n2. Go to **SQL Editor** and run the contents of [`migration/schema.sql`](./migration/schema.sql) to create the `nexment_comments` table\n3. Go to **Authentication** → **Providers** → **Email** and disable \"Confirm email\" (required for admin registration)\n4. Go to **Project Settings** → **API** and copy your **Project URL** and **Publishable** key\n\n\u003cbr/\u003e\n\n### Part II - Nexment\n\nAdd Nexment to your project:\n```shell\nnpm install nexment\n```\n\nImport and use:\n```jsx\nimport Nexment from \"nexment\"\n\nconst config = {\n  pageKey: \"xxx\", // optional, defaults to window.location.pathname\n  features: {\n    linkInput: true,\n    replyListModal: true,\n    replyEmailNotifications: true,\n    descriptionTag: true,\n  },\n  supabase: {\n    url: \"https://your-project.supabase.co\",\n    anonKey: \"your-anon-key\",\n  },\n  admin: {\n    name: \"xxx\",\n    email: \"xxx@xxx.xxx\",\n  },\n  blackList: [\n    { name: \"xxx\", email: \"xxx\", keyword: \"xxx\", link: \"xxx\" },\n    { keyword: \"xxx\" },\n  ],\n};\n\n\u003cNexment config={config} /\u003e\n```\n\n\u003cbr/\u003e\n\n## Use Nexment in Next.js\n\nCreate a wrapper component:\n```tsx\nimport Nexment from \"nexment\";\n\nconst NexmentComponent = () =\u003e {\n  const config = {\n    pageKey: \"xxx\",\n    features: {\n      linkInput: true,\n      replyListModal: true,\n      replyEmailNotifications: true,\n      descriptionTag: true,\n    },\n    supabase: {\n      url: \"https://your-project.supabase.co\",\n      anonKey: \"your-anon-key\",\n    },\n    admin: {\n      name: \"xxx\",\n      email: \"xxx@xxx.xxx\",\n    },\n  };\n\n  return \u003cNexment config={config} /\u003e;\n};\n\nexport default NexmentComponent;\n```\n\nImport it using `next/dynamic` to disable SSR:\n```tsx\nimport dynamic from \"next/dynamic\";\n\nconst NexmentDiv = dynamic(() =\u003e import(\"./NexmentComponent\"), {\n  ssr: false,\n});\n\nconst Page = () =\u003e {\n  return (\n    \u003cdiv\u003e\n      \u003cNexmentDiv /\u003e\n    \u003c/div\u003e\n  );\n};\n\nexport default Page;\n```\n\n\u003cbr/\u003e\n\n## Migrating from LeanCloud\n\nIf you were previously using the LeanCloud-based version of Nexment, follow these steps to migrate your data to Supabase:\n\n### 1. Export your LeanCloud data\n\nGo to your LeanCloud app → **Data Storage** → **Import/Export** → **Export** to download a backup. The backup will contain a `nexment_comments.0.jsonl` file with all your comments.\n\n### 2. Set up the Supabase table\n\nFollow the [Supabase setup instructions](#part-i---supabase) above to create the `nexment_comments` table.\n\n### 3. Run the migration script\n\n```shell\nnode migration/leancloud-to-supabase.mjs \u003cpath-to-backup-dir\u003e \u003coutput.sql\u003e\n```\n\nFor example:\n```shell\nnode migration/leancloud-to-supabase.mjs ./my-backup ./seed.sql\n```\n\nThis reads the `nexment_comments.0.jsonl` file from the backup directory and generates a `seed.sql` file containing INSERT statements for all your comments.\n\n### 4. Import the data\n\nPaste the contents of the generated `seed.sql` file into the Supabase **SQL Editor** and run it. All your comments (including reply threading) will be preserved.\n\n### 5. Update your config\n\nReplace the `leancloud` config with `supabase`:\n\n```diff\n  const config = {\n-   leancloud: {\n-     appId: \"xxx\",\n-     appKey: \"xxx\",\n-     serverURL: \"https://xxx\",\n-   },\n+   supabase: {\n+     url: \"https://your-project.supabase.co\",\n+     anonKey: \"your-anon-key\",\n+   },\n    admin: {\n      name: \"xxx\",\n      email: \"xxx@xxx.xxx\",\n    },\n  };\n```\n\nAn example LeanCloud backup is included in the [`backup/`](./backup) directory for reference.\n\n\u003cbr/\u003e\n\n## TypeScript Support\nNexment has full TypeScript type-checking support.\n\n\u003cbr/\u003e\n\n## Contribution\nFile an issue whenever you encounter a problem, pull requests are always welcomed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttttonyhe%2Fnexment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttttonyhe%2Fnexment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttttonyhe%2Fnexment/lists"}