![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
APIful provides a unified interface to manage all your API interactions by setting up a client with default fetch options, such as the base API URL and headers. Extensions add a variety of features to the client to match your favorite flavor of API management.
You can use one of the built-in extensions to get started right away, or create your own custom extension to meet your specific needs.
[!TIP] 📖 Read the documentation
# pnpm
pnpm add -D apiful
# npm
npm i -D apiful
[!TIP] 📖 Read the documentation
Create your first API client by initialising it with a base URL and a sample bearer token for authorization:
import { createClient } from 'apiful'
const baseURL = '<your-api-base-url>'
const client = createClient({
baseURL,
headers: {
Authorization: `Bearer ${process.env.API_KEY}`,
},
})
[!NOTE] The
createClient
function returns anApiClient
instance that does not yet have a call signature. You will need to add a base extension to the client in order to make API requests. Read on to learn how to do this.
| What it does: The |
| What it does: The |
| What it does: If your API has an OpenAPI schema, APIful can use it to generate types for you, which the For example, the response returned by the API call on the left is typed as follows:
Follow the OpenAPI extension documentation to learn more about how to generate TypeScript definitions from your OpenAPI schema files. |
Each client can have more than one extension. This means that you can chain with
methods to add multiple extensions to your client.
For example, you can add a custom extension to log the default fetch options:
import type { MethodsExtensionBuilder } from 'apiful'
const logExtension = (client => ({
logDefaults() {
console.log('Default fetch options:', client.defaultOptions)
}
})) satisfies MethodsExtensionBuilder
const extendedClient = client
.with(logExtension)
extendedClient.logDefaults() // { baseURL: '<your-base-url>', headers: { Authorization: 'Bearer <your-bearer-token>' } }
If you have specific requirements that are not covered by the included extensions, you can create your own extensions. Follow the Custom Extensions guide to learn more.
corepack enable
pnpm install
pnpm test
Made with 💛
Published under MIT License.
FAQs
Extensible, typed API tooling
We found that apiful demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.