{"id":15017841,"url":"https://github.com/nextcloud-libraries/nextcloud-axios","last_synced_at":"2025-10-04T00:51:44.225Z","repository":{"id":33012504,"uuid":"149730359","full_name":"nextcloud-libraries/nextcloud-axios","owner":"nextcloud-libraries","description":"Simple, typed wrapper of an Axios instance for Nextcloud https://npmjs.org/@nextcloud/axios","archived":false,"fork":false,"pushed_at":"2025-09-20T10:37:24.000Z","size":4933,"stargazers_count":8,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-21T21:02:02.636Z","etag":null,"topics":["axios","javascript-library","nextcloud","nextcloud-plugin"],"latest_commit_sha":null,"homepage":"https://nextcloud.github.io/nextcloud-axios/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nextcloud-libraries.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-09-21T07:59:45.000Z","updated_at":"2025-09-20T10:37:26.000Z","dependencies_parsed_at":"2023-07-28T16:25:19.334Z","dependency_job_id":"94e46435-d2f7-4c76-af8a-145f38623999","html_url":"https://github.com/nextcloud-libraries/nextcloud-axios","commit_stats":{"total_commits":626,"total_committers":18,"mean_commits":34.77777777777778,"dds":0.6261980830670926,"last_synced_commit":"c6860c632dfe77bd7e7755851f6b559cac5aed10"},"previous_names":["christophwurst/nextcloud-axios","nextcloud-libraries/nextcloud-axios","nextcloud/nextcloud-axios"],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/nextcloud-libraries/nextcloud-axios","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fnextcloud-axios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fnextcloud-axios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fnextcloud-axios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fnextcloud-axios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextcloud-libraries","download_url":"https://codeload.github.com/nextcloud-libraries/nextcloud-axios/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fnextcloud-axios/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278250085,"owners_count":25955840,"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","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["axios","javascript-library","nextcloud","nextcloud-plugin"],"created_at":"2024-09-24T19:51:03.491Z","updated_at":"2025-10-04T00:51:44.205Z","avatar_url":"https://github.com/nextcloud-libraries.png","language":"TypeScript","readme":"\u003c!--\n  - SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors\n  - SPDX-License-Identifier: GPL-3.0-or-later\n--\u003e\n# @nextcloud/axios\n[![REUSE status](https://api.reuse.software/badge/github.com/nextcloud-libraries/nextcloud-axios)](https://api.reuse.software/info/github.com/nextcloud-libraries/nextcloud-axios)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/nextcloud-libraries/nextcloud-axios/node-test.yml?branch=master)](https://github.com/nextcloud-libraries/nextcloud-axios/actions/workflows/node-test.yml?query=branch%3Amaster)\n[![npm](https://img.shields.io/npm/v/@nextcloud/axios.svg)](https://www.npmjs.com/package/@nextcloud/axios)\n[![code coverage](https://img.shields.io/codecov/c/github/nextcloud-libraries/nextcloud-axios)](https://app.codecov.io/gh/nextcloud-libraries/nextcloud-axios)\n\n\nSimple, typed wrapper of an Axios instance for Nextcloud that automatically sends authentication headers. [Cancellation](https://github.com/axios/axios#cancellation) is supported as well.\n\n## Installation\n\n```sh\nnpm install @nextcloud/axios --save\n```\n\n```sh\nyarn add @nextcloud/axios\n```\n\n## Usage\n\n```js\nimport axios from '@nextcloud/axios'\n\naxios.get('nextcloud.com')\n```\n\nSee https://github.com/axios/axios for details.\n\n### Defining `baseURL`\n\nYou are able to define [`baseURL`](https://axios-http.com/docs/config_defaults) to simplify the usage of axios across your app.\n\n```ts\nimport axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\n\nconst baseURL = generateUrl('/apps/your_app_id/api')\n\naxios.defaults.baseURL = baseURL\n```\n\n### Retry handling\n\nThis package can optionally retry requests if they fail due to Nextcloud's *maintenance mode*. To activate this feature, pass\n`retryIfMaintenanceMode: true` into the request options. This mechanism will only catch relatively short server maintenance\ndowntime in the range of seconds to a minute. Any longer downtime still has to be handled by the application, show feedback\nto the user, reload the page etc.\n\n```js\nimport axios from '@nextcloud/axios'\n\nconst pizzas = await axios.get('/apps/pizza/api/pizzas', {\n    retryIfMaintenanceMode: true,\n})\nconst myPizza = await axios.post('/apps/pizza/api/pizzas', { toppings: ['pineapple'] }, {\n    retryIfMaintenanceMode: true,\n})\n```\n\n### Expired sessions handling\n\nThis package can optionally trigger a page reload whenever a request fails due to an expired user session. This interrupts\napplication logic and should be the last resort. If possible, handle the expired session higher up in the application.\n\n```js\nimport axios from '@nextcloud/axios'\n\nconst response = await axios.get('/apps/foo/api/bar', {\n    reloadExpiredSession: true,\n})\n```\n\nReferences\n\n- [@nextcloud/router](https://github.com/nextcloud/nextcloud-router)\n- [Nextcloud App Routing](https://docs.nextcloud.com/server/latest/developer_manual/basics/routing.html)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextcloud-libraries%2Fnextcloud-axios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextcloud-libraries%2Fnextcloud-axios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextcloud-libraries%2Fnextcloud-axios/lists"}