{"_id":"@burdenoff/botlit-sdk","_rev":"12-5cc5924ea6ec6f1488c897137832fb0f","name":"@burdenoff/botlit-sdk","dist-tags":{"latest":"2026.731.1"},"versions":{"2026.419.1":{"name":"@burdenoff/botlit-sdk","version":"2026.419.1","keywords":["algoshred","botlit","graphql","sdk","typescript","api-client"],"author":{"url":"https://github.com/tvvignesh","name":"Vignesh T.V"},"license":"UNLICENSED","_id":"@burdenoff/botlit-sdk@2026.419.1","maintainers":[{"name":"burdenoffcorp","email":"support@burdenoff.com"}],"dist":{"shasum":"8a7c9442e0d744fb9332d38a2ef0ee832c62a983","tarball":"https://registry.npmjs.org/@burdenoff/botlit-sdk/-/botlit-sdk-2026.419.1.tgz","fileCount":21,"integrity":"sha512-QdtS1vro9RzPfH25Mjet2ZcCtyfiOO7pSwaw2fNK0QkwqKDU5Ly1RgxoHCBH8SNnlbC4Dy1vvT8GJZZmTB4McQ==","signatures":[{"sig":"MEUCIBR9T1tOZm0SkvA7p7SA7/zb+yzl71ZwRxpd8tILZHdUAiEApDLd3bFjSJ7FKpJE1SVZL4lPUFr1etjXYJ11dcW9Twk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60636},"main":"dist/index.js","_from":"file:/home/vignesh/products/hetzner/temp/work/verdaccio-pkgs/@burdenoff__botlit-sdk/2026.419.1.tgz","types":"dist/index.d.ts","engines":{"bun":">=1.3.10","node":">=16.0.0"},"scripts":{"dev":"tsx watch src/index.ts","lint":"eslint src --fix","test":"vitest","audit":"bunx better-npm-audit audit --audit-level moderate","build":"tsc && tsc-alias","clean":"rimraf dist","format":"prettier --write \"src/**/*.{ts,js,json,md}\"","prepare":"bun run generate:types && bun run build","test:ui":"vitest --ui","validate":"bun run type-check && bun run lint:check && bun run test","lint:check":"eslint src","type-check":"tsc --noEmit","build:watch":"tsc -w","dev:example":"tsx examples/basic-usage.ts","format:check":"prettier --check \"src/**/*.{ts,js,json,md}\"","test:coverage":"vitest --coverage","generate:types":"graphql-codegen --config codegen.yml","prepublishOnly":"bun run clean && bun run build","dev:auth-example":"tsx examples/authentication-flow.ts"},"_npmUser":{"name":"burdenoffcorp","email":"support@burdenoff.com"},"_resolved":"/home/vignesh/products/hetzner/temp/work/verdaccio-pkgs/@burdenoff__botlit-sdk/2026.419.1.tgz","overrides":{"tmp":"0.2.5","vite":"7.1.11","yaml":">=2.8.3","axios":">=1.15.0","lodash":">=4.17.21","swiper":">=12.1.2","flatted":">=3.4.1","dompurify":">=3.3.4","immutable":">=3.8.3","lodash-es":">=4.17.21","minimatch":">=3.1.3","picomatch":">=2.3.2","smol-toml":">=1.6.1","@xmldom/xmldom":">=0.8.12","brace-expansion":">=1.1.13","fast-xml-parser":">=4.5.5","follow-redirects":">=1.15.12"},"_integrity":"sha512-QdtS1vro9RzPfH25Mjet2ZcCtyfiOO7pSwaw2fNK0QkwqKDU5Ly1RgxoHCBH8SNnlbC4Dy1vvT8GJZZmTB4McQ==","_npmVersion":"11.6.2","description":"TypeScript SDK for Boilerplate API","directories":{},"_nodeVersion":"24.12.0","dependencies":{"graphql":"^16.11.0","cross-fetch":"^4.1.0","graphql-request":"^7.2.0"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.10.4","tsx":"^4.20.3","eslint":"^9.32.0","rimraf":"^6.0.1","vitest":"^3.2.4","prettier":"^3.6.2","tsc-alias":"^1.8.16","@vitest/ui":"^3.2.4","typescript":"^5.8.3","@types/node":"^24.1.0","@vitest/coverage-v8":"^3.2.4","@graphql-codegen/cli":"^5.0.7","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.3","@typescript-eslint/parser":"^8.38.0","@graphql-codegen/typescript":"^4.1.6","@typescript-eslint/eslint-plugin":"^8.38.0","@graphql-codegen/typescript-operations":"^4.6.1","@graphql-codegen/typescript-graphql-request":"^6.3.0"},"_npmOperationalInternal":{"tmp":"tmp/botlit-sdk_2026.419.1_1778472233960_0.2952413004217922","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed: the package is now @burdenoff/botmanor-sdk (Botlit is now Botmanor). Install @burdenoff/botmanor-sdk instead."},"2026.512.1":{"name":"@burdenoff/botlit-sdk","version":"2026.512.1","keywords":["algoshred","botlit","graphql","sdk","typescript","api-client"],"author":{"url":"https://github.com/tvvignesh","name":"Vignesh T.V"},"license":"UNLICENSED","_id":"@burdenoff/botlit-sdk@2026.512.1","maintainers":[{"name":"burdenoffcorp","email":"support@burdenoff.com"}],"dist":{"shasum":"3aa2de55d372e36da62c6fbfb7731a2463b975c0","tarball":"https://registry.npmjs.org/@burdenoff/botlit-sdk/-/botlit-sdk-2026.512.1.tgz","fileCount":21,"integrity":"sha512-N1pUJzd+ydbVosbft3sFoUWXFTdgD60fbypl3E8anH4auNV47jbN+RihMhvu7Hgsty+nXpLM0aJeoEVLXPJbkg==","signatures":[{"sig":"MEYCIQDP/jFsjaCotI7iS0OGnrHCbQNvv1UAqmVln4qRDwp1KgIhAI4A6SNISdwGuhFnoWZPkvicmvz5zZDLbroNesA4vPIK","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":60636},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"bun":">=1.3.10","node":">=16.0.0"},"gitHead":"5b458be697db2bca57031e27bf1300642bb0c1e7","scripts":{"dev":"tsx watch src/index.ts","lint":"eslint src --fix","test":"vitest","audit":"bunx better-npm-audit audit --audit-level moderate","build":"tsc && tsc-alias","clean":"rimraf dist","format":"prettier --write \"src/**/*.{ts,js,json,md}\"","prepare":"bun run generate:types && bun run build","test:ui":"vitest --ui","validate":"bun run type-check && bun run lint:check && bun run test","lint:check":"eslint src","type-check":"tsc --noEmit","build:watch":"tsc -w","dev:example":"tsx examples/basic-usage.ts","format:check":"prettier --check \"src/**/*.{ts,js,json,md}\"","test:coverage":"vitest --coverage","generate:types":"graphql-codegen --config codegen.yml","prepublishOnly":"bun run clean && bun run build","dev:auth-example":"tsx examples/authentication-flow.ts"},"_npmUser":{"name":"burdenoffcorp","email":"support@burdenoff.com"},"overrides":{"tmp":"0.2.5","vite":"7.1.11","yaml":">=2.8.3","axios":">=1.15.0","lodash":">=4.17.21","swiper":">=12.1.2","flatted":">=3.4.1","dompurify":">=3.3.4","immutable":">=3.8.3","lodash-es":">=4.17.21","minimatch":">=3.1.3","picomatch":">=2.3.2","smol-toml":">=1.6.1","@xmldom/xmldom":">=0.8.12","brace-expansion":">=1.1.13","fast-xml-parser":">=4.5.5","follow-redirects":">=1.15.12"},"_npmVersion":"11.14.1","description":"TypeScript SDK for Boilerplate API","directories":{},"_nodeVersion":"20.20.2","dependencies":{"graphql":"^16.11.0","cross-fetch":"^4.1.0","graphql-request":"^7.2.0"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.10.4","tsx":"^4.20.3","eslint":"^9.32.0","rimraf":"^6.0.1","vitest":"^3.2.4","prettier":"^3.6.2","tsc-alias":"^1.8.16","@vitest/ui":"^3.2.4","typescript":"^5.8.3","@types/node":"^24.1.0","@vitest/coverage-v8":"^3.2.4","@graphql-codegen/cli":"^5.0.7","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.3","@typescript-eslint/parser":"^8.38.0","@graphql-codegen/typescript":"^4.1.6","@typescript-eslint/eslint-plugin":"^8.38.0","@graphql-codegen/typescript-operations":"^4.6.1","@graphql-codegen/typescript-graphql-request":"^6.3.0"},"_npmOperationalInternal":{"tmp":"tmp/botlit-sdk_2026.512.1_1778589784277_0.6317194817170331","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed: the package is now @burdenoff/botmanor-sdk (Botlit is now Botmanor). Install @burdenoff/botmanor-sdk instead."},"2026.723.1":{"name":"@burdenoff/botlit-sdk","version":"2026.723.1","keywords":["algoshred","botlit","graphql","sdk","typescript","api-client"],"author":{"url":"https://github.com/tvvignesh","name":"Vignesh T.V"},"license":"UNLICENSED","_id":"@burdenoff/botlit-sdk@2026.723.1","maintainers":[{"name":"burdenoffcorp","email":"support@burdenoff.com"}],"dist":{"shasum":"b615dae87fd1583c13955b57964d5be1bad86740","tarball":"https://registry.npmjs.org/@burdenoff/botlit-sdk/-/botlit-sdk-2026.723.1.tgz","fileCount":23,"integrity":"sha512-zwnNyfJq1oPjpJdBydBns7V+FxwawcPfX0+FthQdwReikxmOzcRxoWHynCOFd2xPU1WIoPbv2VQCzp480MVL7Q==","signatures":[{"sig":"MEUCIC/shjRw+7qNuVxTd300qd6dUKXVAq7pkfdDEnpQfYJTAiEAkVP+x+FHYhgXxnscZtZ6PK5wBpcLF1bWDfxOgDWMt9o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":66361},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"bun":">=1.3.10","node":">=16.0.0"},"gitHead":"a7d2edb5c5d17dcd8fbe096e8bc64e2e8cb665eb","scripts":{"dev":"tsx watch src/index.ts","lint":"eslint src --fix","test":"vitest run","audit":"bunx better-npm-audit audit --audit-level moderate","build":"tsc && tsc-alias","clean":"rimraf dist .eslintcache","format":"prettier --write \"src/**/*.{ts,js,json,md}\" \"test/**/*.{ts,js}\"","sanity":"bun run format:check && bun run lint:sanity && bun run type-check && bun run test && bun run build","prepare":"bun run generate:types && bun run build","test:ui":"vitest --ui","validate":"bun run type-check && bun run lint:check && bun run test","lint:check":"eslint src","test:watch":"vitest","type-check":"tsc --noEmit","build:watch":"tsc -w","dev:example":"tsx examples/basic-usage.ts","lint:sanity":"if [ \"${CI:-}\" = \"true\" ]; then bun run lint:check; else bun run lint:check -- --cache --cache-location .eslintcache; fi","format:check":"prettier --check \"src/**/*.{ts,js,json,md}\" \"test/**/*.{ts,js}\"","test:coverage":"vitest run --coverage","generate:types":"graphql-codegen --config codegen.yml","prepublishOnly":"bun run clean && bun run build","dev:auth-example":"tsx examples/authentication-flow.ts"},"_npmUser":{"name":"burdenoffcorp","email":"support@burdenoff.com"},"overrides":{"tmp":"0.2.5","vite":"7.1.11","yaml":">=2.8.3","axios":">=1.15.0","lodash":">=4.17.21","swiper":">=12.1.2","flatted":">=3.4.1","dompurify":">=3.3.4","immutable":">=3.8.3","lodash-es":">=4.17.21","minimatch":">=3.1.3","picomatch":">=2.3.2","smol-toml":">=1.6.1","@xmldom/xmldom":">=0.8.12","brace-expansion":">=1.1.13","fast-xml-parser":">=4.5.5","follow-redirects":">=1.15.12"},"_npmVersion":"12.0.1","description":"Official TypeScript SDK for Botlit","directories":{},"_nodeVersion":"22.23.1","dependencies":{"graphql":"^16.11.0","cross-fetch":"^4.1.0","graphql-request":"^7.2.0"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.10.4","tsx":"^4.20.3","eslint":"^9.32.0","rimraf":"^6.0.1","vitest":"^3.2.4","prettier":"^3.6.2","tsc-alias":"^1.8.16","@vitest/ui":"^3.2.4","typescript":"^5.8.3","@types/node":"^24.1.0","@vitest/coverage-v8":"^3.2.4","@graphql-codegen/cli":"^5.0.7","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.3","@typescript-eslint/parser":"^8.38.0","@graphql-codegen/typescript":"^4.1.6","@typescript-eslint/eslint-plugin":"^8.38.0","@graphql-codegen/typescript-operations":"^4.6.1","@graphql-codegen/typescript-graphql-request":"^6.3.0"},"_npmOperationalInternal":{"tmp":"tmp/botlit-sdk_2026.723.1_1784790734586_0.9662294981448027","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed: the package is now @burdenoff/botmanor-sdk (Botlit is now Botmanor). Install @burdenoff/botmanor-sdk instead."},"2026.731.1":{"name":"@burdenoff/botlit-sdk","version":"2026.731.1","keywords":["algoshred","botlit","graphql","sdk","typescript","api-client"],"author":{"url":"https://github.com/tvvignesh","name":"Vignesh T.V"},"license":"UNLICENSED","_id":"@burdenoff/botlit-sdk@2026.731.1","maintainers":[{"name":"burdenoffcorp","email":"support@burdenoff.com"}],"dist":{"shasum":"7c52eeff2e0b5a1d0ecd398774eead0abf917d65","tarball":"https://registry.npmjs.org/@burdenoff/botlit-sdk/-/botlit-sdk-2026.731.1.tgz","fileCount":23,"integrity":"sha512-5/MXWRq5Ji3W5izKUsHAem5UUhHErcZzLixhVcPLOWMbqugffzozakD7fb0cZdARFW2U/p+DXwqfPqx6zJob4g==","signatures":[{"sig":"MEQCIHgF7H8TvWIkUImhFH+17UalJTcNYiLMzgZc7uHN0t58AiBAcPebl4L125iC/cpmIvKrhsJP5B5rfar3EtYyS3sFRA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":66494},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"bun":">=1.3.10","node":">=16.0.0"},"gitHead":"cb664913c6e74a4f8ce34c9f983019887a3adc2d","scripts":{"dev":"tsx watch src/index.ts","lint":"eslint src --fix","test":"bash scripts/build-limits.sh vitest run","audit":"bunx better-npm-audit audit --audit-level moderate","build":"tsc && tsc-alias","clean":"rimraf dist .eslintcache","format":"prettier --write \"src/**/*.{ts,js,json,md}\" \"test/**/*.{ts,js}\"","sanity":"bash scripts/build-limits.sh --gate bash -c 'bun run format:check && bun run lint:sanity && bun run type-check && bun run test && bun run build'","prepare":"bun run generate:types && bun run build","test:ui":"vitest --ui","validate":"bun run type-check && bun run lint:check && bun run test","lint:check":"eslint src","test:watch":"vitest","type-check":"bash scripts/build-limits.sh tsc --noEmit","build:watch":"tsc -w","dev:example":"tsx examples/basic-usage.ts","lint:sanity":"if [ \"${CI:-}\" = \"true\" ]; then bun run lint:check; else bun run lint:check -- --cache --cache-location .eslintcache; fi","format:check":"prettier --check \"src/**/*.{ts,js,json,md}\" \"test/**/*.{ts,js}\"","test:coverage":"bash scripts/build-limits.sh vitest run --coverage","generate:types":"graphql-codegen --config codegen.yml","prepublishOnly":"bun run clean && bun run build","dev:auth-example":"tsx examples/authentication-flow.ts"},"_npmUser":{"name":"burdenoffcorp","email":"support@burdenoff.com"},"overrides":{"tmp":"0.2.5","vite":"7.1.11","yaml":">=2.8.3","axios":">=1.15.0","lodash":">=4.17.21","swiper":">=12.1.2","flatted":">=3.4.1","dompurify":">=3.3.4","immutable":">=3.8.3","lodash-es":">=4.17.21","minimatch":">=3.1.3","picomatch":">=2.3.2","smol-toml":">=1.6.1","@xmldom/xmldom":">=0.8.12","brace-expansion":">=1.1.13","fast-xml-parser":">=4.5.5","follow-redirects":">=1.15.12"},"_npmVersion":"12.0.2","description":"Official TypeScript SDK for Botlit","directories":{},"_nodeVersion":"22.23.1","dependencies":{"graphql":"^16.11.0","cross-fetch":"^4.1.0","graphql-request":"^7.2.0"},"_hasShrinkwrap":false,"devDependencies":{"msw":"^2.10.4","tsx":"^4.20.3","eslint":"^9.32.0","rimraf":"^6.0.1","vitest":"^3.2.4","prettier":"^3.6.2","tsc-alias":"^1.8.16","@vitest/ui":"^3.2.4","typescript":"^5.8.3","@types/node":"^24.1.0","@vitest/coverage-v8":"^3.2.4","@graphql-codegen/cli":"^5.0.7","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.3","@typescript-eslint/parser":"^8.38.0","@graphql-codegen/typescript":"^4.1.6","@typescript-eslint/eslint-plugin":"^8.38.0","@graphql-codegen/typescript-operations":"^4.6.1","@graphql-codegen/typescript-graphql-request":"^6.3.0"},"_npmOperationalInternal":{"tmp":"tmp/botlit-sdk_2026.731.1_1785473777026_0.594934842978595","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed: the package is now @burdenoff/botmanor-sdk (Botlit is now Botmanor). Install @burdenoff/botmanor-sdk instead."}},"time":{"created":"2026-05-11T04:03:53.839Z","modified":"2026-08-13T12:55:50.054Z","1.0.1":"2025-10-15T08:03:17.151Z","2026.419.1":"2026-05-11T04:03:54.093Z","2026.512.1":"2026-05-12T12:43:04.403Z","2026.723.1":"2026-07-23T07:12:14.744Z","2026.731.1":"2026-07-31T04:56:17.184Z"},"author":{"url":"https://github.com/tvvignesh","name":"Vignesh T.V"},"license":"UNLICENSED","keywords":["algoshred","botlit","graphql","sdk","typescript","api-client"],"description":"Official TypeScript SDK for Botlit","maintainers":[{"name":"burdenoffcorp","email":"support@burdenoff.com"}],"readme":"# Botlit SDK for Node.js\n\n[![npm version](https://img.shields.io/npm/v/@algoshred/botlit-sdk.svg)](https://www.npmjs.com/package/@algoshred/botlit-sdk)\n[![License](https://img.shields.io/badge/license-PROPRIETARY-red.svg)](LICENSE)\n[![Node Version](https://img.shields.io/badge/node-%3E%3D16.0.0-brightgreen.svg)](https://nodejs.org)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.8-blue.svg)](https://www.typescriptlang.org/)\n\nOfficial TypeScript/Node.js SDK for the Botlit API. A modern, type-safe GraphQL client for user authentication, authorization, and management.\n\n## Table of Contents\n\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Quick Start](#quick-start)\n- [Configuration](#configuration)\n- [Authentication](#authentication)\n- [User Management](#user-management)\n- [Utilities](#utilities)\n- [Error Handling](#error-handling)\n- [Advanced Usage](#advanced-usage)\n- [Examples](#examples)\n- [Development](#development)\n- [Testing](#testing)\n- [Contributing](#contributing)\n- [Troubleshooting](#troubleshooting)\n- [License](#license)\n- [Support](#support)\n\n## Features\n\n- **Type-Safe**: Built with TypeScript for complete type safety\n- **GraphQL-Based**: Modern GraphQL API integration with automatic code generation\n- **Authentication**: Complete auth flow with JWT token management\n- **User Management**: Full user CRUD operations and profile management\n- **Token Management**: Automatic token handling with refresh capabilities\n- **Configurable**: Flexible configuration with sensible defaults\n- **Well-Tested**: Comprehensive test suite with high coverage\n- **Modern**: ES2020+ with tree-shaking support\n- **Developer-Friendly**: Excellent IDE autocomplete and IntelliSense support\n\n## Requirements\n\n- Node.js >= 16.0.0\n- npm >= 8.0.0 or yarn >= 1.22.0\n- TypeScript >= 5.0 (for TypeScript projects)\n\n## Installation\n\n```bash\nnpm install @algoshred/botlit-sdk\n```\n\nOr using yarn:\n\n```bash\nyarn add @algoshred/botlit-sdk\n```\n\nOr using pnpm:\n\n```bash\npnpm add @algoshred/botlit-sdk\n```\n\n## Quick Start\n\n```typescript\nimport { BotlitSDK } from '@algoshred/botlit-sdk';\n\n// Initialize the SDK\nconst sdk = new BotlitSDK({\n  workspaceEndpoint: 'https://graphqlworkspaces.burdenoff.com/workspaces/graphql',\n  globalEndpoint: 'https://graphql.burdenoff.com/global/graphql',\napiKey: 'your-api-key', // Optional\n});\n\n// Sign up a new user\nconst authResult = await sdk.auth.signUp({\n  email: 'user@example.com',\n  username: 'johndoe',\n  password: 'securepassword123',\n  firstName: 'John',\n  lastName: 'Doe',\n});\n\n// Tokens are returned in the auth result\nconsole.log('Access Token:', authResult.accessToken);\n\n// Set tokens for authenticated requests\nsdk.setTokens(authResult.accessToken, authResult.refreshToken);\n\n// Now you can make authenticated requests\nconst currentUser = await sdk.users.me();\nconsole.log('Current User:', currentUser);\n```\n\n## Configuration\n\nThe SDK accepts the following configuration options:\n\n```typescript\ninterface BotlitSDKConfig {\n  workspaceEndpoint?: string; // Optional: Workspace GraphQL endpoint (defaults to prod)\n  globalEndpoint?: string;    // Optional: Global GraphQL endpoint (defaults to prod)\n  apiKey?: string;            // Optional: API key for authentication\n  accessToken?: string;       // Optional: Initial access token\n  refreshToken?: string;      // Optional: Initial refresh token\n  timeout?: number;           // Optional: Request timeout in milliseconds\n}\n```\n\n### Basic Configuration\n\n```typescript\nconst sdk = new BotlitSDK({\n  workspaceEndpoint: 'https://graphqlworkspaces.burdenoff.com/workspaces/graphql',\n  globalEndpoint: 'https://graphql.burdenoff.com/global/graphql',\n});\n```\n\n### With API Key\n\n```typescript\nconst sdk = new BotlitSDK({\n  workspaceEndpoint: 'https://graphqlworkspaces.burdenoff.com/workspaces/graphql',\n  globalEndpoint: 'https://graphql.burdenoff.com/global/graphql',\napiKey: 'your-api-key',\n});\n```\n\n### With Existing Tokens\n\n```typescript\nconst sdk = new BotlitSDK({\n  workspaceEndpoint: 'https://graphqlworkspaces.burdenoff.com/workspaces/graphql',\n  globalEndpoint: 'https://graphql.burdenoff.com/global/graphql',\naccessToken: 'existing-access-token',\n  refreshToken: 'existing-refresh-token',\n});\n```\n\n### With Custom Timeout\n\n```typescript\nconst sdk = new BotlitSDK({\n  workspaceEndpoint: 'https://graphqlworkspaces.burdenoff.com/workspaces/graphql',\n  globalEndpoint: 'https://graphql.burdenoff.com/global/graphql',\ntimeout: 30000, // 30 seconds\n});\n```\n\n### Dynamic Endpoint Configuration\n\n```typescript\nconst sdk = new BotlitSDK({\n  workspaceEndpoint: 'https://graphqlworkspaces.burdenoff.com/workspaces/graphql',\n  globalEndpoint: 'https://graphql.burdenoff.com/global/graphql',\n});\n\n// Change endpoint later\nsdk.setEndpoint('https://staging-api.botlit.io/graphql');\n\n// Get current endpoint\nconst currentEndpoint = sdk.getEndpoint();\n```\n\n## Authentication\n\nThe SDK provides complete authentication functionality including sign up, sign in, token refresh, and sign out.\n\n### Sign Up\n\nCreate a new user account:\n\n```typescript\nconst result = await sdk.auth.signUp({\n  email: 'user@example.com',\n  username: 'johndoe',\n  password: 'securepassword123',\n  firstName: 'John',\n  lastName: 'Doe',\n});\n\n// Result contains user data and tokens\nconsole.log('User:', result.user);\nconsole.log('Access Token:', result.accessToken);\nconsole.log('Refresh Token:', result.refreshToken);\nconsole.log('Expires At:', result.expiresAt);\n\n// Set tokens for future authenticated requests\nsdk.setTokens(result.accessToken, result.refreshToken);\n```\n\n### Sign In\n\nAuthenticate an existing user:\n\n```typescript\nconst result = await sdk.auth.signIn({\n  username: 'johndoe',\n  password: 'securepassword123',\n});\n\n// Set tokens after successful sign in\nsdk.setTokens(result.accessToken, result.refreshToken);\n```\n\n### Token Management\n\n```typescript\n// Set tokens manually\nsdk.setTokens('access-token', 'refresh-token');\n\n// Get current tokens\nconst tokens = sdk.getTokens();\nconsole.log('Access Token:', tokens.accessToken);\nconsole.log('Refresh Token:', tokens.refreshToken);\n\n// Check if tokens exist\nif (tokens.accessToken && tokens.refreshToken) {\n  console.log('User is authenticated');\n}\n\n// Clear tokens (e.g., on logout)\nsdk.clearTokens();\n```\n\n### Refresh Token\n\nRefresh an expired access token:\n\n```typescript\ntry {\n  const tokens = sdk.getTokens();\n\n  if (tokens.refreshToken) {\n    const result = await sdk.auth.refreshToken(tokens.refreshToken);\n\n    // Update tokens in SDK\n    sdk.setTokens(result.accessToken, result.refreshToken);\n\n    console.log('Token refreshed successfully');\n  }\n} catch (error) {\n  console.error('Failed to refresh token:', error);\n  // Redirect to login or handle error\n}\n```\n\n### Sign Out\n\nSign out the current user:\n\n```typescript\ntry {\n  await sdk.auth.signOut();\n\n  // Clear tokens from SDK\n  sdk.clearTokens();\n\n  console.log('User signed out successfully');\n} catch (error) {\n  console.error('Sign out failed:', error);\n}\n```\n\n## User Management\n\nThe SDK provides comprehensive user management capabilities.\n\n### Get Current User\n\nRetrieve the currently authenticated user's information:\n\n```typescript\ntry {\n  const user = await sdk.users.me();\n\n  console.log('User ID:', user.id);\n  console.log('Username:', user.username);\n  console.log('Email:', user.email);\n  console.log('Full Name:', `${user.firstName} ${user.lastName}`);\n  console.log('Status:', user.status);\n  console.log('Email Verified:', user.emailVerified);\n} catch (error) {\n  console.error('Failed to fetch current user:', error);\n}\n```\n\n### Get User by ID\n\nRetrieve a specific user by their ID:\n\n```typescript\ntry {\n  const user = await sdk.users.getUser('user-id-123');\n  console.log('User:', user);\n} catch (error) {\n  console.error('Failed to fetch user:', error);\n}\n```\n\n### List Users\n\nRetrieve a paginated list of users:\n\n```typescript\n// Get first 20 users\nconst result = await sdk.users.getUsers({\n  limit: 20,\n  offset: 0,\n});\n\nconsole.log('Total Users:', result.total);\nconsole.log('Has More:', result.hasMore);\nconsole.log('Users:', result.items);\n\n// Pagination example\nlet offset = 0;\nconst limit = 20;\nlet hasMore = true;\n\nwhile (hasMore) {\n  const result = await sdk.users.getUsers({ limit, offset });\n\n  console.log(`Page ${offset / limit + 1}:`, result.items);\n\n  hasMore = result.hasMore;\n  offset += limit;\n}\n```\n\n### Update Profile\n\nUpdate the current user's profile information:\n\n```typescript\ntry {\n  const updatedUser = await sdk.users.updateProfile({\n    firstName: 'Jane',\n    lastName: 'Smith',\n  });\n\n  console.log('Profile updated:', updatedUser);\n} catch (error) {\n  console.error('Failed to update profile:', error);\n}\n```\n\n### Change Password\n\nChange the current user's password:\n\n```typescript\ntry {\n  const success = await sdk.users.changePassword({\n    currentPassword: 'oldpassword123',\n    newPassword: 'newpassword456',\n  });\n\n  if (success) {\n    console.log('Password changed successfully');\n  }\n} catch (error) {\n  console.error('Failed to change password:', error);\n}\n```\n\n## Utilities\n\n### Health Check\n\nCheck the API health status:\n\n```typescript\ntry {\n  const health = await sdk.utils.healthCheck();\n\n  console.log('Status:', health.status); // 'ok' or 'error'\n  console.log('Timestamp:', health.timestamp);\n  console.log('Version:', health.version);\n} catch (error) {\n  console.error('Health check failed:', error);\n}\n```\n\n### Validate Configuration\n\nValidate SDK configuration:\n\n```typescript\nimport { SDKUtils } from '@algoshred/botlit-sdk';\n\nconst config = {\n  workspaceEndpoint: 'https://graphqlworkspaces.burdenoff.com/workspaces/graphql',\n  globalEndpoint: 'https://graphql.burdenoff.com/global/graphql',\napiKey: 'test-key',\n};\n\ntry {\n  const isValid = SDKUtils.validateConfig(config);\n  console.log('Config is valid:', isValid);\n} catch (error) {\n  console.error('Invalid configuration:', error);\n}\n```\n\n### Format Errors\n\nFormat error messages for better readability:\n\n```typescript\nimport { SDKUtils } from '@algoshred/botlit-sdk';\n\ntry {\n  // Some operation that might fail\n  await sdk.auth.signIn({ username: 'invalid', password: 'invalid' });\n} catch (error) {\n  const formattedError = SDKUtils.formatError(error);\n  console.error('Formatted Error:', formattedError);\n}\n```\n\n## Error Handling\n\nThe SDK throws `BotlitSDKError` for API errors with detailed information:\n\n```typescript\nimport { BotlitSDKError } from '@algoshred/botlit-sdk';\n\ntry {\n  await sdk.auth.signIn({\n    username: 'invalid',\n    password: 'invalid'\n  });\n} catch (error) {\n  if (error instanceof BotlitSDKError) {\n    console.error('SDK Error:', error.message);\n    console.error('Error Code:', error.code);\n    console.error('Error Details:', error.details);\n    console.error('Stack Trace:', error.stack);\n  } else {\n    console.error('Unknown error:', error);\n  }\n}\n```\n\n### Common Error Scenarios\n\n```typescript\n// Handle authentication errors\ntry {\n  await sdk.auth.signIn({ username: 'user', password: 'wrong' });\n} catch (error) {\n  if (error instanceof BotlitSDKError) {\n    if (error.code === 'INVALID_CREDENTIALS') {\n      console.error('Invalid username or password');\n    } else if (error.code === 'USER_NOT_FOUND') {\n      console.error('User does not exist');\n    }\n  }\n}\n\n// Handle network errors\ntry {\n  await sdk.users.me();\n} catch (error) {\n  if (error instanceof BotlitSDKError) {\n    if (error.code === 'NETWORK_ERROR') {\n      console.error('Network connection failed');\n    } else if (error.code === 'TIMEOUT') {\n      console.error('Request timed out');\n    }\n  }\n}\n\n// Handle validation errors\ntry {\n  await sdk.auth.signUp({\n    email: 'invalid-email',\n    username: 'u',\n    password: '123',\n  });\n} catch (error) {\n  if (error instanceof BotlitSDKError) {\n    if (error.code === 'VALIDATION_ERROR') {\n      console.error('Validation failed:', error.details);\n    }\n  }\n}\n```\n\n## Advanced Usage\n\n### Concurrent Requests\n\n```typescript\n// Execute multiple requests in parallel\nconst [currentUser, users, health] = await Promise.all([\n  sdk.users.me(),\n  sdk.users.getUsers({ limit: 10 }),\n  sdk.utils.healthCheck(),\n]);\n\nconsole.log('Current User:', currentUser);\nconsole.log('Users List:', users);\nconsole.log('Health Status:', health);\n```\n\n### Complete Authentication Flow\n\n```typescript\nasync function completeAuthFlow() {\n  const sdk = new BotlitSDK({\n    workspaceEndpoint: 'https://graphqlworkspaces.burdenoff.com/workspaces/graphql',\n  globalEndpoint: 'https://graphql.burdenoff.com/global/graphql',\n});\n\n  try {\n    // Step 1: Sign up\n    console.log('Step 1: Signing up...');\n    const signUpResult = await sdk.auth.signUp({\n      email: 'newuser@example.com',\n      username: 'newuser',\n      password: 'securepass123',\n      firstName: 'New',\n      lastName: 'User',\n    });\n    console.log('Sign up successful:', signUpResult.user);\n\n    // Step 2: Set tokens\n    console.log('Step 2: Setting tokens...');\n    sdk.setTokens(signUpResult.accessToken, signUpResult.refreshToken);\n\n    // Step 3: Make authenticated request\n    console.log('Step 3: Fetching profile...');\n    const currentUser = await sdk.users.me();\n    console.log('Current user:', currentUser);\n\n    // Step 4: Update profile\n    console.log('Step 4: Updating profile...');\n    const updatedUser = await sdk.users.updateProfile({\n      firstName: 'Updated',\n      lastName: 'Name',\n    });\n    console.log('Profile updated:', updatedUser);\n\n    // Step 5: Refresh token (simulate expiration)\n    console.log('Step 5: Refreshing token...');\n    const tokens = sdk.getTokens();\n    if (tokens.refreshToken) {\n      const refreshResult = await sdk.auth.refreshToken(tokens.refreshToken);\n      sdk.setTokens(refreshResult.accessToken, refreshResult.refreshToken);\n      console.log('Token refreshed');\n    }\n\n    // Step 6: Sign out\n    console.log('Step 6: Signing out...');\n    await sdk.auth.signOut();\n    sdk.clearTokens();\n    console.log('Signed out successfully');\n\n  } catch (error) {\n    console.error('Error during auth flow:', error);\n  }\n}\n\ncompleteAuthFlow();\n```\n\n### Session Management\n\n```typescript\nimport { BotlitSDK } from '@algoshred/botlit-sdk';\n\nclass SessionManager {\n  private sdk: BotlitSDK;\n  private tokenRefreshInterval: NodeJS.Timeout | null = null;\n\n  constructor(workspaceEndpoint: string, globalEndpoint: string) {\n    this.sdk = new BotlitSDK({ workspaceEndpoint, globalEndpoint });\n  }\n\n  async login(username: string, password: string): Promise<void> {\n    const result = await this.sdk.auth.signIn({ username, password });\n    this.sdk.setTokens(result.accessToken, result.refreshToken);\n\n    // Store tokens in persistent storage (e.g., localStorage in browser)\n    this.saveTokens(result.accessToken, result.refreshToken);\n\n    // Start automatic token refresh\n    this.startTokenRefresh();\n  }\n\n  async logout(): Promise<void> {\n    await this.sdk.auth.signOut();\n    this.sdk.clearTokens();\n    this.clearTokens();\n    this.stopTokenRefresh();\n  }\n\n  async refreshSession(): Promise<void> {\n    const tokens = this.sdk.getTokens();\n\n    if (tokens.refreshToken) {\n      const result = await this.sdk.auth.refreshToken(tokens.refreshToken);\n      this.sdk.setTokens(result.accessToken, result.refreshToken);\n      this.saveTokens(result.accessToken, result.refreshToken);\n    }\n  }\n\n  private startTokenRefresh(): void {\n    // Refresh token every 15 minutes\n    this.tokenRefreshInterval = setInterval(async () => {\n      try {\n        await this.refreshSession();\n      } catch (error) {\n        console.error('Token refresh failed:', error);\n        await this.logout();\n      }\n    }, 15 * 60 * 1000);\n  }\n\n  private stopTokenRefresh(): void {\n    if (this.tokenRefreshInterval) {\n      clearInterval(this.tokenRefreshInterval);\n      this.tokenRefreshInterval = null;\n    }\n  }\n\n  private saveTokens(accessToken: string, refreshToken: string): void {\n    // Implement your storage logic here\n    // For browser: localStorage.setItem('tokens', JSON.stringify({ accessToken, refreshToken }))\n    // For Node.js: Save to file or database\n  }\n\n  private clearTokens(): void {\n    // Implement your storage clearing logic here\n  }\n\n  getSDK(): BotlitSDK {\n    return this.sdk;\n  }\n}\n\n// Usage\nconst sessionManager = new SessionManager('https://api.botlit.io/graphql');\nawait sessionManager.login('username', 'password');\n\nconst sdk = sessionManager.getSDK();\nconst user = await sdk.users.me();\nconsole.log(user);\n```\n\n## Examples\n\nFor complete working examples, see the [examples](./examples) directory:\n\n- [basic-usage.ts](./examples/basic-usage.ts) - Basic SDK usage with all core features\n- [authentication-flow.ts](./examples/authentication-flow.ts) - Complete authentication flow\n\n### Running Examples\n\n```bash\n# Run basic usage example\nnpm run dev:example\n\n# Run authentication flow example\nnpm run dev:auth-example\n```\n\n## Development\n\n### Prerequisites\n\n- Node.js >= 16.0.0\n- npm >= 8.0.0 or yarn >= 1.22.0\n\n### Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/algoshred/botlit-sdk-node.git\ncd botlit-sdk-node\n\n# Install dependencies\nnpm install\n\n# Generate GraphQL types\nnpm run generate:types\n\n# Build the project\nnpm run build\n```\n\n### Quick Setup Script\n\n```bash\n# Run the automated setup script\n./scripts/dev-setup.sh\n```\n\nThis script will:\n1. Verify Node.js version\n2. Install dependencies\n3. Generate GraphQL types\n4. Build the project\n5. Run tests\n6. Run linting\n7. Perform type checking\n\n### Available Scripts\n\n- `npm run build` - Build the TypeScript project\n- `npm run build:watch` - Build in watch mode\n- `npm run dev` - Run in development mode\n- `npm test` - Run tests\n- `npm run test:coverage` - Run tests with coverage\n- `npm run test:ui` - Run tests with UI\n- `npm run lint` - Lint and fix code\n- `npm run lint:check` - Check linting without fixing\n- `npm run format` - Format code with Prettier\n- `npm run format:check` - Check formatting\n- `npm run type-check` - Check TypeScript types\n- `npm run generate:types` - Generate GraphQL types\n- `npm run clean` - Remove build artifacts\n- `npm run validate` - Run all validation checks\n- `npm run dev:example` - Run basic example\n- `npm run dev:auth-example` - Run auth example\n\n### Development Workflow\n\n1. Make changes to source code in `src/`\n2. Run `npm run type-check` to verify TypeScript\n3. Run `npm run lint` to fix linting issues\n4. Run `npm test` to ensure tests pass\n5. Run `npm run build` to compile\n6. Test your changes with examples\n\n### GraphQL Schema Updates\n\nWhen the GraphQL schema changes:\n\n```bash\n# Update schema.graphql file\n# Then regenerate types\nnpm run generate:types\n```\n\n## Testing\n\nThe SDK has comprehensive test coverage using Vitest and MSW (Mock Service Worker).\n\n### Run Tests\n\n```bash\n# Run all tests\nnpm test\n\n# Run with coverage\nnpm run test:coverage\n\n# Run with UI\nnpm run test:ui\n\n# Run in watch mode\nnpm test -- --watch\n```\n\n### Test Structure\n\n```\ntest/\n├── setup.ts              # Test setup and MSW configuration\n├── auth/\n│   └── auth.test.ts      # Authentication tests\n├── user/\n│   └── user.test.ts      # User management tests\n└── utils/\n    └── utils.test.ts     # Utility function tests\n```\n\n### Writing Tests\n\n```typescript\nimport { describe, it, expect, beforeEach } from 'vitest';\nimport { BotlitSDK } from '../src';\n\ndescribe('Feature Tests', () => {\n  let sdk: BotlitSDK;\n\n  beforeEach(() => {\n    sdk = new BotlitSDK({\n      workspaceEndpoint: 'http://localhost:4003/workspaces/graphql',\n  globalEndpoint: 'http://localhost:4000/global/graphql',\n});\n  });\n\n  it('should perform operation', async () => {\n    const result = await sdk.someOperation();\n    expect(result).toBeDefined();\n  });\n});\n```\n\n### Coverage Reports\n\nCoverage reports are generated in the `coverage/` directory:\n\n- `coverage/index.html` - HTML coverage report\n- `coverage/coverage-final.json` - JSON coverage data\n- `coverage/lcov.info` - LCOV format for CI tools\n\nView HTML coverage report:\n\n```bash\nnpm run test:coverage\nopen coverage/index.html\n```\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\n\n### Contribution Process\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes\n4. Run tests and linting (`npm run validate`)\n5. Commit your changes (`git commit -m 'Add amazing feature'`)\n6. Push to the branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n### Code Style\n\n- Follow TypeScript best practices\n- Use ESLint and Prettier configurations\n- Write comprehensive tests for new features\n- Update documentation as needed\n- Follow conventional commit messages\n\n## Troubleshooting\n\n### Common Issues\n\n#### Module Not Found Error\n\n```bash\nError: Cannot find module '@algoshred/botlit-sdk'\n```\n\n**Solution**: Ensure the package is installed:\n```bash\nnpm install @algoshred/botlit-sdk\n```\n\n#### TypeScript Errors\n\n```bash\nerror TS2307: Cannot find module '@algoshred/botlit-sdk'\n```\n\n**Solution**: Ensure TypeScript can find the types:\n```bash\nnpm install --save-dev @types/node\n```\n\n#### Network Errors\n\n```bash\nBotlitSDKError: Network request failed\n```\n\n**Solution**:\n- Verify the API endpoint is correct\n- Check network connectivity\n- Ensure the API server is running\n- Check firewall settings\n\n#### Authentication Errors\n\n```bash\nBotlitSDKError: Authentication failed\n```\n\n**Solution**:\n- Verify credentials are correct\n- Check if tokens are expired\n- Try refreshing the token\n- Ensure tokens are set correctly: `sdk.setTokens(accessToken, refreshToken)`\n\n#### Token Refresh Issues\n\n```bash\nBotlitSDKError: Failed to refresh token\n```\n\n**Solution**:\n- Ensure refresh token is valid and not expired\n- Check if refresh token was set: `sdk.setTokens(accessToken, refreshToken)`\n- Try logging in again to get new tokens\n\n### Debug Mode\n\nEnable verbose logging for debugging:\n\n```typescript\n// Set environment variable for debug logs\nprocess.env.DEBUG = 'botlit-sdk:*';\n\nconst sdk = new BotlitSDK({\n  workspaceEndpoint: 'https://graphqlworkspaces.burdenoff.com/workspaces/graphql',\n  globalEndpoint: 'https://graphql.burdenoff.com/global/graphql',\n});\n```\n\n### Getting Help\n\nIf you encounter issues:\n\n1. Check this troubleshooting section\n2. Search existing [GitHub Issues](https://github.com/algoshred/botlit-sdk-node/issues)\n3. Review the [examples](./examples) directory\n4. Contact support at support@algoshred.com\n\n## License\n\nCopyright (c) 2025 Burdenoff Consultancy Services Private Limited, Algoshred Technologies Private Limited and all sister companies.\n\nThis software is proprietary and confidential. See [LICENSE](LICENSE) for details.\n\nFor licensing inquiries, contact: legal@algoshred.com\n\n## Support\n\n- Documentation: [GitHub Repository](https://github.com/algoshred/botlit-sdk-node)\n- Issues: [GitHub Issues](https://github.com/algoshred/botlit-sdk-node/issues)\n- Email: support@algoshred.com\n- Website: [https://algoshred.com](https://algoshred.com)\n\n---\n\nMade with dedication by the Algoshred team.\n","readmeFilename":"README.md"}