///
This guide provides a step-by-step introduction to installing and using the SumUp Node.js SDK (`@sumup/sdk`) in your projects. For a general overview of the SDK's capabilities, refer to the [Overview]
149 views
~149 views from guests
Guest views are estimated from total page views. These include anonymous visitors and users who weren't logged in when they viewed the page.
This guide provides a step-by-step introduction to installing and using the SumUp Node.js SDK (@sumup/sdk) in your projects. For a general overview of the SDK's capabilities, refer to the [Overview] page.
To use the SumUp Node.js SDK, you need to have Node.js version 18 or higher installed in your development environment.
The SumUp SDK can be installed using npm, Yarn, or Deno's jsr package manager.
If you are using Deno, you can add the package from jsr:
Alternatively, you can use npx jsr for a one-off installation or to add it to your package.json:
To interact with the SumUp API, you need to initialize the SDK client with your API key. An API key (e.g., sup_sk_MvxmLOl0...) is essential for authenticating your requests. You can find your API key in the SumUp Developer Portal.
require (CommonJS)For environments using CommonJS modules (e.g., older Node.js projects or scripts without ES module support):
import and async/await (ES Modules)For modern Node.js applications using ES modules and async/await syntax, which is the recommended approach for TypeScript projects:
In both examples, sumup.merchant.get() (or client.merchant.get()) makes a request to retrieve information about the authenticated merchant. The response is a Promise that resolves with the merchant data or rejects with an error.
You can explore the examples/ directory in the repository for more detailed use cases, such as creating checkouts or handling card reader interactions. These examples demonstrate how to utilize different parts of the SDK and typically require setting environment variables for your API key and merchant code.
For comprehensive API details and SDK documentation, refer to the official SumUp Developer Documentation.