@apideck/node

中文文档
3.8.0发布于 2025/03/17Apache-2.0TypeScriptESM + CJS近 30 天下载 2.8万

Apideck Node.js SDK

原始使用文档
文档目录22 节
  1. Table of Contents
  2. Installation
  3. Getting started
  4. Configuration
  5. Example
  6. Apideck Unified Apis
  7. AccountingApi
  8. AtsApi
  9. ConnectorApi
  10. CrmApi
  11. EcommerceApi
  12. FileStorageApi
  13. HrisApi
  14. IssueTrackingApi
  15. LeadApi
  16. PosApi
  17. SmsApi
  18. VaultApi
  19. WebhookApi
  20. Utils
  21. Support
  22. License

Apideck Node.js SDK

⚠️ DEPRECATION NOTICE: This SDK is deprecated and will be archived on May 31, 2025. Please transition to the new SDK before this date. After May 31, 2025, this repository will be archived and will no longer receive any updates. To support you during this transition please refer to our migration guide.

Table of Contents

Installation

Install the latest SDK using npm:

$ npm install @apideck/node

or Yarn

$ yarn add @apideck/node

Getting started

The module supports all Apideck API endpoints. For complete information about the API, head to the docs.

Configuration

A new Apideck instance is initialized by passing in required settings to the configuration.

import Apideck from '@apideck/node';

const apideck = new Apideck({
  apiKey: '<insert-api-key-here>',
  appId: '<insert-application-id-here>',
  consumerId: '<insert-consumer-id-here>'
})

const { crm } = apideck

Top level parameters (except for apiKey) can be overriden in specific resource calls.

// Declare Unify Api to use
const { crm } = apideck

// Override consumerId serviceId as declared in initial configuration for this operation.
const response = await crm.contactsAll({
  // serviceId: 'salesforce', // optional
  limit: '10'
})

Example

Retrieving a list of all contacts and updating the first record with a new address.


import Apideck, { PhoneNumberType } from '@apideck/node';

const apideck = new Apideck({
  apiKey: '<insert-api-key-here>',
  appId: '<insert-application-id-here>',
  consumerId: '<insert-consumer-id-here>'
})

const { crm } = apideck

const { data } = await crm.contactsAll({
  limit: 10
})

const result = await crm.contactsUpdate({
  id: data[0].id!,
  contact: {
    name: "John Doe",
    first_name: "John",
    last_name: "Doe",
    addresses: [{
      city: "Hoboken",
      line1: "Streetname 19",
      state: "NY"
    }],
    phone_numbers: [{
      number: '0486565656',
      phoneType: PhoneNumberType.Home
    }]
  }
})

console.info(result)

Apideck Unified Apis

The following Apis are currently available:

AccountingApi

Read the full documentation of the AccountingApi here.

AtsApi

Read the full documentation of the AtsApi here.

ConnectorApi

Read the full documentation of the ConnectorApi here.

CrmApi

Read the full documentation of the CrmApi here.

EcommerceApi

Read the full documentation of the EcommerceApi here.

FileStorageApi

Read the full documentation of the FileStorageApi here.

HrisApi

Read the full documentation of the HrisApi here.

IssueTrackingApi

Read the full documentation of the IssueTrackingApi here.

LeadApi

Read the full documentation of the LeadApi here.

PosApi

Read the full documentation of the PosApi here.

SmsApi

Read the full documentation of the SmsApi here.

VaultApi

Read the full documentation of the VaultApi here.

WebhookApi

Read the full documentation of the WebhookApi here.

Utils

uploadFile

A utility for uploading files using the File Storage API. uploadFile will automatically use upload sessions for files larger than 4MB. Smaller files will be uploaded with a simple upload call.

Example Usage

const apideck = new Apideck({
  apiKey: '<insert-api-key-here>',
  appId: '<insert-application-id-here>',
  consumerId: '<insert-consumer-id-here>'
});


const file = await apideck.utils.uploadFile({
  serviceId: 'dropbox',
  file: buffer, // Buffer | string
  name: "test.jpg",
  size: fileSize, // file size in bytes
  contentType: "image/jpg", // optional
});

Support

Open an issue!

License

Apache-2.0

版本与发布记录

@apideck/node 共发布 91 个版本,首次发布于 2021/03/25;过去 12 个月发布了 0 个版本。

版本发布日期距今
3.8.0latest2025/03/171.6 年前
3.7.82025/03/121.7 年前
3.7.72025/03/121.7 年前
3.7.62025/03/101.7 年前
3.7.52025/02/181.7 年前
3.7.42025/02/171.7 年前

其他发布通道:beta → 1.0.0-beta.34。

关于 @apideck/node 的常见问题

@apideck/node 是什么?

Apideck Node.js SDK

如何安装 @apideck/node?

在项目目录运行 npm install @apideck/node,或使用 pnpm add / yarn add / bun add。

@apideck/node 支持 TypeScript 吗?

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

@apideck/node 支持 ESM 还是 CommonJS?

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

@apideck/node 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=10。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@apideck/node 可以商用吗?

@apideck/node 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@apideck/node 的下载量有多少?

根据 npm 官方下载统计,@apideck/node 在 2026/10/06 – 2026/11/04 这 30 天内被下载 27,613 次,日均约 920 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@apideck/node 还在维护吗?

最新版本 3.8.0 发布于 2025/03/17(1.6 年前);至今共发布 91 个版本,其中过去 12 个月发布了 0 个;首次发布于 2021/03/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。