Client Instance
A client
instance serves as an entry point to the Query
and Embed
APIs.
With it, you can create and run queries as well as embed Zoomdata charts in a web application.
As of version 2.6.0
of Zoomdata, you can also use a client
instance to query the metadata of a Zoomdata source.
This functionality provides developers with insight as to how a Zoomdata source is configured.
For example, you can query the metadata to find out what TIME
fields are available for grouping or filtering or to get a list of metrics that can be used when creating queries.
Example:
import ZoomdataSDK from 'zoomdata-client';
const application = {
host: 'developer.zoomdata.com',
port: 443,
path: '/zoomdata-3',
secure: true,
};
const credentials = {
key: 'sIcbcDiO6C',
};
const createClientInstance = async () => {
try {
// create the client and store in a variable
const client = await ZoomdataSDK.createClient({ application, credentials }); } catch (err) {
console.log(err);
}
};
Try this example on CodeSandbox
Updated Jan 10, 2019