{"id":21976787,"url":"https://github.com/stuartapp/stuart-client-js","last_synced_at":"2025-04-28T16:40:52.160Z","repository":{"id":30175968,"uuid":"122313915","full_name":"StuartApp/stuart-client-js","owner":"StuartApp","description":"Stuart JavaScript client","archived":false,"fork":false,"pushed_at":"2023-10-25T15:39:03.000Z","size":1247,"stargazers_count":2,"open_issues_count":12,"forks_count":6,"subscribers_count":54,"default_branch":"master","last_synced_at":"2025-04-24T12:02:12.318Z","etag":null,"topics":["delivery","npm-package","stuart"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/StuartApp.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-21T09:08:53.000Z","updated_at":"2024-02-10T06:10:36.000Z","dependencies_parsed_at":"2024-10-13T05:01:16.233Z","dependency_job_id":"0d9ef47e-1dbb-485b-a423-4fd85442bdfb","html_url":"https://github.com/StuartApp/stuart-client-js","commit_stats":{"total_commits":48,"total_committers":12,"mean_commits":4.0,"dds":0.4375,"last_synced_commit":"758f89cad390655f83d16b51229b96e017a77248"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StuartApp%2Fstuart-client-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StuartApp%2Fstuart-client-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StuartApp%2Fstuart-client-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StuartApp%2Fstuart-client-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StuartApp","download_url":"https://codeload.github.com/StuartApp/stuart-client-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251347568,"owners_count":21575103,"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":["delivery","npm-package","stuart"],"created_at":"2024-11-29T16:12:17.703Z","updated_at":"2025-04-28T16:40:52.118Z","avatar_url":"https://github.com/StuartApp.png","language":"JavaScript","readme":"[![Codeship Status for StuartApp/stuart-client-js](https://app.codeship.com/projects/47411ab0-b843-0137-a5ba-029fbc5fec2e/status?branch=master)](https://app.codeship.com/projects/364533)\n\n# Stuart JS Client\n\nFor a complete documentation of all endpoints offered by the Stuart API, you can visit [Stuart API documentation](https://api-docs.stuart.com).\n\n## Install\n``` bash\n$ npm install stuart-client-js --save\n```\n\n## Usage\n\n### Initialize HTTP client\n\n```javascript\nconst {\n  Authenticator,\n  Environment,\n  ApiResponse,\n  HttpClient\n} = require('stuart-client-js')\n\nconst environment = Environment.SANDBOX()\nconst api_client_id = 'XXXXXXX-XXXXXXXX-XXXXXXX' // can be found here: https://admin-sandbox.stuart.com/client/api\nconst api_client_secret = 'XXXXXXX-XXXXXXXX-XXXXXXX' // can be found here: https://admin-sandbox.stuart.com/client/api\nconst auth = new Authenticator(environment, api_client_id, api_client_secret)\n\nconst httpClient = new HttpClient(auth)\n```\n\n### Custom requests\n\n#### Example: create a job\n\n```javascript\nconst job = {\n  job: {\n    transport_type: \"bike\",\n    pickups: [\n      {\n        address: \"46 Boulevard Barbès, 75018 Paris\",\n        comment: \"Wait outside for an employee to come.\",\n        contact: {\n          firstname: \"Martin\",\n          lastname: \"Pont\",\n          phone: \"+33698348756'\",\n          company: \"KFC Paris Barbès\"\n        }\n      }\n    ],\n    dropoffs: [\n      {\n        address: \"156 rue de Charonne, 75011 Paris\",\n        package_description: \"Red packet.\",\n        client_reference: \"12345678ABCDE\", // must be unique\n        comment: \"code: 3492B. 3e étage droite. Sonner à Durand.\",\n        contact: {\n          firstname: \"Alex\",\n          lastname: \"Durand\",\n          phone: \"+33634981209\",\n          company: \"Durand associates.\"\n        }\n      }\n    ]\n  }\n}\n\nhttpClient.performPost('/v2/jobs', JSON.stringify(job))\n  .then((apiResponse) =\u003e { console.log(apiResponse) })\n  .catch((error) =\u003e { console.log(error) })\n```\n\n#### Example: get a list of jobs\n\n```javascript\nhttpClient.performGet('/v2/jobs')\n  .then((apiResponse) =\u003e { console.log(apiResponse) })\n  .catch((error) =\u003e { console.log(error) })\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstuartapp%2Fstuart-client-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstuartapp%2Fstuart-client-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstuartapp%2Fstuart-client-js/lists"}