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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jframework/jfw-js

v6.9.3

Published

The Javascript package for JFW

Readme

JFramework (JFW) - @jframework/jfw-js

About

JFramework (JFW) is a comprehensive backend API client library for JavaScript, part of the JFW ecosystem. It provides a set of APIs to interact with various resources such as brands, users, roles and more, enabling developers to build robust applications with features like authentication, payments, and content management. The @jframework/jfw-js package is designed for client-side and server-side JavaScript environments and integrates seamlessly with Axios for HTTP requests.

Table of Contents

Getting Started

Setup Your Brand

To get started with JFramework, you need to set up your brand in the JFW dashboard:

  1. Visit my.jframework.io.
  2. Register for a new account if you don't have one, or log in with your existing credentials.
  3. Once logged in, navigate to the "Brands" section.
  4. Click on "Create New Brand" and fill in the required details, such as brand name, description, and any associated domains or configurations.
  5. Save your brand. You'll receive a brand ID and API keys (e.g., secret key) that you'll use to authenticate requests in your application.

This setup ensures your API calls are associated with your brand for proper authorization and resource management.

Quick Start

Installation

Install the @jframework/jfw-js package using your preferred package manager:

npm install @jframework/jfw-js

Or with Yarn:

yarn add @jframework/jfw-js

Configuration

To initialize the backend API client, create an instance using your Axios instance configured with your JFW API base URL and authentication headers (e.g., using your secret key from the brand setup).

Example in Node.js:

import { createJFWClient } from '@jframework/jfw-js';

export const jfwClient = createJFWClient({
    brandURL: 'https://api.jframework.io', // Replace with your brandURL you created in Setup Your Brand.
    protocolURL: 'https://protocol.jframework.io/api', // Replace with your protocolURL if you have custom protocol URL of JFW.
});

// Now you can use the client, e.g., to get your current brand info.
const currentBrand = await jfwClient.brand.getBrandByURL();

Make sure to handle errors appropriately, such as using try/catch for API calls, as they may throw errors on failure.

For framework-specific setups (e.g., Next.js, Express), refer to the detailed usage examples in the API Reference.

API Reference

The createBackendApiClient function returns an object with resource-specific API clients. Each client extends AbstractAPI and provides methods for CRUD operations and other resource-specific actions.

Below is a listing of all available API objects and their methods. Detailed documentation for each method includes parameters, return types (where applicable), and links to the full endpoint reference.

Ad API

The ad object manages advertisements.

