chrome.terminalPrivate exists, but it's native code only available to the Secure Shell chrome extension, and only on Chrome OS. I don't think it'd be much help in your case. It just opens a process to "/usr/bin/crosh" and provides a way to stream stdin/stdout over the C++ to JS boundary.
You may get more benefit from nassh_stream.js, nassh_stream_google_relay.js and nassh_google_relay.js. These work together to marshal the ssh connection over traditional web transports. There is an implementation that works over HTTP using XHR, and one using WebSockets.
The easiest way to get things working in a web page may be to write a server that works like the google relay server. See
this part of the FAQ:
86 > But, what if I *want* to ssh over HTTP?
87
88 Secure Shell also knows how to connect to an HTTP-to-ssh relay that was
89 built inside Google. Unfortunately that relay isn't open source, and Google
90 doesn't maintain a public pool of relays.
91
92 However, you're free to build one that works the same way. There should be
93 enough documentation in nassh_google_relay.js to reverse engineer a
94 compatible relay.
95
96 If you're interested in writing an alternative relay library, please mention
97 it on the mailing list.
Rob.