ThAFF Embed
This library provides services to embed ThAFF functionalities to your website.
Everything is written in TypeScript with type declaration files for lazy loaded libraries. The basic repository contains a Loader
class in order to fetch the real scripts from our Servers. This will ensure fast bugfixes without the requirement to update your codebase.
import {Loader} from 'thaff-embed-scripts';
import 'thaff-embed-scripts/dist/thaff-embed-scripts.css'
// generate a loader instance to get the libraries you need
const loader = new Loader({
key: '{your-key}',
})
// load the Auth library
const ThaffAuth = await loader.importAuth();
// create an instance of the auth class
const auth = new ThaffAuth('#thaff-auth');
auth.renderLogin();
auth.onLogin((token) => {
alert('Succesfully logged in ' + token);
auth.renderLogout();
})