For this cases there is the LGPL.
Re:How to build an open source business
by rusticpenn on Saturday October 03, 2020 @04:28PM
(#24674462)
Is it not possible to have multiple licenses? AGPL or commercial?
Re:How to build an open source business
by orlandohill on Saturday October 03, 2020 @05:13PM
(#24674712)
Yes. This is sometimes called dual-licensing, but a less ambiguous term is public-private licensing.
For anything that should be integrated into the codebase of your customers I'd recommend a weaker license like MIT or BSD, as most companies shy away from integrating GPL libraries into their codebases for fear of contamination.