The core Livefyre library used to power Livefyre on your site.
Livefyre.js
is the core library that you can install on every Livefyre-enabled webpage. It defines the global window.Livefyre
object and a single public method, Livefyre.require
, which can be used to load other Livefyre JavaScript libraries that help with Embedding Livefyre Apps, Integrating your authentication provider with Livefyre and more.
Add the following <script>
tag to your webpage or website template. If possible, add it to the <head>
section of your HTML document so it loads quickly.
<script src="//cdn.livefyre.com/Livefyre.js"></script>
This script will embed a very small (~1 Kb) file called the Livefyre.js scout that will subsequently load the latest version of Livefyre.js over the protocol with which your webpage has been accessed (HTTP or HTTPS).
Livefyre.require
is a custom JavaScript module loader like curl.js or RequireJS. It can be used to load most packages published by Livefyre and presents a convenient and intuitive integration path.
Packages accessible through Livefyre.require
are versioned using Semantic Versioning. Packages can be required at a specific version or to a range of versions so your webpage can automatically benefit from new bugfixes features. This gives you flexibility when integrating Livefyre on your site. There are three levels of version pinning you can use with Livefyre.require
.
An example integration using Livefyre.require
could look like this:
<!-- First add Livefyre.js to the page -->
<script src="https://cdn.livefyre.com/Livefyre.js"></script>
<!-- Then load up all the desired Livefyre packages and Do Stuff in the callback -->
<script>
Livefyre.require([
'lfawesome#1',
'lfsuperawesome#2.1.2'
], function (LFAwesome, LFSuperAwesome) {
var greatness = new LFAwesome();
// etc..
});
</script>
Wondering which Livefyre JavaScript packages are available through Livefyre.require
? You can always find an up-to-date list of supported packages and their latest versions here: packages.html.
Sometimes you may want to test an upcoming version of a Livefyre package to make sure it will work on your website or to acceptance test a feature that is being developed at your request. In addition to including a Semantic Version range, the prerelease UAT environment can be specified.
For example, the following would require the UAT release of fyre.conv
, the Comments, Live Blog, and Chat applications.
Livefyre.require(['fyre.conv#uat'], callback);