
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
@nextcloud/axios
Advanced tools
Simple, typed wrapper of an Axios instance for Nextcloud that automatically sends authentication headers. Cancellation is supported as well.
npm install @nextcloud/axios --save
yarn add @nextcloud/axios
import axios from '@nextcloud/axios'
axios.get('nextcloud.com')
See https://github.com/axios/axios for details.
baseURL
You are able to define baseURL
to simplify the usage of axios across your app.
import axios from '@nextcloud/axios'
import { generateUrl } from '@nextcloud/router'
const baseURL = generateUrl('/apps/your_app_id/api')
axios.defaults.baseURL = baseURL
This package can optionally retry requests if they fail due to Nextcloud's maintenance mode. To activate this feature, pass
retryIfMaintenanceMode: true
into the request options. This mechanism will only catch relatively short server maintenance
downtime in the range of seconds to a minute. Any longer downtime still has to be handled by the application, show feedback
to the user, reload the page etc.
import axios from '@nextcloud/axios'
const pizzas = await axios.get('/apps/pizza/api/pizzas', {
retryIfMaintenanceMode: true,
})
const myPizza = await axios.post('/apps/pizza/api/pizzas', { toppings: ['pineapple'] }, {
retryIfMaintenanceMode: true,
})
This package can optionally trigger a page reload whenever a request fails due to an expired user session. This interrupts application logic and should be the last resort. If possible, handle the expired session higher up in the application.
import axios from '@nextcloud/axios'
const response = await axios.get('/apps/foo/api/bar', {
reloadExpiredSession: true,
})
References
FAQs
Axios client for Nextcloud
The npm package @nextcloud/axios receives a total of 4,812 weekly downloads. As such, @nextcloud/axios popularity was classified as popular.
We found that @nextcloud/axios demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 13 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.