You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This SDK tool is under heavy development!!
Currently there has yet to be a stable version release, please feel free to open any issue regarding this SDK in our community repo
Requirements
Node 18+
Installation
npm i instill-sdk
yarn add instill-sdk
pnpm add instill-sdk
Usage
Import
import{InstillAPIClient}from"instill-sdk";constclient=newInstillAPIClient({// Note: Model related endpoint is still in v1alpha versionbaseURL: "https://api.instill.tech/v1beta",apiKey: "<YOUR_API_KEY>"})
Useful helper for you to reuse the client instance
import{InstillAPIClient}from"instill-sdk";letinstillAPIClient: InstillAPIClient|null=null;exportfunctiongetInstillAPIClient(){if(!instillAPIClient){constbaseURL=`${process.env.NEXT_SERVER_API_GATEWAY_URL??env("NEXT_PUBLIC_API_GATEWAY_URL")}/${env("NEXT_PUBLIC_GENERAL_API_VERSION")}`;instillAPIClient=newInstillAPIClient({// Note: Model related endpoint is still in v1alpha versionbaseURL: "https://api.instill.tech/v1beta",apiToken: "<YOUR_API_KEY>"});}returninstillAPIClient;}
Example: Get all accessible pipelines
exportasyncfunctiongetAccessiblePipelines(){try{constpipelines=awaitclient.vdp.pipeline.listAccessiblePipelines({// This means you don't want to get the paginated response, instead,// you will get all the pipelines in one goenablePagination: false,// This means you want to have the full pipeline data objectview: "VIEW_FULL",});returnPromise.resolve(pipelines)}catch(error){returnPromise.reject(error)}}