Build for Facebook Instant Games

I am trying to use Armory as engine for Facebook Instant Games. Unfortunately i have encountered problems with integration and i don’t have programming skills to resolve it by myself.
From Facebook Instant Games documentation
I found that i have to write this in index.html
<script src=“”></script>

And that was easy. But next i should add

FBInstant.initializeAsync().then(function() {
FBInstant.startGameAsync().then(function() {

instead default onload function of my game
I can’t find were it is, and how it works.

Can can anyone help me?

hey, writing Facebook games should be written from scratch to allow achievements etc…
perhaps if a porting company can help you port the game to Facebook, it’ll be easier.

Thanks for advise. I’ll think about that.
I saw a 2DKIT engine, based on Haxe, which can easily export games on FIG.
And also i have found Haxe externs for Facebook Instant Games SDK.

So i thought it will be not so difficult. But i can’t understand how it works by myself.