WARNING
This SDK tool is still working in progress! 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 16+
- npm 7+ | pnpm 6+ | yarn 1+
#Installation
#Usage
#Configuration
- baseUrl:
string
- local:
http://localhost:8080
- production:
https://api.instill.tech
- local:
- appVersion:
string
v1alpha
- apiToken:
string
- local
- username:
admin
- password:
password
// This is the initial password, once they login for the first time, they will need to change it to other password
- username:
- production
- go the setting page and create a api token.
https://console.instill.tech/settings
- go the setting page and create a api token.
- local
#Connect with Instill Cloud
const client = new InstillClient( "https://api.instill.tech", // baseUrl "v1alpha", // appVersion "<your_api_token>" // get console API token from `https://console.instill.tech/settings`);
#Connect with Instill Core
const client = new InstillClient( "http://localhost:8080", // baseUrl "v1alpha", // appVersion "<your_api_token>" // get console API token from `http://localhost:3000/settings`);
#Example Apps
#Connect SDK with Instill Cloud
import { useEffect, useState } from "react";import InstillClient, { User } from "@instill-ai/typescript-sdk";export default function TypescriptSdkDemo() { const [user, setUser] = useState<User[]>([]); const client = new InstillClient( "https://api.instill.tech", "v1alpha", "<your_api_token>" // get console API token from `https://console.instill.tech/settings` ); useEffect(() => { client.Auth.getUserQuery() .then((data: any) => { console.log("data", data); setUser(data); }) .catch((error: any) => { console.log("error", error); }); }, []); return ( <> <h1>User Data</h1> <pre style={{ backgroundColor: "white" }}> {JSON.stringify(user, null, 4)} </pre> </> );}
#Connect with Instill Core
INFO
Make sure you have Instill Core upruning in your local machine. To run the
VDP
locally please follow our tutorial on
VDP
import { useEffect, useState } from "react";import InstillClient, { User } from "@instill-ai/typescript-sdk";export default function TypescriptSdkDemo() { const [user, setUser] = useState<User[]>([]); const client = new InstillClient( "http://localhost:8080", "v1alpha", "<your_api_token>" // get console API token from `http://localhost:3000/settings` ); useEffect(() => { client.Auth.getUserQuery() .then((data: any) => { console.log("data", data); setUser(data); }) .catch((error: any) => { console.log("error", error); }); }, []); return ( <> <h1>User Data</h1> <pre style={{ backgroundColor: "white" }}> {JSON.stringify(user, null, 4)} </pre> </> );}
#Example Templetes
#Next App
#Node App
#API Reference
#Pipelines
Function | Params |
---|---|
listPipelinesQuery | pageSize, nextPageToken |
listUserPipelinesQuery | pageSize, nextPageToken, userName |
getUserPipelineQuery | pipelineName |
ListUserPipelineReleasesQuery | userName, pipelineName, pageSize, nextPageToken |
getUserPipelineReleaseQuery | pipelineReleaseName |
watchUserPipelineReleaseQuery | pipelineReleaseName |
createUserPipelineMutation | userName, payload |
updateUserPipelineMutation | payload |
deleteUserPipelineMutation | pipelineName |
renameUserPipelineMutation | payload |
createUserPipelineReleaseMutation | pipelineName, payload |
updateUserPipelineReleaseMutation | pipelineReleaseName, payload |
deleteUserPipelineReleaseMutation | pipelineReleaseName |
triggerUserPipelineAction | pipelineName, payload, returnTraces |
triggerAsyncUserPipelineAction | pipelineName, payload, returnTraces |
setDefaultUserPipelineReleaseMutation | pipelineReleaseName |
restoreUserPipelineReleaseMutation | pipelineReleaseName |
triggerUserPipelineReleaseAction | pipelineReleaseName, payload, returnTraces |
triggerAsyncUserPipelineReleaseAction | pipelineReleaseName, payload, returnTraces |
#Connector
Function | Params |
---|---|
listConnectorResourcesQuery | userName, pageSize, nextPageToken, filter |
listUserConnectorResourcesQuery | pageSize, nextPageToken, filter |
listConnectorDefinitionsQuery | connectorDefinitionName |
getConnectorDefinitionQuery | connectorDefinitionName |
getUserConnectorResourceQuery | connectorDefinitionName |
watchUserConnectorResource | userName, payload |
createUserConnectorResourceMutation | connectorDefinitionName |
deleteUserConnectorResourceMutation | payload |
updateUserConnectorResourceMutation | payload |
renameUserConnectorResource | payload |
testUserConnectorResourceConnectionAction | connectorDefinitionName |
connectUserConnectorResourceAction | connectorDefinitionName |
disconnectUserConnectorResourceAction | connectorDefinitionName |
#Metric
Function | Params |
---|---|
listPipelineTriggerRecordsQuery | pageSize, nextPageToken, filter |
listTriggeredPipelineQuery | pageSize, nextPageToken, filter |
listTriggeredPipelineChartQuery | pageSize, nextPageToken, filter |
modelDefinitionName,
#Model
Function | Params |
---|---|
getModelDefinitionQuery | modelDefinitionName |
listModelDefinitionsQuery | pageSize, nextPageToken |
getUserModelQuery | modelName |
listModelsQuery | pageSize, nextPageToken |
listUserModelsQuery | userName, pageSize, nextPageToken |
getUserModelReadmeQuery | modelName |
watchUserModel | modelName |
createUserModelMutation | userName, payload |
updateModelMutation | payload |
deleteUserModelMutation | modelName |
deployUserModelAction | modelName |
undeployUserModeleAction | modelName |
#Operation
Function | Params |
---|---|
getOperationQuery | operationName |
checkUntilOperationIsDoen | operationName |
#Mgmt
Function | Params |
---|---|
getUserQuery | apiToken |
checkUserIdExist | id |
getApiTokenQuery | tokenName |
listApiTokensQuery | pageSize, nextPageToken |
updateUserMutation | payload |
createApiTokenMutation | payload |
deleteApiTokenMutation | tokenName |
#Generate proto-ts
./generate_proto.sh
It will genrate protobuf into dist/protogen-ts
folder