how to write a FIT file

I am trying to find how to write a simple basic FIT file !

but the SDK is way cryptic on that !

did someone has good sample ?