I am using "ng2-account-kit" library for login in an angular 4 app. I have initialized SDK in my login component like this :
ngOnInit() {
AccountKit.init({
appId: '{{FACEBOOK_APP_ID}}',
state: '{{csrf}}',
version: '{{ACCOUNT_KIT_API_VERSION}}'
})
}
Also I added this :
<script src="https://sdk.accountkit.com/en_US/sdk.js"></script>
in my index.html file.
I am getting "AccountKit SDK was not initialized. Call AccountKit.init first." error. But when i reload the same page, it works properly.
I also tried initializing account kit on my app.component.ts file but got the same error.
Can anyone please tell what I am missing or where to properly initialize the account-kit?