
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
npm
.CDN Hosted
You can always pull the latest version of the FAM Javascript SDK from our CDN at:
https://cdn.freeallmedia.com/sdk/js/0/latest/fam.js
HTML
<!-- Include this at the bottom of your 'body' tag -->
<script src="https://cdn.freeallmedia.com/sdk/js/0/latest/fam.js"></script>
<script type="text/javascript">
(function (window) {
const fam = new Fam();
})(window);
</script>
NPM
You can install the FAM Javascript SDK from npm
:
$ npm install fam-sdk --save
You can import FAM directly as a module via the import
keyword:
import Fam from "fam-sdk";
const fam = new Fam()
There is a /dist/
directory for those that prefer directly including a local copy into their HTML documents:
$ npm install fam-sdk
$ ls ./node_modules/fam-sdk/dist/fam.js
A complete example is available in the /dist/examples
directory and on our CDN:
fam.window(url)
window
object.const famWindow = fam.window("https://cdn.freeallmedia.com/campaigns/my-campaign/index.html");
setTimeout(() => {
famWindow.close();
}, 5000);
fam.iframe(domID, url)
const iFrameElement = fam.iframe("https://cdn.freeallmedia.com/campaigns/my-campaign/index.html");
fam.on(eventName, eventHandler)
fam.on("start", function () {
console.log("FAM experience started.");
});
fam.on("end", function () {
console.log("FAM experience ended.");
});
fam.on("close", function (activity) {
console.log(`FAM experience closed by user while on activity named "${activity.name}"`);
});
fam.on("activity:start", function (activity) {
console.log(`Activity named "${activity.name}" of type "${activity.type}" started.`);
});
fam.on("activity:end", function (activity, results) {
console.log(`Activity named "${activity.name}" of type "${activity.type}" ended with the following results:`, results);
});
fam.on("image:impression", function (activity, creative) {
console.log(`Image "${creative.name}" shown in activity "${activity.name}"`);
});
fam.on("image:clickthrough", function (activity, creative, url) {
console.log(`Image "${creative.name}" clicked through to url "${url}" in activity "${activity.name}"`);
});
fam.on("video:play", function (activity) {
console.log(`Video for activity "${activity.name}" playing.`);
});
fam.on("video:pause", function (activity) {
console.log(`Video for activity "${activity.name}" paused.`);
});
fam.on("video:end", function (activity) {
console.log(`Video for activity "${activity.name}" ended.`);
});
fam.on("video:mute", function (activity) {
console.log(`Video for activity "${activity.name}" muted.`);
});
fam.on("video:unmute", function (activity) {
console.log(`Video for activity "${activity.name}" un-muted.`);
});
FAQs
A javascript library to integrate FAM into web apps.
We found that fam-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.