npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@happy-horizon/f19-sdk-js

v2.4.1

Published

Javascript SDK for F19 digital reporting platform

Downloads

9

Readme

F19 SDK JS

Language Language

Javascript SDK for the F19 digital reporting platform.

Getting Started

How to install

Installing

A step by step series of examples that tell you how to get a development env running

npm install @happy-horizon/f19-sdk-js

⚠️ This SDK uses the Fetch API under the hood. If your environment doesn't support it, you need to install a polyfill like isomorphic-fetch or node-fetch

Usage

Import the package using ES6 imports or CommonJS require

import F19 from "@happy-horizon/f19-sdk-js";
const F19 = require("@happy-horizon/f19-sdk-js");

Create a new instance of the F19 class with your API key, Client Id, and base URL

const client = new F19({
    apiKey: "[F19_API_KEY]",
    clientId: "[F19_CLIENT_ID]",
    baseUrl: "[F19_BASE_URL]"
});

Now you can access all anonymous methods using the client object.

If you want to access the personal methods, you need to log in first. You can do this by redirecting the user to the F19 login page and then redirecting them back after logging in using a callback URL.

// Define the callback URL (you would replace this with your actual callback URL)
const loginUrl = client.getAuthUrl("https://your.callback.url");

After the user has logged in, they will be redirected back to your callback URL with impersonation options in the request body. You can use these impersonation options to create a new instance of the client that can access the personal methods.

const client = new F19(
    {
        apiKey: "[F19_API_KEY]",
        clientId: "[F19_CLIENT_ID]",
        baseUrl: "[F19_BASE_URL]"
    },
    {
        userId: body.UserId,
        keyThumbprint: body.KeyThumbprint,
        cacheDifferentiator: body.CacheDifferentiator,
        authorizationToken: body.AuthorizationToken
    }
);

Available methods

| Grouping | Method Name | Parameters | | ---------------- | ----------------- | --------------------------------------- | | articles | getAllByProjectId | projectId: string | | | getById | articleId: string | | assets | getImageByName | projectId: string, name: string | | | getDownloadByName | projectId: string, name: string | | | getBlobByToken | token: string | | channel | getAll | | | charts | getAll | projectId: string | | | getById | chartId: string | | downloads | getById | id: string | | | getAllByProjectId | projectId: string | | facetNavigations | getAll | projectId: string | | | getById | facetId: string | | images | getAll | projectId: string | | | getById | imageId: string | | nonce | getNonce | | | projects | getAll | | | | getById | id: string | | reports | getById | id: string | | | getAllByProjectId | id: string | | tables | getAll | projectId: string | | | getById | tableId: string | | tokens | tokenRequest | url: string, authorizationToken: string | | | getPersonal | authorizationToken: string | | | getAnonymous | authorizationToken: string | | websites | getAll | | | | getByAlias | alias: string | | | getCurrent | |

Example usage

// Define the projectId (you would replace this with your actual project ID)
const projectId = "your_project_id_here";

// Call the getAllByProjectId method
client.article
    .getAllByProjectId(projectId)
    .then(result => {
        // Handle the result here
        console.log("Result:", result);
    })
    .catch(error => {
        // Handle any errors that occur
        console.error("Error:", error);
    });