{"id":36895583,"url":"https://github.com/livechat/developer-sdk","last_synced_at":"2026-01-12T15:41:50.963Z","repository":{"id":154457403,"uuid":"564345256","full_name":"livechat/developer-sdk","owner":"livechat","description":"Repository with SDK for creating LiveChat Developer Applications.","archived":false,"fork":false,"pushed_at":"2024-04-16T10:06:22.000Z","size":295,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-06T05:27:36.044Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/livechat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/codeowners","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-10T14:17:40.000Z","updated_at":"2024-01-25T12:49:23.000Z","dependencies_parsed_at":"2024-09-23T21:07:56.805Z","dependency_job_id":"a5d8fb29-6dd4-42e3-a3d7-7d3cc555f053","html_url":"https://github.com/livechat/developer-sdk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/livechat/developer-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livechat%2Fdeveloper-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livechat%2Fdeveloper-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livechat%2Fdeveloper-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livechat%2Fdeveloper-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/livechat","download_url":"https://codeload.github.com/livechat/developer-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livechat%2Fdeveloper-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28341354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2026-01-12T15:41:50.850Z","updated_at":"2026-01-12T15:41:50.946Z","avatar_url":"https://github.com/livechat.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"https://platform.labs.text.com/console/favicon.ico\" widht=\"24px\" height=\"24px\" /\u003e Text Platform - Developer SDK\n\n\u003e The `Developer-SDK` is a part of the Text Platform Developer Studio and its main purpose is to arm your project with tooling that optimizes usage of `Text Platform` ecosystem.\n\n[![mit](https://img.shields.io/badge/license-MIT-blue.svg)](https://choosealicense.com/licenses/mit/)\n\n## Installation\n\nTo use the `Developer SDK`, you need to install it first. You can do this using npm or yarn:\n\n```bash\nnpm install @livechat/developer-sdk\n```\n\n## Developer App\n\nThe `DeveloperApp` is class that provides methods for initializing and configuring your developer application.\n\n### Config\n\nIn order to use the `DeveloperApp` class in your project first you need to define your `DeveloperAppConfig` accordingly to shape:\n\n```ts\ninterface DeveloperAppConfig {\n  /* 1 */ appId: string;\n  /* 2 */ auth?: {\n    clientId?: string;\n    mode?: \"popup\" | \"iframe\" | \"redirect\";\n  };\n}\n```\n\nWe suggest store config in dedicated file: `livechat.config.json`\n\n```ts\n// livechat.config.json\n{\n  ...\n}\n```\n\nbut you can also store in it variable:\n\n```ts\nconst config: DeveloperAppConfig = {\n  // ...\n};\n```\n\n1. Developer App ID\n\nA required property of `DeveloperAppConfig` is `appId` - it can be obtained directly from Developer Console by extracting it from url:\n\n```\nhttps://platform.text.com/console/apps/{appId}/monitor\n```\n\n2. Authorization\n\nIf your Developer App has authorization block you can use `Developer-SDK` to process authorization for you. You can find value for property `clientId` in your Authorization block in Developer Console. Second parameter is `mode` - use can use three different strategies: `popup`, `iframe`, `redirect` (default if not given).\n\n### Initialization\n\nUse the `DeveloperApp.init` method to initialize your Developer App. It takes a `DeveloperAppConfig` as its argument and returns a `DeveloperApp` instance:\n\n```ts\nimport { DeveloperApp, DeveloperAppConfig } from \"@livechat/developer-sdk\";\nimport lcConfig from \"./livechat.config.json\";\n\nconst config = lcConfig as DeveloperAppConfig;\nconst app = DeveloperApp.init(config);\n```\n\n### Authorization\n\nIn order to trigger authorization you can use `authorize` method on your app instance:\n\n```ts\nawait app.authorize();\n```\n\nKeep in mind that `authorize` method behavior vary depending on authorization strategy:\n\n- for `popup` and `iframe` it resolves as soon as login process is finished and returns authorization data (also `app.authorization` is being filled)\n- for `redirect` it returns `undefined`, but it redirects to login process and when it's back `authorize` method has to be call again to finalize authorization\n\nUsage:\n\n#### In react\n\nIn react applications you can build custom hook to ensure proper app initialization and authorization\n\n```ts\nfunction useDeveloperApp() {\n  const [developerApp, setDeveloperApp] = useState\u003cDeveloperApp | null\u003e(null);\n\n  useEffect(() =\u003e {\n    const app = DeveloperApp.init(config);\n\n    if (config.auth?.clientId) {\n      app.authorize().then(() =\u003e setDeveloperApp(app));\n    } else {\n      setDeveloperApp(app);\n    }\n  }, []);\n\n  return developerApp;\n}\n```\n\n### Reporting\n\nDeveloper app instance allows you to use Developer Console Reporting feature.\n\nUsage:\n\n```ts\nawait app.features.reporting.sendError(\"4xx\");\n```\n\nDefinition:\n\n```ts\ninterface ReportingFeature {\n  sendError(type: \"4xx\" | \"5xx\", payload?: string): Promise\u003cvoid\u003e;\n}\n```\n\nAPI:\n\n```yml\nPOST https://api.text.com/app_monitoring/${appId}/events\nBODY\n  required: true\n    content:\n      application/json:\n        schema:\n          type: object\n          properties:\n            organization_id:\n              type: string\n              format: uuid\n              description: Organization ID associated with the event\n              example: 3aa138c1-c137-41c6-6b26-cface5857378\n            type:\n              type: string\n              description: \"Event type. Supported types: 4xx, 5xx\"\n              example: \"4xx\"\n            payload:\n              type: string\n              description: \"Event payload. Max length: 1 kB.\"\n              example: \"{\\\"code\\\": 404, \\\"reason\\\": \\\"Not found\\\"}\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivechat%2Fdeveloper-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flivechat%2Fdeveloper-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivechat%2Fdeveloper-sdk/lists"}