Have ideas to improve npm?Join in the discussion! »

    @therockstorm/sdk-ts
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.8 • Public • Published

    @therockstorm/sdk-ts

    The Vertex platform API SDK for TypeScript/JavaScript. The generated module can be used in Node.js, Webpack, and Browserify environments. To use with ES5, you must have a Promises/A+ library installed. It supports CommonJS and ES6 module systems.

    It can be used in both TypeScript and JavaScript. In TypeScript, type definitions are automatically resolved.

    Usage

    Install the SDK and export your credentials,

    # Install SDK 
    npm install --save @therockstorm/sdk-ts
     
    # Export your Vertex Platform API client ID and secret 
    export VERTEX_CLIENT_ID={CLIENT_ID}
    export VERTEX_CLIENT_SECRET={CLIENT_SECRET}

    Then, create a client and start using the Vertex API,

    import { VertexClient } from './vertex-client';
    import { prettyJson } from './utils';
     
    const main = async () => {
      // Shown with default values
      const client = await VertexClient.build({
        clientId: process.env.VERTEX_CLIENT_ID,
        clientSecret: process.env.VERTEX_CLIENT_SECRET,
        environment: 'platprod',
      });
     
      const getFilesRes = await client.files.getFiles(undefined, 1);
     
      console.log(prettyJson(getFilesRes.data));
    };
     
    main();

    Local Development

    # Install dependencies 
    npm install
     
    # Transpile TypeScript to JavaScript 
    npm run build
     
    # Format code 
    npm run format
     
    # Publish to NPM 
    npm publish

    Keywords

    none

    Install

    npm i @therockstorm/sdk-ts

    DownloadsWeekly Downloads

    4

    Version

    0.0.8

    License

    MIT

    Unpacked Size

    1.16 MB

    Total Files

    46

    Last publish

    Collaborators

    • avatar