How to use Libraries or APIs in projects | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How to use Libraries or APIs in projects

Hello! Well I'm having an epic experience in Sololearn, but now I want to use Libraries. I can just use CDNs in my web app but how do I do it for other languages like using a Library or API or Header file independently. Please help

11th May 2021, 5:08 PM
Dr. Tempoville
Dr. Tempoville - avatar
1 Answer
+ 3
How you connect with a library depends a lot on the programming language and sometimes on the specific library. It always requires reading documentation on the specific library, though. For browser-based(not serverside) JavaScript, you could connect with the jQuery library merely by linking to its CDN and using $ or jQuery in various ways documented at places like https://api.jquery.com/jquery.ajax/ A lot of JavaScript libraries are similar. Many serverside JavaScript libraries can be downloaded and installed using npm or other package managers and then you follow corresponding documentation on the specific library. Some c++ libraries are copy/pastable code. Some like Boost almost always need to be built from source and you may have headaches trying to link to them. For remote API's such as Google Maps, you need to get an API key. You then link to Google Maps libraries and follow their documentation. Facebook API's require API keys and come with SDK's which give you most of the prebuilt functionality you'd want.
11th May 2021, 5:57 PM
Josh Greig
Josh Greig - avatar