![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@aurigma/axios-rendering-service-api-client
Advanced tools
Axios API Client for Rendering Service API service of Customer's Canvas web-to-print system.
This module is an Axios API client for Rendering Service API service which is a part of Customer's Canvas web-to-print system. It is supposed that you are familiar with its services and understand how to use its APIs. To learn more about Customer's Canvas and its services, refer the Getting Started section of its documentation.
The API client is automatically generated with NSwag tool. If for any reasons this API client does not work well for you, feel free to generate it yourself using Swagger document published at Customer's Canvas API Gateway.
To be able to use this package, you need to meet the following requirements:
For other platforms, see the Backend services article in Customer's Canvas documentation.
Install it as a regular npm package:
npm install @aurigma/axios-rendering-service-api-client
Receive an access token through your backend as explained in the documentation and deliver it to your app.
const renderingServiceApiClient = require("@aurigma/axios-rendering-service-api-client").RenderingServiceApiClient;
const axios = require("axios").default;
// You need to create external app in BackOffice with required scopes to receive clientId\clientSecret
// https://customerscanvas.com/dev/getting-started/about-backend-services.html#authorization
const clientId = "";
const clientSecret = "";
const apiUrl = "https://api.customerscanvashub.com/";
const getToken = async (clientId, clientSecret) => {
const requestConfig = {
method: "post",
url: apiUrl + "connect/token",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
data: new URLSearchParams({
client_id: clientId,
client_secret: clientSecret,
grant_type: "client_credentials",
}),
};
const response = await axios(requestConfig);
return response.data["access_token"];
};
const token = await getToken(clientId, clientSecret);
And then you can call ApiClients methods with this token:
const config = new renderingServiceApiClient.ApiClientConfiguration();
config.apiUrl = apiUrl;
config.setAuthorizationToken(token);
const buildInfoClient = new renderingServiceApiClient.BuildInfoApiClient(config);
const buildInfo = await buildInfoClient.getInfo();
console.log(token);
console.log(buildInfo);
You should retrieve access token from your backend, how it's explained above.
import { RenderingServiceApiClient } from "@aurigma/axios-rendering-service-api-client";
// get token on backend by clientId\clientSecret. Never use clientId\clientSecret on frontend!
// https://customerscanvas.com/dev/getting-started/about-backend-services.html#authorization
const token = "";
const config = new RenderingServiceApiClient.ApiClientConfiguration();
config.apiUrl = "";
config.setAuthorizationToken(token);
const buildInfoClient = new RenderingServiceApiClient.BuildInfoApiClient(config)
buildInfoClient.getInfo().then(data => console.log(data));
NOTE: The class name for each client is formed as ClientNameApiClient, e.g.
BuildInfo
->BuildInfoApiClient
, etc.
FAQs
Axios API Client for Rendering Service API service of Customer's Canvas web-to-print system.
The npm package @aurigma/axios-rendering-service-api-client receives a total of 16 weekly downloads. As such, @aurigma/axios-rendering-service-api-client popularity was classified as not popular.
We found that @aurigma/axios-rendering-service-api-client 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
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.