activateAd(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>

Activates an ad.

  • Parameters:

    • id IdType
      The ID of the ad to activate.
    • config AxiosRequestConfig
      Optional Axios request configuration.
  • See: Activate an Ad

deactivateAd(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>

Deactivates an ad.

  • Parameters:

    • id IdType
      The ID of the ad to deactivate.
    • config AxiosRequestConfig
      Optional Axios request configuration.
  • See: Deactivate an Ad

createAd(params: ICreateAdParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>

Creates an ad.

  • Parameters:

    • params ICreateAdParams
      The parameters for creating an ad.
    • config AxiosRequestConfig
      Optional Axios request configuration.
  • ICreateAdParams Fields:

    • type AdType
      The type of the advertisement.
    • title string - min: 1
      The title of the advertisement.
    • position AdPosition - min: 1
      The display position of the advertisement (e.g., homepage-top, sidebar).
    • targetURL string
      The target URL that the ad points to when clicked. uri - min: 1
    • description string
      The description of the advertisement.
    • tags string
      The tags of the advertisement.
    • startDate DateType
      The start date and time when the advertisement becomes active. Format: yyyy-MM-dd HH:mm:ss date-time
    • endDate DateType
      The end date and time when the advertisement expires. Format: yyyy-MM-dd HH:mm:ss date-time
    • metadata string
      The metadata of the advertisement.
    • languageCodes string[]
      The list of supported language codes (ISO 639-1, e.g., "en", "vi"). If null, available for all languages.
    • countryCodes string[]
      The list of supported country codes (ISO 3166-1 alpha-2, e.g., "US", "VN"). If null, available in all countries.
    • status AdStatus
      The status of the advertisement.
    • imageURLs string[]
      The list of image URLs. Allowed formats: JPG, PNG, GIF. Maximum: 5.
    • brandDomainIds IdType[]
      The list of brand domains for the advertisement.
  • See: Create an Ad

deleteAd(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>

Deletes an ad.

  • Parameters:

    • id IdType
      The ID of the ad to delete.
    • config AxiosRequestConfig
      Optional Axios request configuration.
  • See: Delete an Ad

getAdsClientView(position: AdPosition, config?: AxiosRequestConfig) => Promise<HttpResponse<IAd[]>>

Gets ads with the client view.

  • Parameters:

    • position AdPosition
      The position for getting ads.
    • config AxiosRequestConfig
      Optional Axios request configuration.
  • See: Get Ads Client View

getAds(params?: IGetAdsParams, config?: AxiosRequestConfig) => Promise<HttpResponseList<IAd>>

Gets ads.

  • Parameters:

    • params IGetAdsParams
      The parameters for getting ads.
    • config AxiosRequestConfig
      Optional Axios request configuration.
  • IGetAdsParams Fields:

    • type AdType
      The type to filter.
    • title string
      The title to filter.
    • position AdPosition
      The position to filter.
    • targetURL string
      The target URL to filter.
    • description string
      The description to filter.
    • status AdStatus
      The status to filter.
    • keywords string
      The keywords to filter.
  • See: Get Ads

getAd(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAd>>

Gets an ad.

  • Parameters:

    • id IdType
      The ID of the ad to get.
    • config AxiosRequestConfig
      Optional Axios request configuration.
  • See: Get an Ad

updateAd(params: IUpdateAdParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>

Updates an ad.

  • Parameters:

    • params IUpdateAdParams
      The parameters for updating an ad.
    • config AxiosRequestConfig
      Optional Axios request configuration.
  • IUpdateAdParams Fields:

    • id IdType
      The ID of the ad to update.
    • type AdType
      The type of the advertisement.
    • title string - min: 1
      The title of the advertisement.
    • position AdPosition - min: 1
      The display position of the advertisement (e.g., homepage-top, sidebar).
    • targetURL string
      The target URL that the ad points to when clicked. uri - min: 1
    • description string
      The description of the advertisement.
    • tags string
      The tags of the advertisement.
    • startDate DateType
      The start date and time when the advertisement becomes active. Format: yyyy-MM-dd HH:mm:ss date-time
    • endDate DateType
      The end date and time when the advertisement expires. Format: yyyy-MM-dd HH:mm:ss date-time
    • metadata string
      The metadata of the advertisement.
    • languageCodes string[]
      The list of supported language codes (ISO 639-1, e.g., "en", "vi"). If null, available for all languages.
    • countryCodes string[]
      The list of supported country codes (ISO 3166-1 alpha-2, e.g., "US", "VN"). If null, available in all countries.
    • status AdStatus
      The status of the advertisement.
    • imageURLs string[]
      The list of image URLs. Allowed formats: JPG, PNG, GIF. Maximum: 5.
    • brandDomainIds IdType[]
      The list of brand domains for the advertisement.
  • See: Update an Ad

App Integration API

The appIntegration object manages various app integrations.

getAppIntegrations(params?: IGetAppIntegrationsParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegration[]>>

Lists all app integrations by type.

  • Parameters:

    • params? IGetAppIntegrationsParams
      The parameters for getting app integrations.
    • config? AxiosRequestConfig
      Optional Axios request configuration.
  • IGetAppIntegrationsParams Fields:

    • type? AppIntegrationType
      The type of the app integration to get. enum
    • status? AppIntegrationStatus
      The status of the app integration to filter. enum
    • keywords? string
      The keywords of the app integration to get.
  • See: Get App Integrations

AppIntegrationAnalyticsAPI

Handles analytics-related operations for app integrations.

createAppIntegrationAnalytics(params: ICreateAppIntegrationAnalyticsParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAnalytics>>

Creates a new app integration analytics record.

  • Parameters:

    • params ICreateAppIntegrationAnalyticsParams
      The parameters for creating analytics.
    • config? AxiosRequestConfig
      Optional Axios request configuration.
  • ICreateAppIntegrationAnalyticsParams Fields:

    • appIntegrationId IdType
      The app integration provider ID of the analytics. min: 1
    • trackingId string - min: 1
      This ID is used to track and associate events/data with a specific analytics property or project.
    • apiKey string - min: 1
      This is usually embedded in the frontend to initialize and send data to the analytics platform.
    • apiSecret? string
      Gets or sets the API secret or verification URL used to authorize or validate requests from the Jframework.
    • metadata? string
      This can include environment-specific data, custom flags, or platform-specific information.
    • accountConfigNotes? string
      Gets or sets any additional notes or identifiers related to the account or setup that manages this Analytics configuration.
    • isDefault? boolean
      Flag to indicate if the analytics integration is the default.
    • status AppIntegrationAnalyticsStatus
      The status of the app integration. enum
  • See: Creates an App Integration Analytics

deleteAppIntegrationAnalytics(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>

Deletes an app integration analytics record by ID.

getAppIntegrationAnalytics(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAnalytics>>

Gets an app integration analytics record by ID.

getAppIntegrationAnalyticsWithBrand(config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAnalytics[]>>

Lists all app integration analytics associated with a brand.

updateAppIntegrationAnalytics(params: IUpdateAppIntegrationAnalyticsParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAnalytics>>

Updates an app integration analytics record by ID.

  • Parameters:

    • params IUpdateAppIntegrationAnalyticsParams
      The parameters for updating analytics.
    • config? AxiosRequestConfig
      Optional Axios request configuration.
  • IUpdateAppIntegrationAnalyticsParams Fields:

    • id IdType
      The app integration analytics id.
    • appIntegrationId IdType - min: 1
      The app integration provider ID of the analytics.
    • trackingId string - min: 1
      This ID is used to track and associate events/data with a specific analytics property or project.
    • apiKey string - min: 1
      This is usually embedded in the frontend to initialize and send data to the analytics platform.
    • apiSecret? string
      Gets or sets the API secret or verification URL used to authorize or validate requests from the Jframework.
    • metadata? string
      This can include environment-specific data, custom flags, or platform-specific information.
    • accountConfigNotes? string
      Gets or sets any additional notes or identifiers related to the account or setup that manages this Analytics configuration.
    • isDefault? boolean
      Flag to indicate if the analytics integration is the default.
    • status AppIntegrationAnalyticsStatus
      The status of the app integration. enum
  • See: Updates an App Integration Analytics

AppIntegrationAuthenticationAPI

Manages authentication settings for app integrations.

createAppIntegrationAuthentication(params: ICreateAppIntegrationAuthenticationParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAuthentication>>

Creates a new app integration authentication.

  • Parameters:

    • params ICreateAppIntegrationAuthenticationParams
      The parameters for creating authentication.
    • config? AxiosRequestConfig
      Optional Axios request configuration.
  • ICreateAppIntegrationAuthenticationParams Fields:

    • appIntegrationId string - min: 1
      The app integration id.
    • code string - min: 1
      The code of the app integration.
    • name string - min: 1
      The name of the app integration.
    • projectId string - min: 1
      The project Id of the app integration.
    • clientId string - min: 1
      The client email of the app integration. This value is used for OAuth2 methods. For example, for Google OAuth2, this value is the email of the service account.
    • clientSecret string - min: 1
      The client secret of the app integration. This value is used for OAuth2 methods. For example, for Google OAuth2, this value is the private key of the service account.
    • redirectURI string - uri - min: 1
      The redirect URI of the app integration. After the user logs in, the user is redirected to this URI. This value is must be mapping with the application configuration on the OAuth2 provider.
    • scope string - min: 1
      The scope of the app integration.
    • authEndpoint? string - uri
      The authentication endpoint of the app integration.
    • tokenEndpoint? string - uri
      The token endpoint of the app integration.
    • iconURL? string - uri
      The icon URL of the app integration.
    • tags? string
      The tags of the app integration.
    • description? string
      The description of the app integration.
    • status? AppIntegrationAuthenticationStatus
      The status of the app integration. enum
    • isDefault? boolean
      Flag to indicate if the authentication integration is the default. defaultValue false
  • See: Creates an App Integration Authentication

createAppIntegrationAuthenticationWithImportFileSettings(params: ICreateAppIntegrationAuthenticationWithImportFileSettingsParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAuthentication>>

Creates a new app integration authentication with import file settings.

  • Parameters:

    • params ICreateAppIntegrationAuthenticationWithImportFileSettingsParams
      The parameters for creating authentication with import file.
    • config? AxiosRequestConfig
      Optional Axios request configuration.
  • ICreateAppIntegrationAuthenticationWithImportFileSettingsParams Fields:

    • appIntegrationId IdType
      The app integration id.
    • file File - min: 1
      The file setting to import.
  • See: Create an App Integration Authentication by Import File

deleteAppIntegrationAuthentication(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>

Deletes an app integration authentication by ID.

getAppIntegrationAuthentication(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAuthentication>>

Gets an app integration authentication by ID.

getAppsIntegrationAuthenticationWithBrand(params?: IGetAppIntegrationAuthenticationsWithBrandParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAuthentication[]>>

Gets app integration authentications for a brand.

  • Parameters:

    • params? IGetAppIntegrationAuthenticationsWithBrandParams
      The parameters for getting authentications.
    • config? AxiosRequestConfig
      Optional Axios request configuration.
  • IGetAppIntegrationAuthenticationsWithBrandParams Fields:

    • appIntegrationId? string
      The app integration id to filter.
    • code? string
      The code to filter.