chatgpt.js is a powerful JavaScript library that allows for super easy interaction w/ the ChatGPT DOM. • Feature-rich • Object-oriented • Easy-to-use • Lightweight (yet optimally performant)
How does chatgpt.js handle error management when interacting with the ChatGPT DOM? Are there any built-in features to aid developers in this aspect? And by the way, congrats on the launch!
@ricardo_luz thanks! The lib uses fallbacks where possible so that apps can continue to run for a max positive user experience, for example:
var menuBtn = document.querySelector('nav button[id*="headless"]') || {};
..then if OpenAI changed the menu button, the lib selected an empty object so the app won't crash, and the lib is patched ASAP and served via the https://code.chatgptjs.org/chatg... so no maintenance required by app author (unless the jsDelivr URL was used which is required for userscripts that post to repo's like Greasy Fork that maintain a whitelist of pre-approved CDNs, then bumping the version is required)
But even then, error logging is used to provide aid to devs on DOM updates that potentially beak things:
try { menuBtn.click(); } catch (error) { console.error('🤖 chatgpt.js >> Headless menu not found'); return; }
...so if error is observed, you can quickly report it on GitHub and it will be patched right away (or even submit a pull request yourself!)
Congratulations! What are some unique features or aspects of your project that set it apart from competitors? How do you plan to stay ahead in the market?
@nikolai_persiianov Thank you! Currently there are no competitors for client-side ChatGPT libraries (a ton of API wrappers exist in many languages for back-end) so that is likely partially responsible for the great traction thus far.
Apart from being unique in existence, a lot of the functions are quite easy to use but very powerful.
For example, chatgpt.alert() is used to easily trigger alerts to auto-updates when apps get updated, resulting in beautiful alerts by simply supplying a title, msg & named button function as arguments:
... that also drive traffic where you want (GitHub, blog, etc.) when you include links, to increase social activity on other platforms.
Also the needs of users are used to build out next features. For example, someone needed it to render HTML, and the function was added within days) and because it's open-source yet very actively maintained, that keeps it ahead in the market at light speed (compare this to issues raised in some other repos take up to months to resolve)
First impression of your site: the font size is a little big, making the content feel more crowded than I personally prefer. However, that is a minor thing compared to the deeply appreciated no-nonsense and to the point documentation that site provides and the links at the end to some useful tools all sans any of the typical BS requiring I use Chrome instead to install the web extension for it that won't run on Firefox or nagging about the change in Chrome's manifest version for 12 paragraphs I don't really care enough to read since I am not using it anyway. Instead, clear writing and a product that targets common userscript managers, with friends that provide useful functionality as is.
chatgpt.js
chatgpt.js
Voxme: AI coach, insights, guidance
chatgpt.js
MegaVote
chatgpt.js