tinode-sdk

0.17.7 • Public • Published

Javascript bindings for Tinode

This SDK implements Tinode client-side protocol for the browser based applications. See it in action at https://web.tinode.co/ and https://sandbox.tinode.co/ (full source).

This is not a standalone project. It can only be used in conjunction with the Tinode server.

Regularly released NPM packages are at https://www.npmjs.com/package/tinode-sdk

You may include the latest standalone minified SDK into your html file as

<script crossorigin="anonymous"
  src="https://cdn.jsdelivr.net/npm/tinode-sdk/umd/tinode.prod.js">
</script>

or while developing as

<script crossorigin="anonymous"
  src="https://cdn.jsdelivr.net/npm/tinode-sdk/umd/tinode.dev.js">
</script>

Getting support

Node JS compatibility

This SDK is intended to be used in a browser. To use tinode-sdk in Node JS environment (such as on a server), you have to polyfill network providers, for example with ws and xmlhttprequest or xhr, as well as indexedDB with something like fake-indexeddb:

  Tinode.setNetworkProviders(require('ws'), require('xmlhttprequest'));
  Tinode.setDatabaseProvider(require('fake-indexeddb'));
  this.tinode = new Tinode(...);

Keep in mind that the SDK also references URL.createObjectURL() which is not currently polyfilled. An exception will be thrown when the user attempts to download a file attachment. See discussion: https://github.com/tinode/tinode-js/issues/28

Package Sidebar

Install

npm i tinode-sdk@0.17.7

Version

0.17.7

License

Apache-2.0

Unpacked Size

753 kB

Total Files

6

Last publish

Collaborators

  • or-else