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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@i-con/api-sdk

v0.1.0

Published

RCDE APIを使用するためのSDKです。

Downloads

46

Readme

RCDE API SDK

RCDE APIを使用するためのSDKです。

認証方法には、2 legged oauthと3 legged oauthの2種類があり、 それぞれ必要な事前準備が異なります。

インストール方法

npm、またはyarnを使用してインストールします。

npm install @i-con/api-sdk
# or
yarn add @i-con/api-sdk

事前準備 (2 legged oauth)

RCDEのサイトでアプリケーションを作成します。

作成したアプリの「編集」ボタンから、クライアントIDとクライアントシークレットを取得します。 また、APIを利用したいアプリのドメインを登録します。

使用方法 (2 legged oauth)


// APIクライアントの初期化
const client = new RCDEClient2Legged({
  // RCDEのWebサイトのURL e.g. https://api.rcde.jp
  domain,
  // RCDEのアプリ設定画面で登録したドメイン
  baseUrl,
  // RCDEのアプリ設定画面で取得したクライアントIDとクライアントシークレット
  clientId,
  clientSecret,
});

// APIクライアントの認証
// この認証はAPIを利用する前に必ず行う必要があります
await client.authenticate();

// 現場の作成
const createConstructionRes = await client.createConstruction({
  name: "test constructon",
  address: "東京都千代田区一ツ橋2丁目5-10",
  contractedAt: new Date("2024-11-26"),
  period: new Date("2025-11-26"),
  advancePaymentRate: 20,
  contractAmount: 3500000000,
});

// 現場一覧の取得
const constructions = await client.getConstructionlist();

const construction = constructions[0];

// 現場情報の取得
await client.getConstruction(construction.id);

// 現場に紐づく契約の取得
const contracts = await client.getContractList({
  constructionId: construction.id,
});

const contract = contracts[0];
const buffer = fs.readFileSync("assets/bunny.csv");

// 契約にファイルをアップロード
const uploadRes = await client.uploadContractFile({
  contractId: contract.id,
  name: "bunny.csv",
  buffer,
});

事前準備 (3 legged oauth)

  1. 2 legged oauthと同様に、RCDEのサイトでアプリケーションを作成します。
  2. rcde上の3-leggedのログイン画面からログインします。(ID/PASSはrcdeを使うときのログインに使っているユーザー情報)
http://{rcdeのドメイン}/oauth/signIn?response_type=code&client_id={企業アプリケーション画面のクライアントID}&scope=all
# ※日本語の部分は必要な値を埋めてください
  1. 上記ログイン後、企業アプリケーション画面で設定したコールバックURLへリダイレクトされます。
  2. コールバックURLのクエリ文字列のcodeに文字列が返ってくるので、そのcodeの値を用いてRCDEClient3Leggedのインスタンスを作成します。

使用方法 (3 legged oauth)

const client = new RCDEClient3Legged({
  // RCDEのWebサイトのURL e.g. https://api.rcde.jp
  domain,
  // RCDEのアプリ設定画面で登録したドメイン
  baseUrl,
  // コールバックURLのクエリ文字列の`code`の値
  authCode,
});

あとの使い方は2 legged oauthとほぼ同様ですが、 作成した現場の認証作業が必要だったり、 rcdeのアプリケーションと同様に、発注者と受注者の関係が前提になっていることに注意が必要です。