Newton's Principia Mathematica

    piano-sdk
    TypeScript icon, indicating that this package has built-in type declarations

    0.2.0 • Public • Published

    Piano (The digital business platform) SDK for Node.js

    Overview

    This is an unofficial SDK for Piano API. So please do not contact Piano support with questions or concerns about this SDK. For any issues, please make an issue on GitHub.

    Note: This package is incomplete and experimental. It supports only a few APIs for the moment. Please use it with the utmost care and attention.

    Installation

    npm install piano-sdk

    Sending a Request

    You must have API Token (apiToken) and Application ID (aid) to send a requests.

    Also, you must pick an API environment from the followings (See "Environments" section on this page for details):

    • us
    • au - Australia
    • ap - Asia-Pacific
    • sandbox - Sandbox

    The following example demonstrates fetching a user data which has uid: abcdefg:

    import Piano from "piano-sdk"
    
    // Initialize SDK with your API Token and Application Id
    const piano = new Piano({
      aid: 'xxxxxxxxxx', // Your Application ID
      apiToken: '', // Your API Token
      environment: 'us', // API environment
    });
    
    (async () => {
      try {
        const result = await piano.publisher.user.get({ uid: "abcdefg" });
        console.log(result);
      } catch (e) {
        console.log(e);
      }
    })();

    Or if you want to update that user:

    (async () => {
      try {
        const result = await piano.publisher.user.update({
          uid: "abcdefg",
          email: "foobar@example.com",
          first_name: "Foo"
        });
      } catch (e) {
        console.log(e);
      }
    })();

    Keywords

    Install

    npm i piano-sdk

    DownloadsWeekly Downloads

    22

    Version

    0.2.0

    License

    MIT

    Unpacked Size

    37.7 kB

    Total Files

    59

    Last publish

    Collaborators

    • 5t111111
    • y-nagao