npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@dimo-network/data-sdk

v1.4.0

Published

DIMO Data SDK for JavaScript

Downloads

291

Readme

GitHub Actions Workflow Status GitHub top language GitHub License Downloads Discord X (formerly Twitter) URL

DIMO(智猛)Data SDK

概述

DIMO Data SDK 是一個以 TypeScript 構建的官方函式庫,旨在讓開發者能夠簡單且高效地使用 DIMO API。此 SDK 減少了開發者在整合 DIMO 平台時的複雜性,並加速開發過程。透過 API 調用的抽象化、簡化數據操作以及提供強大的型別安全性,提升了開發者的使用體驗。

安裝

使用 npm:

npm install @dimo-network/data-sdk

使用 yarn:

yarn add @dimo-network/data-sdk

單元測試

執行 npm testnpm run test 來運行 Jest 測試。

API 文件

有關 DIMO 開發或 API 的詳細資訊,請參閱 DIMO 的 開發者文件

SDK 使用方法

訪問函式庫

(TypeScript / ES Modules)

import { DIMO } from '@dimo-network/data-sdk';

(CommonJS)

const { DIMO } = require('@dimo-network/data-sdk')

SDK 初始化

const dimo = new DIMO('Production');

開發者註冊

作為認證流程的一部分,您需要先通過 DIMO Developer Console 獲取開發者授權身份。請按照以下步驟開始註冊:

  1. 造訪 DIMO 開發者主控台 並註冊帳號。
  2. 點擊「創建執照」(Create a License),並輸入您的相關執照詳細資訊。
  3. 生成 API 金鑰(API Key),並新增所需的統一資源識別碼(Redirect URI)。

開發者認證

SDK 提供了認證流程 所需的所有步驟,幫助您獲取「開發者 JWT」(Developer JWT)以及每輛與應用程式共享的車輛所使用的「車輛 JWT」(Vehicle JWT)。

認證的前置條件

  1. 開發者執照
  2. API 金鑰以及至少一組自訂的統一資源識別碼(Redirect URI)
  3. 適當的 TypeScript 環境設置

開發者 JWT

const developerJwt = await dimo.auth.getDeveloperJwt({
    client_id: '<client_id>',
    domain: '<domain/redirect_uri>',
    private_key: '<api_key>',
});

車輛 JWT

若要從消費者處獲取車輛數據,應用程式需要交換短期有效的 車輛 JWT。此車輛 JWT 是針對授權應用程式的車輛生成的。

消費者需要事先與您的應用程式共享車輛授權。為此,您可以透過前端整合 Login with DIMO 或開發出類似 DIMO Mobile 全端的功能。完成「分享」此步驟後,您將能夠自由獲取車輛數據。

const vehicleJwt = await dimo.tokenexchange.getVehicleJwt({
    ...developerJwt,
    tokenId: 117315
});

SDK 貢獻

有關如何貢獻於此 SDK 的詳細資訊,請參閱此處