@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
- API Reference
- Ad API
- activateAd(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- deactivateAd(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- createAd(params: ICreateAdParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- deleteAd(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getAdsClientView(position: AdPosition, config?: AxiosRequestConfig) => Promise<HttpResponse<IAd[]>>
- getAds(params?: IGetAdsParams, config?: AxiosRequestConfig) => Promise<HttpResponseList<IAd>>
- getAd(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAd>>
- updateAd(params: IUpdateAdParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- App Integration API
- getAppIntegrations(params?: IGetAppIntegrationsParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegration[]>>
- AppIntegrationAnalyticsAPI
- createAppIntegrationAnalytics(params: ICreateAppIntegrationAnalyticsParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAnalytics>>
- deleteAppIntegrationAnalytics(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getAppIntegrationAnalytics(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAnalytics>>
- getAppIntegrationAnalyticsWithBrand(config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAnalytics[]>>
- updateAppIntegrationAnalytics(params: IUpdateAppIntegrationAnalyticsParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAnalytics>>
- AppIntegrationAuthenticationAPI
- createAppIntegrationAuthentication(params: ICreateAppIntegrationAuthenticationParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAuthentication>>
- createAppIntegrationAuthenticationWithImportFileSettings(params: ICreateAppIntegrationAuthenticationWithImportFileSettingsParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAuthentication>>
- deleteAppIntegrationAuthentication(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getAppIntegrationAuthentication(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAuthentication>>
- getAppsIntegrationAuthenticationWithBrand(params?: IGetAppIntegrationAuthenticationsWithBrandParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAuthentication[]>>
- testBuildingAuthenticationURL(appIntegrationId: IdType, params: ITestBuildingAuthenticationURLParams, config?: AxiosRequestConfig) => Promise<HttpResponse<string>>
- updateAppIntegrationAuthentication(id: IdType, params: IUpdateAppIntegrationAuthenticationParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAuthentication>>
- AppIntegrationPaymentGatewayAPI
- createAppIntegrationPaymentGateway(params: ICreateAppIntegrationPaymentGatewayParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationPaymentGateway>>
- deleteAppIntegrationPaymentGateway(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getAppIntegrationPaymentGateway(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationPaymentGateway>>
- getAppsIntegrationPaymentGatewayWithBrand(config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationPaymentGateway[]>>
- testCreatingCheckoutLink(appIntegrationId: IdType, params: ITestCreatingCheckoutLinkParams, config?: AxiosRequestConfig) => Promise<HttpResponse<string>>
- updateAppIntegrationPaymentGateway(id: IdType, params: IUpdateAppIntegrationPaymentGatewayParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationPaymentGateway>>
- AppIntegrationPushNotificationAPI
- createAppIntegrationPushNotification(params: ICreateAppIntegrationPushNotificationParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationPushNotification>>
- createAppIntegrationPushNotificationWithImportFileSettings(params: ICreateAppIntegrationPushNotificationWithImportFileSettingsParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationPushNotification>>
- deleteAppIntegrationPushNotification(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getAppIntegrationPushNotification(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationPushNotification>>
- getAppIntegrationPushNotificationsWithBrand(config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationPushNotification[]>>
- updateAppIntegrationPushNotification(id: IdType, params: IUpdateAppIntegrationPushNotificationParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationPushNotification>>
- AppIntegrationReCAPTCHAAPI
- createAppIntegrationReCAPTCHA(params: ICreateAppIntegrationReCAPTCHAParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationReCAPTCHA>>
- deleteAppIntegrationReCAPTCHA(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getAppIntegrationReCAPTCHA(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationReCAPTCHA>>
- getAppsIntegrationReCAPTCHAWithBrand(config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationReCAPTCHA[]>>
- updateAppIntegrationReCAPTCHA(params: IUpdateAppIntegrationReCAPTCHAParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationReCAPTCHA>>
- AppIntegrationSMSAPI
- createAppIntegrationSMS(params: ICreateAppIntegrationSMSParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationSMS>>
- deleteAppIntegrationSMS(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getAppIntegrationSMS(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationSMS>>
- getAppsIntegrationSMSWithBrand(config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationSMS[]>>
- testSendingSMSMessage(appIntegrationId: IdType, params: ITestSendingSMSMessageParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- updateAppIntegrationSMS(id: IdType, params: IUpdateAppIntegrationSMSParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationSMS>>
- AppIntegrationSMTPAPI
- createAppIntegrationSMTP(params: ICreateAppIntegrationSMTPParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationSMTP>>
- deleteAppIntegrationSMTP(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getAppIntegrationSMTP(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationSMTP>>
- getAppsIntegrationSMTPWithBrand(config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationSMTP[]>>
- testSendingEmailAddress(params: ITestSendingEmailAddressParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- updateAppIntegrationSMTP(id: IdType, params: IUpdateAppIntegrationSMTPParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationSMTP>>
- Brand API
- BrandProfileAPI
- BrandSettingAPI
- EmailAddressAPI
- createEmailAddress(params: ICreateEmailAddressParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IEmailAddress>>
- deleteEmailAddress(params: IDeleteEmailAddressParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getEmailAddress(params: IGetEmailAddressParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IEmailAddress>>
- getEmailAddresses(brandId: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IEmailAddress[]>>
- updateEmailAddress(emailAddressId: IdType, params: IUpdateEmailAddressParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IEmailAddress>>
- BrandAPI
- checkDomainIfExists(domain: string, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- createBrand(params: ICreateBrandParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IBrand>>
- generateNewDomain(config?: AxiosRequestConfig) => Promise<HttpResponse<IGeneratedDomain>>
- getBrand(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IBrand>>
- getBrandByURL(config?: AxiosRequestConfig) => Promise<HttpResponse<IBrand>>
- getBrands(params?: IGetBrandsParams, config?: AxiosRequestConfig) => Promise<HttpResponseList<IBrand>>
- updateBrand(id: IdType, params: IUpdateBrandParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- CDN API
- deleteFileCDN(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getFileCDN(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IFileCDN>>
- getFilesCDN(params?: IGetFilesCDNParams, config?: AxiosRequestConfig) => Promise<HttpResponseList<IFileCDN>>
- uploadFileCDN(params: IUploadFileParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IUploadedFileCDN>>
- uploadFile(params: IUploadFileParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IUploadedFileCDN>>
- City API
- Commission Rate API
- createCommissionRate(params?: ICreateCommissionRateParams, config?: AxiosRequestConfig) => Promise<HttpResponse<ICommissionRate>>
- deleteCommissionRate(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getCommissionRate(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<ICommissionRate>>
- getDiscountValue(quantity: number, config?: AxiosRequestConfig) => Promise<HttpResponse<number>>
- getCommissionRates(params?: IGetCommissionRatesParams, config?: AxiosRequestConfig) => Promise<HttpResponse<ICommissionRate[]>>
- updateCommissionRate(id: IdType, params?: IUpdateCommissionRateParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- Configuration API
- createConfiguration(params: ICreateConfigurationParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IConfiguration>>
- deleteConfiguration(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getConfigurations(params?: IGetConfigurationsParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IConfiguration[]>>
- getConfiguration(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IConfiguration>>
- updateConfiguration(id: IdType, params: IUpdateConfigurationParams, config?: AxiosRequestConfig) => Promise<HttpResponse<unknown>>
- Constant API
- getBrandLinkTypes(config?: AxiosRequestConfig) => Promise<HttpResponse<string[]>>
- getBlackListTypes(config?: AxiosRequestConfig) => Promise<HttpResponse<string[]>>
- getCouponStatuses(config?: AxiosRequestConfig) => Promise<HttpResponse<string[]>>
- getCommissionRateTypes(config?: AxiosRequestConfig) => Promise<HttpResponse<string[]>>
- getDeviceStatuses(config?: AxiosRequestConfig) => Promise<HttpResponse<string[]>>
- getDeviceTypes(config?: AxiosRequestConfig) => Promise<HttpResponse<string[]>>
- getInvoiceStatuses(config?: AxiosRequestConfig) => Promise<HttpResponse<string[]>>
- getInvoiceTypes(config?: AxiosRequestConfig) => Promise<HttpResponse<string[]>>
- getIssuePriorities(config?: AxiosRequestConfig) => Promise<HttpResponse<string[]>>
- getLicenseSources(config?: AxiosRequestConfig) => Promise<HttpResponse<string[]>>
- getLicenseTypes(config?: AxiosRequestConfig) => Promise<HttpResponse<string[]>>
- getLicenseStatuses(config?: AxiosRequestConfig) => Promise<HttpResponse<string[]>>
- Country API
- Coupon API
- createCoupon(params: ICreateCouponParams, config?: AxiosRequestConfig) => Promise<HttpResponse<ICoupon>>
- deleteCoupon(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getCoupon(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<ICoupon>>
- getCoupons(params?: IGetCouponsParams, config?: AxiosRequestConfig) => Promise<HttpResponse<ICoupon[]>>
- updateCoupon(id: IdType, params: IUpdateCouponParams, config?: AxiosRequestConfig) => Promise<HttpResponse<ICoupon>>
- State API
- Subscription Type API
- createSubscriptionType(params: ICreateSubscriptionTypeParams, config?: AxiosRequestConfig) => Promise<HttpResponse<ISubscriptionType>>
- deleteSubscriptionType(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getSubscriptionType(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<ISubscriptionType>>
- getPricesFromSubscriptionType(subscriptionTypeId: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IPrice[]>>
- getSubscriptionTypes(params?: IGetSubscriptionTypesParams, config?: AxiosRequestConfig) => Promise<HttpResponse<ISubscriptionType[]>>
- updateSubscriptionType(id: IdType, params: IUpdateSubscriptionTypeParams, config?: AxiosRequestConfig) => Promise<HttpResponse<ISubscriptionType>>
- Timezone API
- Tracking Activity API
- Tracking Email API
- User API
- activateUser(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- addDeviceToUser(params: IAddDeviceToUserParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- applyReferralCodeToUser(id: IdType, params: IApplyReferralCodeParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- assignRolesToUser(id: IdType, roleIds: IdType[], config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- authenticationByApple(callbackURL: string, config?: AxiosRequestConfig) => Promise<HttpResponse<string>>
- authenticationByGoogle(params: IAuthenticationByGoogleParams, config?: AxiosRequestConfig) => Promise<HttpResponse<string>>
- authenticationByPhoneNumber(params: IAuthenticationByPhoneNumberParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAuthenticateResponse>>
- authentication(params: IAuthenticationParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAuthenticateResponse>>
- changePassword(params: IChangePasswordParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- changePasswordForAnotherUser(params: IChangePasswordForAnotherUserParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- checkReferralUserCode(code: string, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- checkAuthKeyAvailable(params: ICheckAuthKeyAvailableParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- deactivateUser(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- deleteUser(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- sendEmailToVerifyEmailAddressOfUser(id: IdType, returnURL: string, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- activeUserEmailAddress(token: string, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- forgotPassword(params: IForgotPasswordParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getUserByUsername(username: string, config?: AxiosRequestConfig) => Promise<HttpResponse<IUser>>
- getUser(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IUser>>
- getAppIntegrationAuthenticateURLs(params: IGetAppIntegrationAuthenticateURLsParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAuthenticateURL[]>>
- getDevicesFromUser(userId: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IDeviceOfUser[]>>
- getUsersByListIDs(ids: IdType[], config?: AxiosRequestConfig) => Promise<HttpResponse<IUser[]>>
- getUsers(params: IGetUsersParams, config?: AxiosRequestConfig) => Promise<HttpResponseList<IUser>>
- getRolesAssignedToUser(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IRole[]>>
- getCurrentUserLoggedIn(config?: AxiosRequestConfig) => Promise<HttpResponse<IUser>>
- getRefereeOfUser(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IUserBase[]>>
- listAllBrandPartnersAuthenticate(userId: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IBrandPartnerAuthenticate>>
- lockUser(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- registerNewUser(params: IRegisterNewUserParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IUser>>
- removeDeviceFromUser(params: IRemoveDeviceFromUserParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- resetPassword(params: IResetPasswordParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- revokeRolesFromUser(id: IdType, roleIds: IdType[], config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- statisticUsers(params: IStatisticsUsersParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IStatisticsUsers[]>>
- suspendUser(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- unlockUser(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- unsuspendUser(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- updateUser(id: IdType, params: IUpdateUserParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IUser>>
- updateUserType(id: IdType, type: UserType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- Configurations
- createNewConfigurationForUser(userId: IdType, params: ICreateConfigurationOfUserParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IConfiguration>>
- getConfigurationsOfUser(userId: IdType, params?: IGetConfigurationOfUserParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IConfiguration[]>>
- deleteConfigurationOfUserByID(userId: IdType, configurationId: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- Email Address Verification
- Notification
- getNotificationRelatedToUser(params: IGetNotificationRelatedToUserParams, config?: AxiosRequestConfig) => Promise<HttpResponse<INotificationUser>>
- getNotificationsByUser(params: IGetNotificationsByUserParams, config?: AxiosRequestConfig) => Promise<HttpResponseList<INotificationUser, { unreadCount: number }>>
- markNotificationAsRead(params: IMarkNotificationAsReadParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- markAllNotificationsAsRead(userId: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- Passwordless
- Email
- authenticationByMagicLink(params: IAuthenticationByMagicLinkParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- generateEmailOTPForAuthentication(params: IGenerateEmailAddressOTPForAuthenticationParams, config?: AxiosRequestConfig) => Promise<HttpResponse<string>>
- verifyEmailAddressOTPToAuthentication(params: IVerifyOTPCodeParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAuthenticateResponse>>
- Phone
- QR Code
- generateNewQRCode(params?: IGenerateNewQRCodeParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IGenerateNewQRCodeForParingAuthenticationResponse>>
- getCurrentStatusOfQRCode(qrCodeId: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IGetCodeStatusResponse>>
- approveQRCode(qrCodeId: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IGetCodeStatusResponse>>
- loginUsingApprovedQRCode(qrCodeId: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAuthenticateResponse>>
- authWithApprovedQRCode(qrCodeId: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAuthenticateResponse>>
- OTP Code
- generateNewOTPCode(params?: IGenerateNewQRCodeParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IGenerateNewOTPForParingAuthenticationResponse>>
- getCurrentStatusOfOTPCode(otpCode: string, config?: AxiosRequestConfig) => Promise<HttpResponse<IGetCodeStatusResponse>>
- approveOTPCode(otpCode: string, config?: AxiosRequestConfig) => Promise<HttpResponse<IGetCodeStatusResponse>>
- loginUsingApprovedOTPCode(otpCode: string, config?: AxiosRequestConfig) => Promise<HttpResponse<IAuthenticateResponse>>
- authWithApprovedOTPCode(otpCode: string, config?: AxiosRequestConfig) => Promise<HttpResponse<IAuthenticateResponse>>
- Email
- Wallet API
- addMoneyToWalletWithCheckoutLink(params: IAddMoneyToWalletWithCheckoutLinkParams, config?: AxiosRequestConfig) => Promise<HttpResponse<string>>
- applyRedeemCode(params: IApplyRedeemCodeParams, config?: AxiosRequestConfig) => Promise<HttpResponse<unknown>>
- createWalletDefault(currencyCode: string, testMode: boolean = false, config?: AxiosRequestConfig) => Promise<HttpResponse<IWallet>>
- convertWalletMoney(params: IConvertWalletMoneyParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- closeWallet(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
- getWallets(params?: IGetWalletsParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IWallet[]>>
- getWalletHistory(id: IdType, params: IGetWalletHistoriesParams, config?: AxiosRequestConfig) => Promise<HttpResponseList<IWalletHistory>>
- Ad API
Getting Started
Setup Your Brand
To get started with JFramework, you need to set up your brand in the JFW dashboard:
- Visit my.jframework.io.
- Register for a new account if you don't have one, or log in with your existing credentials.
- Once logged in, navigate to the "Brands" section.
- Click on "Create New Brand" and fill in the required details, such as brand name, description, and any associated domains or configurations.
- 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-jsOr with Yarn:
yarn add @jframework/jfw-jsConfiguration
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:
idIdType
The ID of the ad to activate.configAxiosRequestConfig
Optional Axios request configuration.
See: Activate an Ad
deactivateAd(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
Deactivates an ad.
Parameters:
idIdType
The ID of the ad to deactivate.configAxiosRequestConfig
Optional Axios request configuration.
See: Deactivate an Ad
createAd(params: ICreateAdParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
Creates an ad.
Parameters:
paramsICreateAdParams
The parameters for creating an ad.configAxiosRequestConfig
Optional Axios request configuration.
ICreateAdParams Fields:
typeAdType
The type of the advertisement.titlestring - min: 1
The title of the advertisement.positionAdPosition - min: 1
The display position of the advertisement (e.g., homepage-top, sidebar).targetURLstring
The target URL that the ad points to when clicked. uri - min: 1descriptionstring
The description of the advertisement.tagsstring
The tags of the advertisement.startDateDateType
The start date and time when the advertisement becomes active. Format: yyyy-MM-dd HH:mm:ss date-timeendDateDateType
The end date and time when the advertisement expires. Format: yyyy-MM-dd HH:mm:ss date-timemetadatastring
The metadata of the advertisement.languageCodesstring[]
The list of supported language codes (ISO 639-1, e.g., "en", "vi"). If null, available for all languages.countryCodesstring[]
The list of supported country codes (ISO 3166-1 alpha-2, e.g., "US", "VN"). If null, available in all countries.statusAdStatus
The status of the advertisement.imageURLsstring[]
The list of image URLs. Allowed formats: JPG, PNG, GIF. Maximum: 5.brandDomainIdsIdType[]
The list of brand domains for the advertisement.
See: Create an Ad
deleteAd(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
Deletes an ad.
Parameters:
idIdType
The ID of the ad to delete.configAxiosRequestConfig
Optional Axios request configuration.
See: Delete an Ad
getAdsClientView(position: AdPosition, config?: AxiosRequestConfig) => Promise<HttpResponse<IAd[]>>
Gets ads with the client view.
Parameters:
positionAdPosition
The position for getting ads.configAxiosRequestConfig
Optional Axios request configuration.
See: Get Ads Client View
getAds(params?: IGetAdsParams, config?: AxiosRequestConfig) => Promise<HttpResponseList<IAd>>
Gets ads.
Parameters:
paramsIGetAdsParams
The parameters for getting ads.configAxiosRequestConfig
Optional Axios request configuration.
IGetAdsParams Fields:
typeAdType
The type to filter.titlestring
The title to filter.positionAdPosition
The position to filter.targetURLstring
The target URL to filter.descriptionstring
The description to filter.statusAdStatus
The status to filter.keywordsstring
The keywords to filter.
See: Get Ads
getAd(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAd>>
Gets an ad.
Parameters:
idIdType
The ID of the ad to get.configAxiosRequestConfig
Optional Axios request configuration.
See: Get an Ad
updateAd(params: IUpdateAdParams, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
Updates an ad.
Parameters:
paramsIUpdateAdParams
The parameters for updating an ad.configAxiosRequestConfig
Optional Axios request configuration.
IUpdateAdParams Fields:
idIdType
The ID of the ad to update.typeAdType
The type of the advertisement.titlestring - min: 1
The title of the advertisement.positionAdPosition - min: 1
The display position of the advertisement (e.g., homepage-top, sidebar).targetURLstring
The target URL that the ad points to when clicked. uri - min: 1descriptionstring
The description of the advertisement.tagsstring
The tags of the advertisement.startDateDateType
The start date and time when the advertisement becomes active. Format: yyyy-MM-dd HH:mm:ss date-timeendDateDateType
The end date and time when the advertisement expires. Format: yyyy-MM-dd HH:mm:ss date-timemetadatastring
The metadata of the advertisement.languageCodesstring[]
The list of supported language codes (ISO 639-1, e.g., "en", "vi"). If null, available for all languages.countryCodesstring[]
The list of supported country codes (ISO 3166-1 alpha-2, e.g., "US", "VN"). If null, available in all countries.statusAdStatus
The status of the advertisement.imageURLsstring[]
The list of image URLs. Allowed formats: JPG, PNG, GIF. Maximum: 5.brandDomainIdsIdType[]
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. enumstatus?AppIntegrationStatus
The status of the app integration to filter. enumkeywords?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:
paramsICreateAppIntegrationAnalyticsParams
The parameters for creating analytics.config?AxiosRequestConfig
Optional Axios request configuration.
ICreateAppIntegrationAnalyticsParams Fields:
appIntegrationIdIdType
The app integration provider ID of the analytics. min: 1trackingIdstring - min: 1
This ID is used to track and associate events/data with a specific analytics property or project.apiKeystring - 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.statusAppIntegrationAnalyticsStatus
The status of the app integration. enum
deleteAppIntegrationAnalytics(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<boolean>>
Deletes an app integration analytics record by ID.
Parameters:
idIdType
The ID of the analytics record.config?AxiosRequestConfig
Optional Axios request configuration.
getAppIntegrationAnalytics(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAnalytics>>
Gets an app integration analytics record by ID.
Parameters:
idIdType
The ID of the analytics record.config?AxiosRequestConfig
Optional Axios request configuration.
getAppIntegrationAnalyticsWithBrand(config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAnalytics[]>>
Lists all app integration analytics associated with a brand.
Parameters:
config?AxiosRequestConfig
Optional Axios request configuration.
updateAppIntegrationAnalytics(params: IUpdateAppIntegrationAnalyticsParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAnalytics>>
Updates an app integration analytics record by ID.
Parameters:
paramsIUpdateAppIntegrationAnalyticsParams
The parameters for updating analytics.config?AxiosRequestConfig
Optional Axios request configuration.
IUpdateAppIntegrationAnalyticsParams Fields:
idIdType
The app integration analytics id.appIntegrationIdIdType - min: 1
The app integration provider ID of the analytics.trackingIdstring - min: 1
This ID is used to track and associate events/data with a specific analytics property or project.apiKeystring - 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.statusAppIntegrationAnalyticsStatus
The status of the app integration. enum
AppIntegrationAuthenticationAPI
Manages authentication settings for app integrations.
createAppIntegrationAuthentication(params: ICreateAppIntegrationAuthenticationParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAuthentication>>
Creates a new app integration authentication.
Parameters:
paramsICreateAppIntegrationAuthenticationParams
The parameters for creating authentication.config?AxiosRequestConfig
Optional Axios request configuration.
ICreateAppIntegrationAuthenticationParams Fields:
appIntegrationIdstring - min: 1
The app integration id.codestring - min: 1
The code of the app integration.namestring - min: 1
The name of the app integration.projectIdstring - min: 1
The project Id of the app integration.clientIdstring - 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.clientSecretstring - 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.redirectURIstring - 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.scopestring - 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. enumisDefault?boolean
Flag to indicate if the authentication integration is the default. defaultValuefalse
createAppIntegrationAuthenticationWithImportFileSettings(params: ICreateAppIntegrationAuthenticationWithImportFileSettingsParams, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAuthentication>>
Creates a new app integration authentication with import file settings.
Parameters:
paramsICreateAppIntegrationAuthenticationWithImportFileSettingsParams
The parameters for creating authentication with import file.config?AxiosRequestConfig
Optional Axios request configuration.
ICreateAppIntegrationAuthenticationWithImportFileSettingsParams Fields:
appIntegrationIdIdType
The app integration id.fileFile - 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.
Parameters:
idIdType
The ID of the authentication.config?AxiosRequestConfig
Optional Axios request configuration.
getAppIntegrationAuthentication(id: IdType, config?: AxiosRequestConfig) => Promise<HttpResponse<IAppIntegrationAuthentication>>
Gets an app integration authentication by ID.
Parameters:
idIdType
The ID of the authentication.config?AxiosRequestConfig
Optional Axios request configuration.
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.
