🔐Authorization

To authenticate yourself when connecting to the Flow WebSocket server, send an initial JSON message with the following format:

{
  "type": "auth",
  "data": {
    "app": "<app name>",
    "key": "<user UUID>"
  }
};
Parameter
Type
Required
Description

type

string

Event type, auth in this case

data

object

The object containing the users auth data

data.app

string

The connecting app type

data.key

string

The user's API key from the dashboard

Examples

const authMessage = {
  type: 'auth',
  data: {
    app: "<app name>",
    key: "<user UUID>",
  }
};

ws.send(JSON.stringify(authMessage));

Responses

The API's authentication request can receive various response types, which will be in the following format:

{
  "type" : string
}

The response will contain a "type" field indicating the specific type of response received.

Type

auth_success

Successfully authenticated and connected, you will receive continuous feed data from that point onwards. This data will contain updates and information relevant to your connection.

auth_failed

The connection will be terminated. This indicates that the authentication process was not successful, and as a result, you will no longer receive any further data or updates.

Last updated