The best way to use a third-party library in your code is to introduce an abstraction class/layer between your code and the third-party library. This has the advantage that you can make clear which functionality you use from the third-party library (you seldom use everything from a third-party library), and also that the classes and types of the third-party library do not leak into your code. That way, you are still in control with your own code.
In his book "Clean Code", Robert Martin writes about this in chapter 8, "Boundaries". HeYou can also gives a trick to 'test'write (unit) tests against the third-party library, which comes in handy whencalls the methods you need and evaluates the responses or actions. That way, you can easily check if the functionality of the third-party library releaseshas changed during an update or upgrade.