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
{{ message }}
This repository was archived by the owner on Jun 9, 2023. It is now read-only.
Michael Lunøe edited this page Sep 16, 2019
·
2 revisions
Usage of the streams object:
const{ streams }=require('@paperspace/client-sdk');constvmStreamNode=document.querySelector('.vmStreamNode');// This could also be an iframe, if you want more control!constvmInfo={
accessToken,// Make a request to your server to retrieve an accessToken using paperspace-node: https://paperspace.github.io/paperspace-node/resourceDelegations.html#.create
machineId // Make a request to your server to retrieve machineId using paperspace-node: https://paperspace.github.io/paperspace-node/machines.html#.list};streams.createStream(vmStreamNode,vmInfo).then(function(stream){stream.open();// Run `stream.destroy();` when done});
Usage of streams.internalApi:
const{ streams }=require('@paperspace/client-sdk');// Declare your open VM request handlerstreams.internalApi.onOpenVmRequest=functionopenVmRequestHandler(vmInfo){// a stream with vmInfo was requested to be opened};streams.internalApi.ready();