How to add decorations to an XDG toplevel surface

I am trying to create a window directly using wayland-client.h. I found out that on GNOME there are no server side decorations. So, how are decorations added to GNOME applications?

The expected way are client side decorations. Basically, your application draws the decorations themselves onto the surface.

You could also use libdecor: