Skip to content

Connect to Quix

The Quix SDK comes with a streaming client that enables you to connect to Quix easily, to read data from Quix, and to write data to Quix. The streaming client manages the connections between your application and Quix and makes sure that the data is delivered reliably to and from your application.

Using QuixStreamingClient

Starting with 0.4.0, we’re offering QuixStreamingClient, which handles the cumbersome part of setting up your streaming credentials using the Quix API. When you’re running the app in the online IDE or as a deployment, all you have to do is the following:

Initialize the Client

client = QuixStreamingClient()
var client = new Quix.Sdk.Streaming.QuixStreamingClient();

If you wish to run the same code locally, you’ll have to provide an OAuth2.0 bearer token. We have created a purpose made token for this, called SDK token. Once you have the token you will have to provide it as an argument to QuixStreamingClient or set Quix__Sdk__Token environment variable.

Initialize the Client with an SDK Token

client = QuixStreamingClient('your_token')
var client = new Quix.Sdk.Streaming.QuixStreamingClient("your_token");

Using the streaming client is another way to communicate with a broker. It is a Kafka specific client implementation that requires some explicit configuration but allows you to connect to any Kafka cluster even outside Quix platform. It involves the following steps:

  1. Obtain a client certificate and credentials (security context) for your application.
  2. Create a streaming client.

A security context consists of a client certificate, username, and password. Quix generates these automatically for you when you create a project using the templates provided on the Quix Portal. If necessary, you can download these credentials separately from Topics option on Quix Portal.

The following code shows you how to set up the SecurityOptions for your connection and how to create a StreamingClient instance to start Reading and Writing real-time time series data with Quix:

Set up the SecurityOptions for your connection

client = StreamingClient(',,', security)
var security = new SecurityOptions(CERTIFICATES_FOLDER, QUIX_USER, QUIX_PASSWORD);
var client = new Quix.Sdk.Streaming.StreamingClient(",,", security);

Quix web APIs are secured with OAuth2.0 bearer scheme. Therefore, all HTTP requests to Quix must contain a valid bearer token. You can generate a personal access token (PAT) for use as a bearer token from the portal by following the following steps:

  1. Navigate to your profile by clicking on your avatar and selecting "Profile" from the drop-down menu.

  2. Select "Personal Access Tokens" tab on the profile page.

  3. Click on "Generate Token" button to open a dialog to set a name and an expiry date for the PAT and click on "Create" to generate the PAT.


For your convenience, when you create a new project on the Quix platform, the credentials are generated and set in the code for you. However, it is good practice to move them out of the code to a more secure location like environment variables or a keystore, depending on your development platform.

When you deploy your application to Quix, you can store them on Quix as environment variables.