@aurigma/axios-design-atoms-api-client

中文文档
2.83.1发布于 2026/11/05SEE LICENSE IN License.mdTypeScriptESM + CJS近 30 天下载 2785

Axios API Client for Design Atoms API service of Customer's Canvas web-to-print system.

原始使用文档
文档目录4 节
  1. Pre-requisites
  2. Usage
  3. NodeJs
  4. Frontend

Aurigma Customer's Canvas SDK - Design Atoms API Client

This module is an Axios API client for Design Atoms 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.

Pre-requisites

To be able to use this package, you need to meet the following requirements:

  • You must have an account at Customer's Canvas.
  • You need to use it in Javascript\Typescript applications.

For other platforms, see the Backend services article in Customer's Canvas documentation.

Usage

Install it as a regular npm package:

npm install @aurigma/axios-design-atoms-api-client

NodeJs

Receive an access token through your backend as explained in the documentation and deliver it to your app.

const designAtomsApiClient = require("@aurigma/axios-design-atoms-api-client").DesignAtomsApiClient;
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 designAtomsApiClient.ApiClientConfiguration();
config.apiUrl = apiUrl;
config.setAuthorizationToken(token);

const buildInfoClient = new designAtomsApiClient.BuildInfoApiClient(config);
const buildInfo = await buildInfoClient.getInfo();

console.log(token);
console.log(buildInfo);

Frontend

You should retrieve access token from your backend, how it's explained above.

import { DesignAtomsApiClient } from "@aurigma/axios-design-atoms-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 DesignAtomsApiClient.ApiClientConfiguration();
config.apiUrl = "";
config.setAuthorizationToken(token);

const buildInfoClient = new DesignAtomsApiClient.BuildInfoApiClient(config)
buildInfoClient.getInfo().then(data => console.log(data));

To find out what other clients are available in this module, refer Design Atoms API Reference.

NOTE: The class name for each client is formed as ClientNameApiClient, e.g. BuildInfo -> BuildInfoApiClient, etc.

版本与发布记录

@aurigma/axios-design-atoms-api-client 共发布 74 个版本,首次发布于 2022/02/08;过去 12 个月发布了 13 个版本。

版本发布日期距今
2.83.1latest2026/11/052 天前
2.82.12026/09/032 个月前
2.80.142026/07/223 个月前
2.80.122026/07/223 个月前
2.80.112026/07/223 个月前
2.80.82026/07/203 个月前

关于 @aurigma/axios-design-atoms-api-client 的常见问题

@aurigma/axios-design-atoms-api-client 是什么?

Axios API Client for Design Atoms API service of Customer's Canvas web-to-print system.

如何安装 @aurigma/axios-design-atoms-api-client?

在项目目录运行 npm install @aurigma/axios-design-atoms-api-client,或使用 pnpm add / yarn add / bun add。

@aurigma/axios-design-atoms-api-client 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aurigma/axios-design-atoms-api-client 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@aurigma/axios-design-atoms-api-client 可以商用吗?

@aurigma/axios-design-atoms-api-client 使用 SEE LICENSE IN License.md 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@aurigma/axios-design-atoms-api-client 的下载量有多少?

根据 npm 官方下载统计,@aurigma/axios-design-atoms-api-client 在 2026/10/07 – 2026/11/05 这 30 天内被下载 2,785 次,日均约 93 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aurigma/axios-design-atoms-api-client 还在维护吗?

最新版本 2.83.1 发布于 2026/11/05(2 天前);至今共发布 74 个版本,其中过去 12 个月发布了 13 个;首次发布于 2022/02/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。