{"id":19119009,"url":"https://github.com/journy-io/js-sdk","last_synced_at":"2025-05-05T14:41:01.013Z","repository":{"id":47473913,"uuid":"278296462","full_name":"journy-io/js-sdk","owner":"journy-io","description":"💚 The official Node.js SDK that you can use to easily interact with our API","archived":false,"fork":false,"pushed_at":"2023-10-13T18:06:32.000Z","size":646,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-19T10:39:00.825Z","etag":null,"topics":["nodejs","sdk","sdk-nodejs"],"latest_commit_sha":null,"homepage":"https://developers.journy.io","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/journy-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-09T07:38:04.000Z","updated_at":"2023-10-13T18:06:55.000Z","dependencies_parsed_at":"2022-09-26T18:51:02.966Z","dependency_job_id":null,"html_url":"https://github.com/journy-io/js-sdk","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/journy-io%2Fjs-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/journy-io%2Fjs-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/journy-io%2Fjs-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/journy-io%2Fjs-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/journy-io","download_url":"https://codeload.github.com/journy-io/js-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252516041,"owners_count":21760710,"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":["nodejs","sdk","sdk-nodejs"],"created_at":"2024-11-09T05:08:18.860Z","updated_at":"2025-05-05T14:41:00.991Z","avatar_url":"https://github.com/journy-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![journy.io](banner.png)](https://journy.io/?utm_source=github\u0026utm_content=readme-js-sdk)\n\n# journy.io Node.js SDK\n\n[![npm](https://img.shields.io/npm/v/@journyio/sdk?color=%234d84f5\u0026style=flat-square)](https://www.npmjs.com/package/@journyio/sdk)\n[![npm downloads](https://img.shields.io/npm/dm/@journyio/sdk?style=flat-square)](https://www.npmjs.com/package/@journyio/sdk)\n\nThis is the official Node.js SDK for [journy.io](https://journy.io?utm_source=github\u0026utm_content=readme-js-sdk).\n\n## 💾 Installation\n\nYou can use your package manager (`npm` or `yarn`) to install the SDK:\n\n```bash\nnpm install --save @journyio/sdk\n```\nor\n```bash\nyarn add @journyio/sdk\n```\n\n## 🔌 Getting started\n\n### Import\n\nTo start, first import the client.\n\n```ts\nimport { Client } from \"@journyio/sdk\";\n```\n\n### Configuration\n\nTo be able to use the journy.io SDK you need to generate an API key. If you don't have one you can create one in [journy.io](https://system.journy.io?utm_source=github\u0026utm_content=readme-js-sdk).\n\nIf you don't have an account yet, you can create one in [journy.io](https://system.journy.io/register?utm_source=github\u0026utm_content=readme-js-sdk) or [request a demo first](https://www.journy.io/book-demo?utm_source=github\u0026utm_content=readme-js-sdk).\n\nGo to your settings, under the *Connections*-tab, to create and edit API keys. Make sure to give the correct permissions to the API Key.\n\n```ts\nconst client = Client.withDefaults(\"your-api-key\");\n```\n\nIf you want to use a custom [HttpClient](https://github.com/journy-io/http):\n\n```ts\nconst http = new OwnHttpClientImplementation();\nconst client = new Client(http, { apiKey: \"your-api-key\" });\n```\n\n### Methods\n\n#### Get API key details\n\n```ts\nconst result = await client.getApiKeyDetails();\n\nif (result.success) {\n  console.log(result.data.permissions); // string[]\n  console.log(result.callsRemaining); // number\n}\n```\n\n### Handling errors\n\nEvery call will return a result, we don't throw errors when a call fails. We don't want to break your application when things go wrong. An exception will be thrown for required arguments that are empty or missing.\n\nYou can check whether the call succeeded using `result.success`:\n\n```ts\nconst result = await client.getTrackingSnippet({\n  domain: \"www.journy.io\",\n});\n\nif (!result.success) {\n  console.log(result.error); // string\n  console.log(result.requestId); // string\n}\n\nawait client.getTrackingSnippet({\n  domain: \"\", // empty string will throw\n});\n```\n\nThe request ID can be useful when viewing API logs in [journy.io](https://system.journy.io?utm_source=github\u0026utm_content=readme-js-sdk).\n\n\n## 📬 API Docs\n\n[API reference](https://developers.journy.io)\n\n## 💯 Tests\n\nTo run the tests:\n\n```bash\nnpm run test\n```\n\n## ❓ Help\n\nWe welcome your feedback, ideas and suggestions. We really want to make your life easier, so if we’re falling short or should be doing something different, we want to hear about it.\n\nPlease create an issue or contact us via the chat on our website.\n\n## 🔒 Security\n\nIf you discover any security related issues, please email security at journy io instead of using the issue tracker.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjourny-io%2Fjs-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjourny-io%2Fjs-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjourny-io%2Fjs-sdk/lists"}