Before using this demo, please refer to our document

This demo will go through the flow of using websocket-based event subscriptions from creating an api-key via OAuth to receiving event payloads.

WebSocket Oauth

Please use this link to obtain a api-key for websocket, you need to consent our demo app. Please click on consent. After consent, you will be get an new api-key on that page. Copy that for usage in this app. If you already have a valid Api-key, you can skip this section.

Create Websocket

In this section, we are going to create a websocket entity which will store you event subscriptions. Please copy your API key here. And if you want to use JWT to encrypt your event payload, please enter your secret. Then click on Create Websocket.

Websocket API responses:

Create Event Subscription

After creating the websocket entity, you can create event subscriptions now. Please refer to our doc about the API payload needed to create an event subscription.

Please choose the type of event you want to create, then input your API payload based on the doc. Please copy you websocket id from the previous section into 'endpoint_id' field of the Susbcription payload.

Event subscription API responses:

WebSocket Demo

Now you are ready to use the websocket-based logging service. Please copy your access token from previous sections here. The token is in the websocket_url section of API responses(the string after events/). If your websocket connection is immediately closed, your access token may be invalid or expired, you need to regenerate one.

Websocket logging:

Please make sure you are using the same api-key in this demo app otherwise you may encounter accessing errors.