
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
@adyen/api-library
Advanced tools
The Adyen API Library for NodeJS enables you to work with Adyen APIs.
This is the officially supported NodeJS library for using Adyen's APIs.
The Library supports all APIs under the following services:
For more information, refer to our documentation or the API Explorer.
You can use NPM to add our library to your project
npm install --save @adyen/api-library
Alternatively, you can download the release on GitHub.
Set up the client as a singleton resource; you can then use it to create service objects for the API calls that you make to Adyen:
const client = new Client({apiKey: "YOUR_API_KEY", environment: "TEST"});
const client = new Client({apiKey: "YOUR_API_KEY", environment: "LIVE"});
const client = new Client({username: "YOUR_USERNAME", password: "YOUR_PASSWORD", environment: "TEST"});
By default, NodeJS https will be used to submit requests to the API. But you can change that by injecting your own HttpClient on your client instance. In the example below, we use axios
:
const {Client, Config} = require('@adyen/api-library');
const axios = require("axios");
...
const config = new Config();
const client = new Client({
config,
httpClient: {
async request(endpoint, json, config, isApiKeyRequired, requestOptions) {
const response = await axios({
method: 'POST',
url: endpoint,
data: JSON.parse(json),
headers: {
"X-API-Key": config.apiKey,
"Content-type": "application/json"
},
});
return response.data;
}
}
});
...
You can configure a proxy connection by injecting your own HttpURLConnectionClient on your client instance and changing the proxy
setter value.
Example:
const {HttpURLConnectionClient, Client, Config} = require('@adyen/api-library');
...
const config = new Config();
const client = new Client({ config });
const httpClient = new HttpURLConnectionClient();
httpClient.proxy = { host: "http://google.com", port: 8888, };
client.setEnvironment('TEST');
client.httpClient = httpClient;
...
For a closer look at how our NodeJS library works, clone our example integration. This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library.
We strongly encourage you to join us in contributing to this repository so everyone can benefit from:
Read our contribution guidelines to find out how to create a pull request.
If you have a feature request, or spotted a bug or a technical problem, create a GitHub issue. For other questions, contact our support team.
This repository is available under the MIT license.
FAQs
The Adyen API Library for NodeJS enables you to work with Adyen APIs.
The npm package @adyen/api-library receives a total of 77,586 weekly downloads. As such, @adyen/api-library popularity was classified as popular.
We found that @adyen/api-library demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.