---
agentTools:
  projectIndex: https://gamewisp.readme.io/llms.txt
---

# Connecting your Client

[block:callout]
{
  "type": "info",
  "title": "Did you Register your Application?",
  "body": "Before you access Singularity you must first register your application. Check out the \"Registering an Application\" section of these docs to see how."
}
[/block]

Authentication is handled programmatically as follows:

[block:code]
{
  "codes": [
    {
      "code": "socket.emit('authentication', \n    {\n        key: \"your client ID\", \n        secret: \"your client secret\",\n    }\n);\n\n",
      "language": "javascript"
    }
  ]
}
[/block]

The API will respond with the **authenticated** event if your credentials are properly authenticated:

[block:code]
{
  "codes": [
    {
      "code": "socket.on('authenticated', function(response) {\n    //your logic here\n});\n\n//To catch failed client connection attempts.\nsocketClient.on('unauthorized', function(err){\n  console.log('Authentication error: ' + err.message);\n});",
      "language": "javascript"
    }
  ]
}
[/block]

The contents of the **response** object on a successful authentication is a JSON object of the following form:

[block:code]
{
  "codes": [
    {
      "code": "{\n    result: {\n      status: 1,\n      message: \"Client authentication successful.\"\n    },\n}",
      "language": "json"
    }
  ]
}
[/block]

Once your client is connected you can request access to GameWisp Channel data for any channel that has authorized your application and provided your app with an **access\_token** .

[block:api-header]
{
  "type": "basic",
  "title": "What next?"
}
[/block]

Learn how to [connect your Singularity app to a GameWisp channel ](https://gamewisp.readme.io/docs/connecting-to-a-gamewisp-channel-on-singularity) and receive data in real-time.