Web-resource vs client-resource

Could someone explain me, when should I use web-resource or client-resource for downloadable JS or CSS files? I saw several examples, but I cannot understand the difference or realize unambiguous usage of them. Thanks for the helping!

Some locations/sections are only useable by Client Resources. You can see which locations are available by appending ?web.items&web.sections&web.panels to any Bitbucket URL.


Thank you for the reply! Does it mean, if I want to use resources in client fragment, then they will only work, if they are defined in client-resources section in the atlassian-plugin.xml? Similarly, should I use web-resources for web-fragments?

That’s a more complicated question. I am not really sure how it works under the hood, but it seems to me that Client-Resources and Web-Resources are the same thing, but with some different settings. For instance, I have gotten traditional Web-Resources plugin modules to work with Client Fragments, if I transform it correctly.


So it really depends on what you’re doing. To keep it easy, you should use Client Resources with Client Fragments and vice versa for Server-Side Web Fragments.

Thanks you for helping!