{"_id":"@anthaathi/chat-sdk-gitlab-adapter","_rev":"2-a9658eeb72c13769fd1f2c2faf85a5e4","name":"@anthaathi/chat-sdk-gitlab-adapter","dist-tags":{"latest":"4.27.0"},"versions":{"4.26.0":{"name":"@anthaathi/chat-sdk-gitlab-adapter","version":"4.26.0","keywords":["chat","gitlab","bot","adapter","merge-request","issue","code-review"],"license":"MIT","_id":"@anthaathi/chat-sdk-gitlab-adapter@4.26.0","maintainers":[{"name":"omkar.anthaathi","email":"omkar@anthaathi.org"}],"homepage":"https://github.com/anthaathi/chat-sdk-gitlab-adapter#readme","bugs":{"url":"https://github.com/anthaathi/chat-sdk-gitlab-adapter/issues"},"dist":{"shasum":"6192ef2cdca8bb30b8a71f2165dfcd9fffa42bfd","tarball":"https://registry.npmjs.org/@anthaathi/chat-sdk-gitlab-adapter/-/chat-sdk-gitlab-adapter-4.26.0.tgz","fileCount":4,"integrity":"sha512-EYIS68vBGEn8huI549oA3vqUsZdU/jnr97bEKMJwo9QKptbVnDbN336Ivks9d75CKZs45PkGMCBlOIPRYGABkQ==","signatures":[{"sig":"MEUCIQChAIwrEIQnuudcnC0R2g89SpRwDaRR5nXra/R4jrC5igIgau2EQMyp3dJkNzVOO4BpxI56+n+cplcmoLTuuLjOOv0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36504},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsup --watch","test":"vitest run --coverage","build":"tsup","clean":"rm -rf dist","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"omkar.anthaathi","email":"omkar@anthaathi.org"},"repository":{"url":"git+https://github.com/anthaathi/chat-sdk-gitlab-adapter.git","type":"git"},"_npmVersion":"11.12.1","description":"GitLab adapter for chat - merge request and issue note threads","directories":{},"_nodeVersion":"24.15.0","dependencies":{"chat":"4.26.0","@chat-adapter/shared":"4.26.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^4.0.18","typescript":"^5.7.2","@types/node":"^25.3.2","@vitest/coverage-v8":"^4.1.5"},"_npmOperationalInternal":{"tmp":"tmp/chat-sdk-gitlab-adapter_4.26.0_1776858395285_0.9403697286956443","host":"s3://npm-registry-packages-npm-production"}},"4.27.0":{"name":"@anthaathi/chat-sdk-gitlab-adapter","version":"4.27.0","description":"GitLab adapter for chat - merge request and issue note threads","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run --coverage","test:watch":"vitest","typecheck":"tsc --noEmit","clean":"rm -rf dist"},"dependencies":{"@chat-adapter/shared":"4.26.0","chat":"4.26.0"},"devDependencies":{"@types/node":"^25.3.2","@vitest/coverage-v8":"^4.1.5","tsup":"^8.3.5","typescript":"^5.7.2","vitest":"^4.0.18"},"repository":{"type":"git","url":"git+https://github.com/anthaathi/chat-sdk-gitlab-adapter.git"},"homepage":"https://github.com/anthaathi/chat-sdk-gitlab-adapter#readme","bugs":{"url":"https://github.com/anthaathi/chat-sdk-gitlab-adapter/issues"},"publishConfig":{"access":"public"},"keywords":["chat","gitlab","bot","adapter","merge-request","issue","code-review"],"license":"MIT","gitHead":"f635845df27aa2a63ea09efe945e99ba107021e5","_id":"@anthaathi/chat-sdk-gitlab-adapter@4.27.0","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-QQsRYRZi9JScQ5cyWOzZ8LYSVHOE4PJKjrR3TWzumo7AlDJ9I6lbNMvPiOvznW8MtNo4XmmEhIBIeVv1aRBrgw==","shasum":"42b3638014b21070e1db99b3b471bb533828025d","tarball":"https://registry.npmjs.org/@anthaathi/chat-sdk-gitlab-adapter/-/chat-sdk-gitlab-adapter-4.27.0.tgz","fileCount":4,"unpackedSize":37032,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAjdAwLjS5wdeLtPBTzqKESvK5/6mJyAVpPevU0aorQIAiAmNtZJ++Jfj8Oxq5PMbgQSk94c3/nXzESqADRrwUalmA=="}]},"_npmUser":{"name":"omkar.anthaathi","email":"omkar@anthaathi.org"},"directories":{},"maintainers":[{"name":"omkar.anthaathi","email":"omkar@anthaathi.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chat-sdk-gitlab-adapter_4.27.0_1776944545028_0.6205850293926585"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-22T11:46:35.175Z","modified":"2026-04-23T11:42:25.335Z","4.26.0":"2026-04-22T11:46:35.428Z","4.27.0":"2026-04-23T11:42:25.192Z"},"bugs":{"url":"https://github.com/anthaathi/chat-sdk-gitlab-adapter/issues"},"license":"MIT","homepage":"https://github.com/anthaathi/chat-sdk-gitlab-adapter#readme","keywords":["chat","gitlab","bot","adapter","merge-request","issue","code-review"],"repository":{"type":"git","url":"git+https://github.com/anthaathi/chat-sdk-gitlab-adapter.git"},"description":"GitLab adapter for chat - merge request and issue note threads","maintainers":[{"name":"omkar.anthaathi","email":"omkar@anthaathi.org"}],"readme":"# @anthaathi/chat-sdk-gitlab-adapter\n\nGitLab adapter for [Chat SDK](https://chat-sdk.dev). Respond to @mentions in merge request and issue note threads.\n\nThe GitLab adapter treats issue notes, merge request notes, and merge request discussions as messages.\n\n## Installation\n\n```bash\npnpm add @anthaathi/chat-sdk-gitlab-adapter\n```\n\n## Usage\n\nThe adapter auto-detects credentials from `GITLAB_TOKEN`, `GITLAB_WEBHOOK_SECRET`, `GITLAB_API_URL`, and `GITLAB_BOT_USERNAME` environment variables:\n\n```typescript\nimport { Chat } from \"chat\";\nimport { createGitLabAdapter } from \"@anthaathi/chat-sdk-gitlab-adapter\";\n\nconst bot = new Chat({\n  userName: \"my-bot\",\n  adapters: {\n    gitlab: createGitLabAdapter(),\n  },\n});\n\nbot.onNewMention(async (thread) => {\n  await thread.post(\"Hello from GitLab!\");\n});\n```\n\n## Authentication\n\nCreate a GitLab personal, project, or group access token with `api` access, then set:\n\n```bash\nGITLAB_TOKEN=glpat_xxxxxxxxxxxx\nGITLAB_WEBHOOK_SECRET=your-webhook-secret\n```\n\nYou can also pass configuration directly:\n\n```typescript\ncreateGitLabAdapter({\n  token: process.env.GITLAB_TOKEN!,\n  webhookSecret: process.env.GITLAB_WEBHOOK_SECRET!,\n  userName: \"my-bot\",\n});\n```\n\nFor self-managed GitLab:\n\n```typescript\ncreateGitLabAdapter({\n  apiUrl: \"https://gitlab.example.com/api/v4\",\n  token: process.env.GITLAB_TOKEN!,\n  webhookSecret: process.env.GITLAB_WEBHOOK_SECRET!,\n});\n```\n\n## Webhook Setup\n\nFor project or group webhooks:\n\n1. Go to **Settings** then **Webhooks**.\n2. Set **URL** to `https://your-domain.com/api/webhooks/gitlab`.\n3. Set **Secret token** to match `webhookSecret`.\n4. Enable **Comments** events.\n\nGitLab sends the secret in the `X-Gitlab-Token` header. This adapter validates that token.\n\n## Thread Model\n\n| Type | Context | Thread ID format |\n|------|---------|------------------|\n| Merge request note | MR overview notes | `gitlab:{namespace}/{project}:mr:{iid}` |\n| Merge request discussion | MR discussion thread | `gitlab:{namespace}/{project}:mr:{iid}:discussion:{discussionId}` |\n| Issue note | Issue notes | `gitlab:{namespace}/{project}:issue:{iid}` |\n\nNamespaces can be nested. For example:\n\n```text\ngitlab:acme/platform/app:mr:42\n```\n\n## Reactions\n\nSupports GitLab award emoji on issue and merge request notes:\n\n| SDK emoji | GitLab award emoji |\n|-----------|--------------------|\n| `thumbs_up` | `thumbsup` |\n| `thumbs_down` | `thumbsdown` |\n| `laugh` | `laugh` |\n| `confused` | `confused` |\n| `heart` | `heart` |\n| `hooray` | `hooray` |\n| `rocket` | `rocket` |\n| `eyes` | `eyes` |\n\n## Configuration\n\n| Option | Required | Description |\n|--------|----------|-------------|\n| `token` | Yes* | GitLab access token. Auto-detected from `GITLAB_TOKEN` |\n| `webhookSecret` | Yes* | GitLab webhook secret token. Auto-detected from `GITLAB_WEBHOOK_SECRET` |\n| `apiUrl` | No | GitLab API URL. Auto-detected from `GITLAB_API_URL`; defaults to `https://gitlab.com/api/v4` |\n| `userName` | No | Bot username. Auto-detected from `GITLAB_BOT_USERNAME`; defaults to `gitlab-bot` |\n| `botUserId` | No | Bot's numeric GitLab user ID |\n| `logger` | No | Logger instance |\n\n*Required via config or environment variable.\n","readmeFilename":"README.md"}