[{"_path":"/api/getting-user-presence","_draft":false,"_partial":false,"_empty":false,"title":"Getting User Presence Data","description":"Simply send a GET request to users endpoint with your user ID. This is for the REST API, if you want to check the WebSocket documentation to get real-time updates, click here.","excerpt":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"getting-user-presence-data"},"children":[{"type":"text","value":"Getting User Presence Data"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Simply send a GET request to users endpoint with your "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"user ID"}]},{"type":"text","value":". This is for the REST API, if you want to check the WebSocket documentation to get real-time updates, "},{"type":"element","tag":"a","props":{"href":"/api/working-with-websockets"},"children":[{"type":"text","value":"click here"}]},{"type":"text","value":"."}]},{"type":"element","tag":"h3","props":{"id":"javascript-code"},"children":[{"type":"text","value":"JavaScript Code"}]},{"type":"element","tag":"code","props":{"code":"fetch(\"https://api.lanyard.rest/v1/users/162969778699501569\")\n .then((res) => res.json())\n .then(console.log);\n","language":"js"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"fetch(\"https://api.lanyard.rest/v1/users/162969778699501569\")\n .then((res) => res.json())\n .then(console.log);\n"}]}]}]},{"type":"element","tag":"h3","props":{"id":"interactive-playground"},"children":[{"type":"text","value":"Interactive Playground"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"GET https://api.lanyard.rest/v1/users/:user_id"}]}]},{"type":"element","tag":"introduction-response","props":{},"children":[]}]},"head":{"meta":[{"name":"og:title","property":"og:title","content":"Getting User Presence Data"},{"name":"twitter:title","property":"twitter:title","content":"Getting User Presence Data"},{"name":"description","property":"description","content":"Get a user's Discord presence data from REST API via a GET request."},{"name":"og:description","property":"og:description","content":"Get a user's Discord presence data from REST API via a GET request."},{"name":"twitter:description","property":"twitter:description","content":"Get a user's Discord presence data from REST API via a GET request."}]},"body":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"getting-user-presence-data"},"children":[{"type":"text","value":"Getting User Presence Data"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Simply send a GET request to users endpoint with your "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"user ID"}]},{"type":"text","value":". This is for the REST API, if you want to check the WebSocket documentation to get real-time updates, "},{"type":"element","tag":"a","props":{"href":"/api/working-with-websockets"},"children":[{"type":"text","value":"click here"}]},{"type":"text","value":"."}]},{"type":"element","tag":"h3","props":{"id":"javascript-code"},"children":[{"type":"text","value":"JavaScript Code"}]},{"type":"element","tag":"code","props":{"code":"fetch(\"https://api.lanyard.rest/v1/users/162969778699501569\")\n .then((res) => res.json())\n .then(console.log);\n","language":"js"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#61AFEF"}},"children":[{"type":"text","value":"fetch"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"\"https://api.lanyard.rest/v1/users/162969778699501569\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":")"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" ."}]},{"type":"element","tag":"span","props":{"style":{"color":"#61AFEF"}},"children":[{"type":"text","value":"then"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"(("}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":") "}]},{"type":"element","tag":"span","props":{"style":{"color":"#C678DD"}},"children":[{"type":"text","value":"=>"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#E5C07B"}},"children":[{"type":"text","value":"res"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#61AFEF"}},"children":[{"type":"text","value":"json"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"())"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" ."}]},{"type":"element","tag":"span","props":{"style":{"color":"#61AFEF"}},"children":[{"type":"text","value":"then"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"("}]},{"type":"element","tag":"span","props":{"style":{"color":"#E5C07B"}},"children":[{"type":"text","value":"console"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"log"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":");"}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"interactive-playground"},"children":[{"type":"text","value":"Interactive Playground"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"GET https://api.lanyard.rest/v1/users/:user_id"}]}]},{"type":"element","tag":"introduction-response","props":{},"children":[]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[{"id":"javascript-code","depth":3,"text":"JavaScript Code"},{"id":"interactive-playground","depth":3,"text":"Interactive Playground"}]}},"_type":"markdown","_id":"content:api:getting-user-presence.md","_source":"content","_file":"api/getting-user-presence.md","_extension":"md"},{"_path":"/api/introduction","_draft":false,"_partial":false,"_empty":false,"title":"Introduction","description":"Welcome to Lanyard API v1 documentation. Please keep in mind that this is not the official documentation for Lanyard. This website (as a whole) was created because Lanyard itself didn't had one. Hopefully, this page will be maintained and become the official documentation.","excerpt":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"introduction"},"children":[{"type":"text","value":"Introduction"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Welcome to Lanyard API "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"v1"}]},{"type":"text","value":" documentation. Please keep in mind that this is "},{"type":"element","tag":"strong","props":{},"children":[{"type":"element","tag":"em","props":{},"children":[{"type":"text","value":"not the official"}]}]},{"type":"text","value":" documentation for Lanyard. This website (as a whole) was created because Lanyard itself didn't had one. Hopefully, this page will be maintained and become the official documentation."}]},{"type":"element","tag":"h2","props":{"id":"api-base"},"children":[{"type":"text","value":"API Base"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Current API base is "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"https://api.lanyard.rest/v1"}]},{"type":"text","value":"."}]},{"type":"element","tag":"h2","props":{"id":"choose-a-sub-page"},"children":[{"type":"text","value":"Choose a Sub-Page"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Please choose a sub-page to see the relevant documentation."}]},{"type":"element","tag":"pages","props":{},"children":[]}]},"order":1,"head":{"meta":[{"name":"og:title","property":"og:title","content":"API Introduction"},{"name":"twitter:title","property":"twitter:title","content":"API Introduction"},{"name":"description","property":"description","content":"Learn how you can deal with Lanyard's API using REST and WebSockets."},{"name":"og:description","property":"og:description","content":"Learn how you can deal with Lanyard's API using REST and WebSockets."},{"name":"twitter:description","property":"twitter:description","content":"Learn how you can deal with Lanyard's API using REST and WebSockets."}]},"body":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"introduction"},"children":[{"type":"text","value":"Introduction"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Welcome to Lanyard API "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"v1"}]},{"type":"text","value":" documentation. Please keep in mind that this is "},{"type":"element","tag":"strong","props":{},"children":[{"type":"element","tag":"em","props":{},"children":[{"type":"text","value":"not the official"}]}]},{"type":"text","value":" documentation for Lanyard. This website (as a whole) was created because Lanyard itself didn't had one. Hopefully, this page will be maintained and become the official documentation."}]},{"type":"element","tag":"h2","props":{"id":"api-base"},"children":[{"type":"text","value":"API Base"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Current API base is "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"https://api.lanyard.rest/v1"}]},{"type":"text","value":"."}]},{"type":"element","tag":"h2","props":{"id":"choose-a-sub-page"},"children":[{"type":"text","value":"Choose a Sub-Page"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Please choose a sub-page to see the relevant documentation."}]},{"type":"element","tag":"pages","props":{},"children":[]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[{"id":"api-base","depth":2,"text":"API Base"},{"id":"choose-a-sub-page","depth":2,"text":"Choose a Sub-Page"}]}},"_type":"markdown","_id":"content:api:introduction.md","_source":"content","_file":"api/introduction.md","_extension":"md"},{"_path":"/api/kv","_draft":false,"_partial":false,"_empty":false,"title":"Key-Value Store","description":"Lanyard KV is a a dynamic, real-time key->value store which is added to the Lanyard user API response. When a KV pair is updated, a PRESENCE_UPDATE for the user will also be emitted through the Lanyard socket.","excerpt":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"key-value-store"},"children":[{"type":"text","value":"Key-Value Store"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Lanyard KV is a a dynamic, "},{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"real-time"}]},{"type":"text","value":" key->value store which is added to the Lanyard user API response. When a KV pair is updated, a "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"PRESENCE_UPDATE"}]},{"type":"text","value":" for the user will also be emitted through the Lanyard socket."}]},{"type":"element","tag":"h3","props":{"id":"use-cases"},"children":[{"type":"text","value":"Use Cases"}]},{"type":"element","tag":"ul","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Configuration values for your website"}]},{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Configuration values for Lanyard 3rd party projects"}]},{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Dynamic data for your website/profile (e.g. current location)"}]}]},{"type":"element","tag":"h3","props":{"id":"limits"},"children":[{"type":"text","value":"Limits"}]},{"type":"element","tag":"ol","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Keys and values can only be strings"}]},{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Values can be 30,000 characters maximum"}]},{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Keys must be alphanumeric (a-zA-Z0-9) and 255 characters max length"}]},{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Your user can have a maximum of 512 key->value pairs linked"}]}]},{"type":"element","tag":"h3","props":{"id":"getting-an-api-key"},"children":[{"type":"text","value":"Getting an API Key"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"DM the Lanyard bot ("},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"Lanyard#5766"}]},{"type":"text","value":") with "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":".apikey"}]},{"type":"text","value":" to get your API key."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"When making Lanyard KV API requests, set an "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"Authorization"}]},{"type":"text","value":" header with the API key you received from the Lanyard bot as the value."}]},{"type":"element","tag":"h3","props":{"id":"setting-a-key-value-pair"},"children":[{"type":"text","value":"Setting a key->value pair"}]},{"type":"element","tag":"h4","props":{"id":"discord"},"children":[{"type":"text","value":"Discord"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{"lang":"ts"},"children":[{"type":"text","value":".set "}]}]},{"type":"element","tag":"h4","props":{"id":"http"},"children":[{"type":"text","value":"HTTP"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"PUT https://api.lanyard.rest/v1/users/:user_id/kv/:key"}]},{"type":"text","value":"\nThe value will be set to the body of the request. The body can be any type of data, but it will be string-encoded when set in Lanyard KV."}]},{"type":"element","tag":"h3","props":{"id":"setting-multiple-key-value-pairs"},"children":[{"type":"text","value":"Setting multiple key->value pairs"}]},{"type":"element","tag":"h4","props":{"id":"discord-1"},"children":[{"type":"text","value":"Discord"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Not yet implemented"}]},{"type":"element","tag":"h4","props":{"id":"http-1"},"children":[{"type":"text","value":"HTTP"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"PATCH https://api.lanyard.rest/v1/users/:user_id/kv"}]},{"type":"text","value":"\nThe user's KV store will be merged with the body of the request. Conflicting keys will be overwritten. The body must be keyvalue pair object with a maximum depth of 1."}]},{"type":"element","tag":"h3","props":{"id":"deleting-a-key"},"children":[{"type":"text","value":"Deleting a key"}]},{"type":"element","tag":"h4","props":{"id":"discord-2"},"children":[{"type":"text","value":"Discord"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{"lang":"ts"},"children":[{"type":"text","value":".del "}]}]},{"type":"element","tag":"h4","props":{"id":"http-2"},"children":[{"type":"text","value":"HTTP"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"DELETE https://api.lanyard.rest/v1/users/:user_id/kv/:key"}]}]}]},"head":{"meta":[{"name":"og:title","property":"og:title","content":"Key-Value Store"},{"name":"twitter:title","property":"twitter:title","content":"Key-Value Store"},{"name":"description","property":"description","content":"Use Lanyard KV to display dynamic and real-time updated data through Lanyard API."},{"name":"og:description","property":"og:description","content":"Use Lanyard KV to display dynamic and real-time updated data through Lanyard API."},{"name":"twitter:description","property":"twitter:description","content":"Use Lanyard KV to display dynamic and real-time updated data through Lanyard API."}]},"body":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"key-value-store"},"children":[{"type":"text","value":"Key-Value Store"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Lanyard KV is a a dynamic, "},{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"real-time"}]},{"type":"text","value":" key->value store which is added to the Lanyard user API response. When a KV pair is updated, a "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"PRESENCE_UPDATE"}]},{"type":"text","value":" for the user will also be emitted through the Lanyard socket."}]},{"type":"element","tag":"h3","props":{"id":"use-cases"},"children":[{"type":"text","value":"Use Cases"}]},{"type":"element","tag":"ul","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Configuration values for your website"}]},{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Configuration values for Lanyard 3rd party projects"}]},{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Dynamic data for your website/profile (e.g. current location)"}]}]},{"type":"element","tag":"h3","props":{"id":"limits"},"children":[{"type":"text","value":"Limits"}]},{"type":"element","tag":"ol","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Keys and values can only be strings"}]},{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Values can be 30,000 characters maximum"}]},{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Keys must be alphanumeric (a-zA-Z0-9) and 255 characters max length"}]},{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Your user can have a maximum of 512 key->value pairs linked"}]}]},{"type":"element","tag":"h3","props":{"id":"getting-an-api-key"},"children":[{"type":"text","value":"Getting an API Key"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"DM the Lanyard bot ("},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"Lanyard#5766"}]},{"type":"text","value":") with "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":".apikey"}]},{"type":"text","value":" to get your API key."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"When making Lanyard KV API requests, set an "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"Authorization"}]},{"type":"text","value":" header with the API key you received from the Lanyard bot as the value."}]},{"type":"element","tag":"h3","props":{"id":"setting-a-key-value-pair"},"children":[{"type":"text","value":"Setting a key->value pair"}]},{"type":"element","tag":"h4","props":{"id":"discord"},"children":[{"type":"text","value":"Discord"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{"lang":"ts","class":"colored"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"set"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#56B6C2"}},"children":[{"type":"text","value":"<"}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"key"}]},{"type":"element","tag":"span","props":{"style":{"color":"#56B6C2"}},"children":[{"type":"text","value":">"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" <"}]},{"type":"element","tag":"span","props":{"style":{"color":"#E5C07B"}},"children":[{"type":"text","value":"value"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":">"}]}]}]},{"type":"element","tag":"h4","props":{"id":"http"},"children":[{"type":"text","value":"HTTP"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"PUT https://api.lanyard.rest/v1/users/:user_id/kv/:key"}]},{"type":"text","value":"\nThe value will be set to the body of the request. The body can be any type of data, but it will be string-encoded when set in Lanyard KV."}]},{"type":"element","tag":"h3","props":{"id":"setting-multiple-key-value-pairs"},"children":[{"type":"text","value":"Setting multiple key->value pairs"}]},{"type":"element","tag":"h4","props":{"id":"discord-1"},"children":[{"type":"text","value":"Discord"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Not yet implemented"}]},{"type":"element","tag":"h4","props":{"id":"http-1"},"children":[{"type":"text","value":"HTTP"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"PATCH https://api.lanyard.rest/v1/users/:user_id/kv"}]},{"type":"text","value":"\nThe user's KV store will be merged with the body of the request. Conflicting keys will be overwritten. The body must be keyvalue pair object with a maximum depth of 1."}]},{"type":"element","tag":"h3","props":{"id":"deleting-a-key"},"children":[{"type":"text","value":"Deleting a key"}]},{"type":"element","tag":"h4","props":{"id":"discord-2"},"children":[{"type":"text","value":"Discord"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{"lang":"ts","class":"colored"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"."}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"del"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#56B6C2"}},"children":[{"type":"text","value":"<"}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"key"}]},{"type":"element","tag":"span","props":{"style":{"color":"#56B6C2"}},"children":[{"type":"text","value":">"}]}]}]},{"type":"element","tag":"h4","props":{"id":"http-2"},"children":[{"type":"text","value":"HTTP"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"DELETE https://api.lanyard.rest/v1/users/:user_id/kv/:key"}]}]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[{"id":"use-cases","depth":3,"text":"Use Cases"},{"id":"limits","depth":3,"text":"Limits"},{"id":"getting-an-api-key","depth":3,"text":"Getting an API Key"},{"id":"setting-a-key-value-pair","depth":3,"text":"Setting a key->value pair"},{"id":"setting-multiple-key-value-pairs","depth":3,"text":"Setting multiple key->value pairs"},{"id":"deleting-a-key","depth":3,"text":"Deleting a key"}]}},"_type":"markdown","_id":"content:api:kv.md","_source":"content","_file":"api/kv.md","_extension":"md"},{"_path":"/api/quicklinks","_draft":false,"_partial":false,"_empty":false,"title":"Quicklinks","description":"Lanyard quicklinks allow you to easily access resources from Discord, such as profile pictures.","excerpt":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"quicklinks"},"children":[{"type":"text","value":"Quicklinks"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Lanyard quicklinks allow you to easily access resources from Discord, such as profile pictures."}]},{"type":"element","tag":"h3","props":{"id":"user-icons"},"children":[{"type":"text","value":"User Icons"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"https://api.lanyard.rest/."}]},{"type":"text","value":"\nWhere "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"id"}]},{"type":"text","value":" is the Discord user ID. "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"file_type"}]},{"type":"text","value":" can be one of: "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"png"}]},{"type":"text","value":", "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"gif"}]},{"type":"text","value":", "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"webp"}]},{"type":"text","value":", "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"jpg"}]},{"type":"text","value":", or "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"jpeg"}]}]}]},"head":{"meta":[{"name":"og:title","property":"og:title","content":"Quicklinks"},{"name":"twitter:title","property":"twitter:title","content":"Quicklinks"},{"name":"description","property":"description","content":"Use Lanyard Quicklinks to easily access resources from Discord such as profile pictures."},{"name":"og:description","property":"og:description","content":"Use Lanyard Quicklinks to easily access resources from Discord such as profile pictures."},{"name":"twitter:description","property":"twitter:description","content":"Use Lanyard Quicklinks to easily access resources from Discord such as profile pictures."}]},"body":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"quicklinks"},"children":[{"type":"text","value":"Quicklinks"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Lanyard quicklinks allow you to easily access resources from Discord, such as profile pictures."}]},{"type":"element","tag":"h3","props":{"id":"user-icons"},"children":[{"type":"text","value":"User Icons"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"https://api.lanyard.rest/."}]},{"type":"text","value":"\nWhere "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"id"}]},{"type":"text","value":" is the Discord user ID. "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"file_type"}]},{"type":"text","value":" can be one of: "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"png"}]},{"type":"text","value":", "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"gif"}]},{"type":"text","value":", "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"webp"}]},{"type":"text","value":", "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"jpg"}]},{"type":"text","value":", or "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"jpeg"}]}]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[{"id":"user-icons","depth":3,"text":"User Icons"}]}},"_type":"markdown","_id":"content:api:quicklinks.md","_source":"content","_file":"api/quicklinks.md","_extension":"md"},{"_path":"/api/self-hosting","_draft":false,"_partial":false,"_empty":false,"title":"Self-Hosting Lanyard","description":"Build the Docker image by cloning this repo and running:","excerpt":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"self-hosting-lanyard"},"children":[{"type":"text","value":"Self-Hosting Lanyard"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Build the Docker image by cloning this repo and running:"}]},{"type":"element","tag":"code","props":{"code":"# The latest version is already on the docker hub, you can skip this step unless you would like to run a modified version.\ndocker build -t phineas/lanyard:latest .\n","language":"bash"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"# The latest version is already on the docker hub, you can skip this step unless you would like to run a modified version.\ndocker build -t phineas/lanyard:latest .\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"If you don't already have a redis server you'll need to run one, here's the docker command to run one:"}]},{"type":"element","tag":"code","props":{"code":"docker run -d --name lanyard-redis -v docker_mount_location_on_host:/data redis\n","language":"bash"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"docker run -d --name lanyard-redis -v docker_mount_location_on_host:/data redis\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"And run Lanyard API server using:"}]},{"type":"element","tag":"code","props":{"code":"docker run --rm -it -p 4001:4001 -e REDIS_HOST=redis -e BOT_TOKEN= --link lanyard-redis:redis phineas/lanyard:latest\n","language":"bash"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"docker run --rm -it -p 4001:4001 -e REDIS_HOST=redis -e BOT_TOKEN= --link lanyard-redis:redis phineas/lanyard:latest\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You'll be able to access the API using "},{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"port 4001"}]},{"type":"text","value":"."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You also need to create a Discord bot and use its token above."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Create a bot here: "},{"type":"element","tag":"a","props":{"href":"https://discord.com/developers/applications","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"https://discord.com/developers/applications"}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"Make sure you enable"}]},{"type":"text","value":" these settings in your bot settings:"}]},{"type":"element","tag":"ul","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Privileged Gateway Intents > "},{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"PRESENCE INTENT"}]}]},{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Privileged Gateway Intents > "},{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"SERVER MEMBERS INTENT"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"If you'd like to run Lanyard with "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"docker-compose"}]},{"type":"text","value":", here's an example:"}]},{"type":"element","tag":"code","props":{"code":"version: \"3.8\"\n\nservices:\n redis:\n image: redis\n restart: always\n container_name: lanyard_redis\n lanyard:\n image: phineas/lanyard:latest\n restart: always\n container_name: lanyard\n depends_on:\n - redis\n ports:\n - 4001:4001\n environment:\n BOT_TOKEN: \n REDIS_HOST: redis\n","language":"yaml"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"version: \"3.8\"\n\nservices:\n redis:\n image: redis\n restart: always\n container_name: lanyard_redis\n lanyard:\n image: phineas/lanyard:latest\n restart: always\n container_name: lanyard\n depends_on:\n - redis\n ports:\n - 4001:4001\n environment:\n BOT_TOKEN: \n REDIS_HOST: redis\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Note, that you're "},{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"hosting a http server, not https"}]},{"type":"text","value":". You'll need to use a "},{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"reverse proxy"}]},{"type":"text","value":" such as "},{"type":"element","tag":"a","props":{"href":"https://traefik.io/traefik/","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"traefik"}]},{"type":"text","value":" if you want to secure your API endpoint."}]}]},"head":{"meta":[{"name":"og:title","property":"og:title","content":"Self-Hosting Lanyard"},{"name":"twitter:title","property":"twitter:title","content":"Self-Hosting Lanyard"},{"name":"description","property":"description","content":"Build Lanyard from source and self-host it using the Docker image."},{"name":"og:description","property":"og:description","content":"Build Lanyard from source and self-host it using the Docker image."},{"name":"twitter:description","property":"twitter:description","content":"Build Lanyard from source and self-host it using the Docker image."}]},"body":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"self-hosting-lanyard"},"children":[{"type":"text","value":"Self-Hosting Lanyard"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Build the Docker image by cloning this repo and running:"}]},{"type":"element","tag":"code","props":{"code":"# The latest version is already on the docker hub, you can skip this step unless you would like to run a modified version.\ndocker build -t phineas/lanyard:latest .\n","language":"bash"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#7F848E"}},"children":[{"type":"text","value":"# The latest version is already on the docker hub, you can skip this step unless you would like to run a modified version."}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"docker build -t phineas/lanyard:latest "}]},{"type":"element","tag":"span","props":{"style":{"color":"#56B6C2"}},"children":[{"type":"text","value":"."}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"If you don't already have a redis server you'll need to run one, here's the docker command to run one:"}]},{"type":"element","tag":"code","props":{"code":"docker run -d --name lanyard-redis -v docker_mount_location_on_host:/data redis\n","language":"bash"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"docker run -d --name lanyard-redis -v docker_mount_location_on_host:/data redis"}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"And run Lanyard API server using:"}]},{"type":"element","tag":"code","props":{"code":"docker run --rm -it -p 4001:4001 -e REDIS_HOST=redis -e BOT_TOKEN= --link lanyard-redis:redis phineas/lanyard:latest\n","language":"bash"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"docker run --rm -it -p 4001:4001 -e REDIS_HOST=redis -e BOT_TOKEN= --link lanyard-redis:redis phineas/lanyard:latest"}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You'll be able to access the API using "},{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"port 4001"}]},{"type":"text","value":"."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You also need to create a Discord bot and use its token above."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Create a bot here: "},{"type":"element","tag":"a","props":{"href":"https://discord.com/developers/applications","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"https://discord.com/developers/applications"}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"Make sure you enable"}]},{"type":"text","value":" these settings in your bot settings:"}]},{"type":"element","tag":"ul","props":{},"children":[{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Privileged Gateway Intents > "},{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"PRESENCE INTENT"}]}]},{"type":"element","tag":"li","props":{},"children":[{"type":"text","value":"Privileged Gateway Intents > "},{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"SERVER MEMBERS INTENT"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"If you'd like to run Lanyard with "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"docker-compose"}]},{"type":"text","value":", here's an example:"}]},{"type":"element","tag":"code","props":{"code":"version: \"3.8\"\n\nservices:\n redis:\n image: redis\n restart: always\n container_name: lanyard_redis\n lanyard:\n image: phineas/lanyard:latest\n restart: always\n container_name: lanyard\n depends_on:\n - redis\n ports:\n - 4001:4001\n environment:\n BOT_TOKEN: \n REDIS_HOST: redis\n","language":"yaml"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"version"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":": "}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"\"3.8\""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"services"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":":"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"redis"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":":"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"image"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":": "}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"redis"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"restart"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":": "}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"always"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"container_name"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":": "}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"lanyard_redis"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"lanyard"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":":"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"image"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":": "}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"phineas/lanyard:latest"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"restart"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":": "}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"always"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"container_name"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":": "}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"lanyard"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"depends_on"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":":"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" - "}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"redis"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"ports"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":":"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" - "}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"4001:4001"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"environment"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":":"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"BOT_TOKEN"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":": "}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":""}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#E06C75"}},"children":[{"type":"text","value":"REDIS_HOST"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":": "}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"redis"}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Note, that you're "},{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"hosting a http server, not https"}]},{"type":"text","value":". You'll need to use a "},{"type":"element","tag":"strong","props":{},"children":[{"type":"text","value":"reverse proxy"}]},{"type":"text","value":" such as "},{"type":"element","tag":"a","props":{"href":"https://traefik.io/traefik/","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"traefik"}]},{"type":"text","value":" if you want to secure your API endpoint."}]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[]}},"_type":"markdown","_id":"content:api:self-hosting.md","_source":"content","_file":"api/self-hosting.md","_extension":"md"},{"_path":"/api/working-with-websockets","_draft":false,"_partial":false,"_empty":false,"title":"Working with WebSockets","description":"The WebSocket server acts like a \"real-time update data\" server, each time a presence update is triggered, you'll receive the new data from the WS server. The Lanyard WebSocket is available at wss://api.lanyard.rest/socket. If you would like to use compression, please specify ?compression=zlib_json at the end of the URL. You can read more about WebSockets for web here.","excerpt":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"working-with-websockets"},"children":[{"type":"text","value":"Working with WebSockets"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"The WebSocket server acts like a \"real-time update data\" server, each time a presence update is triggered, you'll receive the new data from the WS server. The Lanyard WebSocket is available at "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"wss://api.lanyard.rest/socket"}]},{"type":"text","value":". If you would like to use compression, please specify "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"?compression=zlib_json"}]},{"type":"text","value":" at the end of the URL. "},{"type":"element","tag":"a","props":{"href":"https://developer.mozilla.org/en-US/docs/Web/API/WebSocket","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"You can read more about WebSockets for web here"}]},{"type":"text","value":"."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Once connected, you will receive "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"Opcode 1: Hello"}]},{"type":"text","value":" which will contain heartbeat_interval in the data field. You should set a repeating interval for the time specified in heartbeat_interval which should send "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"Opcode 3: Heartbeat"}]},{"type":"text","value":" on the interval."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You should send "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"Opcode 2: Initialize"}]},{"type":"text","value":" immediately after receiving Opcode 1."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Example of "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"Opcode 2: Initialize"}]},{"type":"text","value":":"}]},{"type":"element","tag":"code","props":{"code":"{\n op: 2,\n d: {\n // subscribe_to_ids should be an array of user IDs you want to subscribe to presences from\n // if Lanyard doesn't monitor an ID specified, it won't be included in INIT_STATE\n subscribe_to_ids: [\"162969778699501569\"]\n }\n}\n","language":"js"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"{\n op: 2,\n d: {\n // subscribe_to_ids should be an array of user IDs you want to subscribe to presences from\n // if Lanyard doesn't monitor an ID specified, it won't be included in INIT_STATE\n subscribe_to_ids: [\"162969778699501569\"]\n }\n}\n"}]}]}]},{"type":"element","tag":"h4","props":{"id":"subscribing-to-multiple-user-presences"},"children":[{"type":"text","value":"Subscribing to multiple user presences"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"To subscribe to multiple presences, send "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"subscribe_to_ids"}]},{"type":"text","value":" in the data object with a "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"string[]"}]},{"type":"text","value":" list of user IDs to subscribe to. Then, INIT_STATE's data object will contain a user_id->presence map. You can find examples below."}]},{"type":"element","tag":"h4","props":{"id":"subscribing-to-a-single-user-presence"},"children":[{"type":"text","value":"Subscribing to a single user presence"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"If you just want to subscribe to one user, you can send "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"subscribe_to_id"}]},{"type":"text","value":" instead with a string of a single user ID to subscribe to. Then, the INIT_STATE's data will just contain the presence object for the user you've subscribed to instead of a user_id->presence map."}]},{"type":"element","tag":"h4","props":{"id":"subscribing-to-every-user-presence"},"children":[{"type":"text","value":"Subscribing to every user presence"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"If you want to subscribe to every presence being monitored by Lanyard, you can specify "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"subscribe_to_all"}]},{"type":"text","value":" with (bool) "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"true"}]},{"type":"text","value":" in the data object, and you will then receive a user_id->presence map with every user presence in INIT_STATE, and their respective PRESENCE_UPDATES when they happen."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Once Op 2 is sent, you should immediately receive an "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"INIT_STATE"}]},{"type":"text","value":" event payload if connected successfully. If not, you will be disconnected with an error (see below)."}]},{"type":"element","tag":"h3","props":{"id":"list-of-opcodes"},"children":[{"type":"text","value":"List of Opcodes"}]},{"type":"element","tag":"list-opcodes","props":{},"children":[]},{"type":"element","tag":"h3","props":{"id":"events"},"children":[{"type":"text","value":"Events"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Events are received on "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"Opcode 0: Event"}]},{"type":"text","value":" - the event type will be part of the root message object under the "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"t"}]},{"type":"text","value":" key."}]},{"type":"element","tag":"h4","props":{"id":"example-event-message-objects"},"children":[{"type":"text","value":"Example Event Message Objects"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"INIT_STATE"}]}]},{"type":"element","tag":"code","props":{"code":"{\n op: 0,\n seq: 1,\n t: \"INIT_STATE\",\n d: {\n \"162969778699501569\": {\n // Full Lanyard presence (see API docs above for example)\n }\n }\n}\n","language":"js"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"{\n op: 0,\n seq: 1,\n t: \"INIT_STATE\",\n d: {\n \"162969778699501569\": {\n // Full Lanyard presence (see API docs above for example)\n }\n }\n}\n"}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"PRESENCE_UPDATE"}]}]},{"type":"element","tag":"code","props":{"code":"{\n op: 0,\n seq: 2,\n t: \"PRESENCE_UPDATE\",\n d: {\n // Full Lanyard presence and an extra \"user_id\" field\n }\n}\n","language":"js"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"text","value":"{\n op: 0,\n seq: 2,\n t: \"PRESENCE_UPDATE\",\n d: {\n // Full Lanyard presence and an extra \"user_id\" field\n }\n}\n"}]}]}]},{"type":"element","tag":"h3","props":{"id":"error-codes"},"children":[{"type":"text","value":"Error Codes"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Lanyard can disconnect clients for multiple reasons, usually to do with messages being badly formatted. Please refer to your WebSocket client to see how you should handle errors - they do not get received as regular messages."}]},{"type":"element","tag":"h4","props":{"id":"types-of-errors"},"children":[{"type":"text","value":"Types of Errors"}]},{"type":"element","tag":"error-types","props":{},"children":[]}]},"head":{"meta":[{"name":"og:title","property":"og:title","content":"Working with WebSockets"},{"name":"twitter:title","property":"twitter:title","content":"Working with WebSockets"},{"name":"description","property":"description","content":"Use Lanyard with WebSockets to achieve real-time presence updates."},{"name":"og:description","property":"og:description","content":"Use Lanyard with WebSockets to achieve real-time presence updates."},{"name":"twitter:description","property":"twitter:description","content":"Use Lanyard with WebSockets to achieve real-time presence updates."}]},"body":{"type":"root","children":[{"type":"element","tag":"h1","props":{"id":"working-with-websockets"},"children":[{"type":"text","value":"Working with WebSockets"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"The WebSocket server acts like a \"real-time update data\" server, each time a presence update is triggered, you'll receive the new data from the WS server. The Lanyard WebSocket is available at "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"wss://api.lanyard.rest/socket"}]},{"type":"text","value":". If you would like to use compression, please specify "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"?compression=zlib_json"}]},{"type":"text","value":" at the end of the URL. "},{"type":"element","tag":"a","props":{"href":"https://developer.mozilla.org/en-US/docs/Web/API/WebSocket","rel":["nofollow","noopener","noreferrer"],"target":"_blank"},"children":[{"type":"text","value":"You can read more about WebSockets for web here"}]},{"type":"text","value":"."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Once connected, you will receive "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"Opcode 1: Hello"}]},{"type":"text","value":" which will contain heartbeat_interval in the data field. You should set a repeating interval for the time specified in heartbeat_interval which should send "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"Opcode 3: Heartbeat"}]},{"type":"text","value":" on the interval."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"You should send "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"Opcode 2: Initialize"}]},{"type":"text","value":" immediately after receiving Opcode 1."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Example of "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"Opcode 2: Initialize"}]},{"type":"text","value":":"}]},{"type":"element","tag":"code","props":{"code":"{\n op: 2,\n d: {\n // subscribe_to_ids should be an array of user IDs you want to subscribe to presences from\n // if Lanyard doesn't monitor an ID specified, it won't be included in INIT_STATE\n subscribe_to_ids: [\"162969778699501569\"]\n }\n}\n","language":"js"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" op: "}]},{"type":"element","tag":"span","props":{"style":{"color":"#D19A66"}},"children":[{"type":"text","value":"2"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":","}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" d: {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7F848E"}},"children":[{"type":"text","value":"// subscribe_to_ids should be an array of user IDs you want to subscribe to presences from"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7F848E"}},"children":[{"type":"text","value":"// if Lanyard doesn't monitor an ID specified, it won't be included in INIT_STATE"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" subscribe_to_ids: ["}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"\"162969778699501569\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"]"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"}"}]}]}]}]}]},{"type":"element","tag":"h4","props":{"id":"subscribing-to-multiple-user-presences"},"children":[{"type":"text","value":"Subscribing to multiple user presences"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"To subscribe to multiple presences, send "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"subscribe_to_ids"}]},{"type":"text","value":" in the data object with a "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"string[]"}]},{"type":"text","value":" list of user IDs to subscribe to. Then, INIT_STATE's data object will contain a user_id->presence map. You can find examples below."}]},{"type":"element","tag":"h4","props":{"id":"subscribing-to-a-single-user-presence"},"children":[{"type":"text","value":"Subscribing to a single user presence"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"If you just want to subscribe to one user, you can send "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"subscribe_to_id"}]},{"type":"text","value":" instead with a string of a single user ID to subscribe to. Then, the INIT_STATE's data will just contain the presence object for the user you've subscribed to instead of a user_id->presence map."}]},{"type":"element","tag":"h4","props":{"id":"subscribing-to-every-user-presence"},"children":[{"type":"text","value":"Subscribing to every user presence"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"If you want to subscribe to every presence being monitored by Lanyard, you can specify "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"subscribe_to_all"}]},{"type":"text","value":" with (bool) "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"true"}]},{"type":"text","value":" in the data object, and you will then receive a user_id->presence map with every user presence in INIT_STATE, and their respective PRESENCE_UPDATES when they happen."}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Once Op 2 is sent, you should immediately receive an "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"INIT_STATE"}]},{"type":"text","value":" event payload if connected successfully. If not, you will be disconnected with an error (see below)."}]},{"type":"element","tag":"h3","props":{"id":"list-of-opcodes"},"children":[{"type":"text","value":"List of Opcodes"}]},{"type":"element","tag":"list-opcodes","props":{},"children":[]},{"type":"element","tag":"h3","props":{"id":"events"},"children":[{"type":"text","value":"Events"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Events are received on "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"Opcode 0: Event"}]},{"type":"text","value":" - the event type will be part of the root message object under the "},{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"t"}]},{"type":"text","value":" key."}]},{"type":"element","tag":"h4","props":{"id":"example-event-message-objects"},"children":[{"type":"text","value":"Example Event Message Objects"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"INIT_STATE"}]}]},{"type":"element","tag":"code","props":{"code":"{\n op: 0,\n seq: 1,\n t: \"INIT_STATE\",\n d: {\n \"162969778699501569\": {\n // Full Lanyard presence (see API docs above for example)\n }\n }\n}\n","language":"js"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" op: "}]},{"type":"element","tag":"span","props":{"style":{"color":"#D19A66"}},"children":[{"type":"text","value":"0"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":","}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" seq: "}]},{"type":"element","tag":"span","props":{"style":{"color":"#D19A66"}},"children":[{"type":"text","value":"1"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":","}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" t: "}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"\"INIT_STATE\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":","}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" d: {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"\"162969778699501569\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":": {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7F848E"}},"children":[{"type":"text","value":"// Full Lanyard presence (see API docs above for example)"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"}"}]}]}]}]}]},{"type":"element","tag":"p","props":{},"children":[{"type":"element","tag":"code-inline","props":{},"children":[{"type":"text","value":"PRESENCE_UPDATE"}]}]},{"type":"element","tag":"code","props":{"code":"{\n op: 0,\n seq: 2,\n t: \"PRESENCE_UPDATE\",\n d: {\n // Full Lanyard presence and an extra \"user_id\" field\n }\n}\n","language":"js"},"children":[{"type":"element","tag":"pre","props":{},"children":[{"type":"element","tag":"code","props":{"__ignoreMap":""},"children":[{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"{"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" op: "}]},{"type":"element","tag":"span","props":{"style":{"color":"#D19A66"}},"children":[{"type":"text","value":"0"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":","}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" seq: "}]},{"type":"element","tag":"span","props":{"style":{"color":"#D19A66"}},"children":[{"type":"text","value":"2"}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":","}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" t: "}]},{"type":"element","tag":"span","props":{"style":{"color":"#98C379"}},"children":[{"type":"text","value":"\"PRESENCE_UPDATE\""}]},{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":","}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" d: {"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" "}]},{"type":"element","tag":"span","props":{"style":{"color":"#7F848E"}},"children":[{"type":"text","value":"// Full Lanyard presence and an extra \"user_id\" field"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":" }"}]}]},{"type":"element","tag":"span","props":{"class":"line"},"children":[{"type":"element","tag":"span","props":{"style":{"color":"#ABB2BF"}},"children":[{"type":"text","value":"}"}]}]}]}]}]},{"type":"element","tag":"h3","props":{"id":"error-codes"},"children":[{"type":"text","value":"Error Codes"}]},{"type":"element","tag":"p","props":{},"children":[{"type":"text","value":"Lanyard can disconnect clients for multiple reasons, usually to do with messages being badly formatted. Please refer to your WebSocket client to see how you should handle errors - they do not get received as regular messages."}]},{"type":"element","tag":"h4","props":{"id":"types-of-errors"},"children":[{"type":"text","value":"Types of Errors"}]},{"type":"element","tag":"error-types","props":{},"children":[]}],"toc":{"title":"","searchDepth":2,"depth":2,"links":[{"id":"list-of-opcodes","depth":3,"text":"List of Opcodes"},{"id":"events","depth":3,"text":"Events"},{"id":"error-codes","depth":3,"text":"Error Codes"}]}},"_type":"markdown","_id":"content:api:working-with-websockets.md","_source":"content","_file":"api/working-with-websockets.md","_extension":"md"}]