The examples in this folder use yarn
. If you don't have yarn
installed already, you'll need to install it.
Use
yarn ts-node {filename} [other command-line options]
to run a Typescript SDK example file.
Very brief descriptions of the examples and the link to the main example/project file are provided here. For more information on an example, look at the source file.
Example Topic | Discussion |
---|---|
multiple APIs | A simple example that shows how to use multiple versions of the API in the same file. The goal is to make iterative migration from an older API to a newer API in existing SDK code easier. |
custom configReader | Shows how to implement a custom method of reading your configuration settings, including API credentials |
SDK utilities | This file has some SDK utility methods tasks like:
|
Example Topic | Discussion |
---|---|
sudo as user | Uses several User management SDK methods and shows how to sudo as a different user than the default API credentials user. Once the auth session is set to that user, subsequent SDK requests will be "as user <x> " when submitted to the API. |
Example Topic | Discussion |
---|---|
download a dashboard tile by name | Find the requested dashboard by name, then the requested tile by name. If either name matches, the list of all available items is display. Supported output formats are PNG, JPG, CSV, JSON, and anything else supported by the run_query endpoint. This sample shows progress during a render task, and also how to use the SDK's streaming support. |
download a dashboard by name | Find the requested dashboard by name, then render it in the requested format. Default render format is PDF. PDF or PNG are the recommended output formats, but JPG is also supported. |