README
nqm-tdx-client
Universal javascript client for connecting to the TDX via DDP and/or HTTP.
Supports browser and nodejs environments.
install
npm install --save @nqminds/nqm-tdx-client
usage
http
import {TDXApi} from "@nqminds/nqm-tdx-client";
const api = new TDXApi(settings.tdxConfig);
api.authenticate(credentials).then((authToken) => {
myAuthToken = authToken;
...
})
ddp
import {TDXConnections} from "@nqminds/nqm-tdx-client";
const tdxConnections = new TDXConnections(settings.tdxConfig);
tdxConnections.on("user", (connection) => {
log("tdx connection %s initialised for %s", connection.tdx.tdxServer, connection.user.username);
if (connection.subscribe("resources").ready()) {
const resources = connection.cache.resources.find();
...
}
});
tdxConnections.setAuthToken(myAuthToken);
build
git clone https://github.com/nqminds/nqm-tdx-client
npm install
development build
npm run dev
production build
npm run build