The Javascript package for JFW
npm install @jframework/jfw-jsJFramework (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.
- Getting Started
- Setup Your Brand
- Quick Start
- API Reference
- Ad API
- activateAd(id: IdType, config?: AxiosRequestConfig) => Promise
- deactivateAd(id: IdType, config?: AxiosRequestConfig) => Promise
- createAd(params: ICreateAdParams, config?: AxiosRequestConfig) => Promise
- deleteAd(id: IdType, config?: AxiosRequestConfig) => Promise
- [getAdsClientView(position: AdPosition, config?: AxiosRequestConfig) => Promise
- getAds(params?: IGetAdsParams, config?: AxiosRequestConfig) => Promise
- getAd(id: IdType, config?: AxiosRequestConfig) => Promise
- updateAd(params: IUpdateAdParams, config?: AxiosRequestConfig) => Promise
- App Integration API
- [getAppIntegrations(params?: IGetAppIntegrationsParams, config?: AxiosRequestConfig) => Promise
- AppIntegrationAnalyticsAPI
- createAppIntegrationAnalytics(params: ICreateAppIntegrationAnalyticsParams, config?: AxiosRequestConfig) => Promise
- deleteAppIntegrationAnalytics(id: IdType, config?: AxiosRequestConfig) => Promise
- getAppIntegrationAnalytics(id: IdType, config?: AxiosRequestConfig) => Promise
- [getAppIntegrationAnalyticsWithBrand(config?: AxiosRequestConfig) => Promise
- updateAppIntegrationAnalytics(params: IUpdateAppIntegrationAnalyticsParams, config?: AxiosRequestConfig) => Promise
- AppIntegrationAuthenticationAPI
- createAppIntegrationAuthentication(params: ICreateAppIntegrationAuthenticationParams, config?: AxiosRequestConfig) => Promise
- createAppIntegrationAuthenticationWithImportFileSettings(params: ICreateAppIntegrationAuthenticationWithImportFileSettingsParams, config?: AxiosRequestConfig) => Promise
- deleteAppIntegrationAuthentication(id: IdType, config?: AxiosRequestConfig) => Promise
- getAppIntegrationAuthentication(id: IdType, config?: AxiosRequestConfig) => Promise
- [getAppsIntegrationAuthenticationWithBrand(params?: IGetAppIntegrationAuthenticationsWithBrandParams, config?: AxiosRequestConfig) => Promise
- testBuildingAuthenticationURL(appIntegrationId: IdType, params: ITestBuildingAuthenticationURLParams, config?: AxiosRequestConfig) => Promise
- updateAppIntegrationAuthentication(id: IdType, params: IUpdateAppIntegrationAuthenticationParams, config?: AxiosRequestConfig) => Promise
- AppIntegrationPaymentGatewayAPI
- createAppIntegrationPaymentGateway(params: ICreateAppIntegrationPaymentGatewayParams, config?: AxiosRequestConfig) => Promise
- deleteAppIntegrationPaymentGateway(id: IdType, config?: AxiosRequestConfig) => Promise
- getAppIntegrationPaymentGateway(id: IdType, config?: AxiosRequestConfig) => Promise
- [getAppsIntegrationPaymentGatewayWithBrand(config?: AxiosRequestConfig) => Promise
- testCreatingCheckoutLink(appIntegrationId: IdType, params: ITestCreatingCheckoutLinkParams, config?: AxiosRequestConfig) => Promise
- updateAppIntegrationPaymentGateway(id: IdType, params: IUpdateAppIntegrationPaymentGatewayParams, config?: AxiosRequestConfig) => Promise
- AppIntegrationPushNotificationAPI
- createAppIntegrationPushNotification(params: ICreateAppIntegrationPushNotificationParams, config?: AxiosRequestConfig) => Promise
- createAppIntegrationPushNotificationWithImportFileSettings(params: ICreateAppIntegrationPushNotificationWithImportFileSettingsParams, config?: AxiosRequestConfig) => Promise
- deleteAppIntegrationPushNotification(id: IdType, config?: AxiosRequestConfig) => Promise
- getAppIntegrationPushNotification(id: IdType, config?: AxiosRequestConfig) => Promise
- [getAppIntegrationPushNotificationsWithBrand(config?: AxiosRequestConfig) => Promise
- updateAppIntegrationPushNotification(id: IdType, params: IUpdateAppIntegrationPushNotificationParams, config?: AxiosRequestConfig) => Promise
- AppIntegrationReCAPTCHAAPI
- createAppIntegrationReCAPTCHA(params: ICreateAppIntegrationReCAPTCHAParams, config?: AxiosRequestConfig) => Promise
- deleteAppIntegrationReCAPTCHA(id: IdType, config?: AxiosRequestConfig) => Promise
- getAppIntegrationReCAPTCHA(id: IdType, config?: AxiosRequestConfig) => Promise
- [getAppsIntegrationReCAPTCHAWithBrand(config?: AxiosRequestConfig) => Promise
- updateAppIntegrationReCAPTCHA(params: IUpdateAppIntegrationReCAPTCHAParams, config?: AxiosRequestConfig) => Promise
- AppIntegrationSMSAPI
- createAppIntegrationSMS(params: ICreateAppIntegrationSMSParams, config?: AxiosRequestConfig) => Promise
- deleteAppIntegrationSMS(id: IdType, config?: AxiosRequestConfig) => Promise
- getAppIntegrationSMS(id: IdType, config?: AxiosRequestConfig) => Promise
- [getAppsIntegrationSMSWithBrand(config?: AxiosRequestConfig) => Promise
- testSendingSMSMessage(appIntegrationId: IdType, params: ITestSendingSMSMessageParams, config?: AxiosRequestConfig) => Promise
- updateAppIntegrationSMS(id: IdType, params: IUpdateAppIntegrationSMSParams, config?: AxiosRequestConfig) => Promise
- AppIntegrationSMTPAPI
- createAppIntegrationSMTP(params: ICreateAppIntegrationSMTPParams, config?: AxiosRequestConfig) => Promise
- deleteAppIntegrationSMTP(id: IdType, config?: AxiosRequestConfig) => Promise
- getAppIntegrationSMTP(id: IdType, config?: AxiosRequestConfig) => Promise
- [getAppsIntegrationSMTPWithBrand(config?: AxiosRequestConfig) => Promise
- testSendingEmailAddress(params: ITestSendingEmailAddressParams, config?: AxiosRequestConfig) => Promise
- updateAppIntegrationSMTP(id: IdType, params: IUpdateAppIntegrationSMTPParams, config?: AxiosRequestConfig) => Promise
- Brand API
- BrandProfileAPI
- updateBrandProfile(id: IdType, params: IUpdateBrandProfileParams, config?: AxiosRequestConfig) => Promise
- BrandSettingAPI
- updateBrandSetting(id: IdType, params: IUpdateBrandSettingParams, config?: AxiosRequestConfig) => Promise
- EmailAddressAPI
- createEmailAddress(params: ICreateEmailAddressParams, config?: AxiosRequestConfig) => Promise
- deleteEmailAddress(params: IDeleteEmailAddressParams, config?: AxiosRequestConfig) => Promise
- getEmailAddress(params: IGetEmailAddressParams, config?: AxiosRequestConfig) => Promise
- [getEmailAddresses(brandId: IdType, config?: AxiosRequestConfig) => Promise
- updateEmailAddress(emailAddressId: IdType, params: IUpdateEmailAddressParams, config?: AxiosRequestConfig) => Promise
- BrandAPI
- checkDomainIfExists(domain: string, config?: AxiosRequestConfig) => Promise
- createBrand(params: ICreateBrandParams, config?: AxiosRequestConfig) => Promise
- generateNewDomain(config?: AxiosRequestConfig) => Promise
- getBrand(id: IdType, config?: AxiosRequestConfig) => Promise
- getBrandByURL(config?: AxiosRequestConfig) => Promise
- getBrands(params?: IGetBrandsParams, config?: AxiosRequestConfig) => Promise
- updateBrand(id: IdType, params: IUpdateBrandParams, config?: AxiosRequestConfig) => Promise
- CDN API
- deleteFileCDN(id: IdType, config?: AxiosRequestConfig) => Promise
- getFileCDN(id: IdType, config?: AxiosRequestConfig) => Promise
- getFilesCDN(params?: IGetFilesCDNParams, config?: AxiosRequestConfig) => Promise
- uploadFileCDN(params: IUploadFileParams, config?: AxiosRequestConfig) => Promise
- uploadFile(params: IUploadFileParams, config?: AxiosRequestConfig) => Promise
- City API
- getCities(params?: IGetCitiesParams, config?: AxiosRequestConfig) => Promise
- Commission Rate API
- createCommissionRate(params?: ICreateCommissionRateParams, config?: AxiosRequestConfig) => Promise
- deleteCommissionRate(id: IdType, config?: AxiosRequestConfig) => Promise
- getCommissionRate(id: IdType, config?: AxiosRequestConfig) => Promise
- getDiscountValue(quantity: number, config?: AxiosRequestConfig) => Promise
- [getCommissionRates(params?: IGetCommissionRatesParams, config?: AxiosRequestConfig) => Promise
- updateCommissionRate(id: IdType, params?: IUpdateCommissionRateParams, config?: AxiosRequestConfig) => Promise
- Configuration API
- createConfiguration(params: ICreateConfigurationParams, config?: AxiosRequestConfig) => Promise
- deleteConfiguration(id: IdType, config?: AxiosRequestConfig) => Promise
- [getConfigurations(params?: IGetConfigurationsParams, config?: AxiosRequestConfig) => Promise
- getConfiguration(id: IdType, config?: AxiosRequestConfig) => Promise
- updateConfiguration(id: IdType, params: IUpdateConfigurationParams, config?: AxiosRequestConfig) => Promise
- Constant API
- [getBrandLinkTypes(config?: AxiosRequestConfig) => Promise
- [getBlackListTypes(config?: AxiosRequestConfig) => Promise
- [getCouponStatuses(config?: AxiosRequestConfig) => Promise
- [getCommissionRateTypes(config?: AxiosRequestConfig) => Promise
- [getDeviceStatuses(config?: AxiosRequestConfig) => Promise
- [getDeviceTypes(config?: AxiosRequestConfig) => Promise
- [getInvoiceStatuses(config?: AxiosRequestConfig) => Promise
- [getInvoiceTypes(config?: AxiosRequestConfig) => Promise
- [getIssuePriorities(config?: AxiosRequestConfig) => Promise
- [getLicenseSources(config?: AxiosRequestConfig) => Promise
- [getLicenseTypes(config?: AxiosRequestConfig) => Promise
- [getLicenseStatuses(config?: AxiosRequestConfig) => Promise
- Country API
- [getCountries(config?: AxiosRequestConfig) => Promise
- Coupon API
- createCoupon(params: ICreateCouponParams, config?: AxiosRequestConfig) => Promise
- deleteCoupon(id: IdType, config?: AxiosRequestConfig) => Promise
- getCoupon(id: IdType, config?: AxiosRequestConfig) => Promise
- [getCoupons(params?: IGetCouponsParams, config?: AxiosRequestConfig) => Promise
- updateCoupon(id: IdType, params: IUpdateCouponParams, config?: AxiosRequestConfig) => Promise
- State API
- [getStates(config?: AxiosRequestConfig) => Promise
- Subscription Type API
- createSubscriptionType(params: ICreateSubscriptionTypeParams, config?: AxiosRequestConfig) => Promise
- deleteSubscriptionType(id: IdType, config?: AxiosRequestConfig) => Promise
- getSubscriptionType(id: IdType, config?: AxiosRequestConfig) => Promise
- [getPricesFromSubscriptionType(subscriptionTypeId: IdType, config?: AxiosRequestConfig) => Promise
- [getSubscriptionTypes(params?: IGetSubscriptionTypesParams, config?: AxiosRequestConfig) => Promise
- updateSubscriptionType(id: IdType, params: IUpdateSubscriptionTypeParams, config?: AxiosRequestConfig) => Promise
- Timezone API
- [getTimezones(config?: AxiosRequestConfig) => Promise
- Tracking Activity API
- getTrackingActivities(params?: IGetTrackingActivitiesParams, config?: AxiosRequestConfig) => Promise
- getTrackingActivity(id: IdType, config?: AxiosRequestConfig) => Promise
- Tracking Email API
- getTrackingEmail(id: IdType, config?: AxiosRequestConfig) => Promise
- getTrackingEmails(params?: IGetTrackingEmailsParams, config?: AxiosRequestConfig) => Promise
- User API
- activateUser(id: IdType, config?: AxiosRequestConfig) => Promise
- addDeviceToUser(params: IAddDeviceToUserParams, config?: AxiosRequestConfig) => Promise
- applyReferralCodeToUser(id: IdType, params: IApplyReferralCodeParams, config?: AxiosRequestConfig) => Promise
- [assignRolesToUser(id: IdType, roleIds: IdType[], config?: AxiosRequestConfig) => Promise
- authenticationByApple(callbackURL: string, config?: AxiosRequestConfig) => Promise
- authenticationByGoogle(params: IAuthenticationByGoogleParams, config?: AxiosRequestConfig) => Promise
- authenticationByPhoneNumber(params: IAuthenticationByPhoneNumberParams, config?: AxiosRequestConfig) => Promise
- authentication(params: IAuthenticationParams, config?: AxiosRequestConfig) => Promise
- changePassword(params: IChangePasswordParams, config?: AxiosRequestConfig) => Promise
- changePasswordForAnotherUser(params: IChangePasswordForAnotherUserParams, config?: AxiosRequestConfig) => Promise
- checkReferralUserCode(code: string, config?: AxiosRequestConfig) => Promise
- checkAuthKeyAvailable(params: ICheckAuthKeyAvailableParams, config?: AxiosRequestConfig) => Promise
- deactivateUser(id: IdType, config?: AxiosRequestConfig) => Promise
- deleteUser(id: IdType, config?: AxiosRequestConfig) => Promise
- sendEmailToVerifyEmailAddressOfUser(id: IdType, returnURL: string, config?: AxiosRequestConfig) => Promise
- activeUserEmailAddress(token: string, config?: AxiosRequestConfig) => Promise
- forgotPassword(params: IForgotPasswordParams, config?: AxiosRequestConfig) => Promise
- getUserByUsername(username: string, config?: AxiosRequestConfig) => Promise
- getUser(id: IdType, config?: AxiosRequestConfig) => Promise
- [getAppIntegrationAuthenticateURLs(params: IGetAppIntegrationAuthenticateURLsParams, config?: AxiosRequestConfig) => Promise
- [getDevicesFromUser(userId: IdType, config?: AxiosRequestConfig) => Promise
- [getUsersByListIDs(ids: IdType[], config?: AxiosRequestConfig) => Promise
- getUsers(params: IGetUsersParams, config?: AxiosRequestConfig) => Promise
- [getRolesAssignedToUser(id: IdType, config?: AxiosRequestConfig) => Promise
- getCurrentUserLoggedIn(config?: AxiosRequestConfig) => Promise
- [getRefereeOfUser(id: IdType, config?: AxiosRequestConfig) => Promise
- listAllBrandPartnersAuthenticate(userId: IdType, config?: AxiosRequestConfig) => Promise
- lockUser(id: IdType, config?: AxiosRequestConfig) => Promise
- registerNewUser(params: IRegisterNewUserParams, config?: AxiosRequestConfig) => Promise
- removeDeviceFromUser(params: IRemoveDeviceFromUserParams, config?: AxiosRequestConfig) => Promise
- resetPassword(params: IResetPasswordParams, config?: AxiosRequestConfig) => Promise
- [revokeRolesFromUser(id: IdType, roleIds: IdType[], config?: AxiosRequestConfig) => Promise
- [statisticUsers(params: IStatisticsUsersParams, config?: AxiosRequestConfig) => Promise
- suspendUser(id: IdType, config?: AxiosRequestConfig) => Promise
- unlockUser(id: IdType, config?: AxiosRequestConfig) => Promise
- unsuspendUser(id: IdType, config?: AxiosRequestConfig) => Promise
- updateUser(id: IdType, params: IUpdateUserParams, config?: AxiosRequestConfig) => Promise
- updateUserType(id: IdType, type: UserType, config?: AxiosRequestConfig) => Promise
- Configurations
- createNewConfigurationForUser(userId: IdType, params: ICreateConfigurationOfUserParams, config?: AxiosRequestConfig) => Promise
- [getConfigurationsOfUser(userId: IdType, params?: IGetConfigurationOfUserParams, config?: AxiosRequestConfig) => Promise
- deleteConfigurationOfUserByID(userId: IdType, configurationId: IdType, config?: AxiosRequestConfig) => Promise
- Email Address Verification
- sendEmailToVerifyEmailAddressOfUser(id: IdType, returnURL: string, config?: AxiosRequestConfig) => Promise
- activeUserEmailAddress(token: string, config?: AxiosRequestConfig) => Promise
- Notification
- getNotificationRelatedToUser(params: IGetNotificationRelatedToUserParams, config?: AxiosRequestConfig) => Promise
- getNotificationsByUser(params: IGetNotificationsByUserParams, config?: AxiosRequestConfig) => Promise
- markNotificationAsRead(params: IMarkNotificationAsReadParams, config?: AxiosRequestConfig) => Promise
- markAllNotificationsAsRead(userId: IdType, config?: AxiosRequestConfig) => Promise
- Passwordless
- Email
- authenticationByMagicLink(params: IAuthenticationByMagicLinkParams, config?: AxiosRequestConfig) => Promise
- generateEmailOTPForAuthentication(params: IGenerateEmailAddressOTPForAuthenticationParams, config?: AxiosRequestConfig) => Promise
- verifyEmailAddressOTPToAuthentication(params: IVerifyOTPCodeParams, config?: AxiosRequestConfig) => Promise
- Phone
- generateSMSOTP(params: IGenerateSMSOTPParams, config?: AxiosRequestConfig) => Promise
- verifyPhoneOTPForAuthentication(params: IVerifyOTPCodeParams, config?: AxiosRequestConfig) => Promise
- QR Code
- generateNewQRCode(params?: IGenerateNewQRCodeParams, config?: AxiosRequestConfig) => Promise
- getCurrentStatusOfQRCode(qrCodeId: IdType, config?: AxiosRequestConfig) => Promise
- approveQRCode(qrCodeId: IdType, config?: AxiosRequestConfig) => Promise
- loginUsingApprovedQRCode(qrCodeId: IdType, config?: AxiosRequestConfig) => Promise
- authWithApprovedQRCode(qrCodeId: IdType, config?: AxiosRequestConfig) => Promise
- OTP Code
- generateNewOTPCode(params?: IGenerateNewQRCodeParams, config?: AxiosRequestConfig) => Promise
- getCurrentStatusOfOTPCode(otpCode: string, config?: AxiosRequestConfig) => Promise
- approveOTPCode(otpCode: string, config?: AxiosRequestConfig) => Promise
- loginUsingApprovedOTPCode(otpCode: string, config?: AxiosRequestConfig) => Promise
- authWithApprovedOTPCode(otpCode: string, config?: AxiosRequestConfig) => Promise
- Wallet API
- addMoneyToWalletWithCheckoutLink(params: IAddMoneyToWalletWithCheckoutLinkParams, config?: AxiosRequestConfig) => Promise
- applyRedeemCode(params: IApplyRedeemCodeParams, config?: AxiosRequestConfig) => Promise
- createWalletDefault(currencyCode: string, testMode: boolean = false, config?: AxiosRequestConfig) => Promise
- convertWalletMoney(params: IConvertWalletMoneyParams, config?: AxiosRequestConfig) => Promise
- closeWallet(id: IdType, config?: AxiosRequestConfig) => Promise
- [getWallets(params?: IGetWalletsParams, config?: AxiosRequestConfig) => Promise
- getWalletHistory(id: IdType, params: IGetWalletHistoriesParams, config?: AxiosRequestConfig) => Promise
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.
#### Installation
Install the @jframework/jfw-js package using your preferred package manager:
``bash`
npm install @jframework/jfw-js
Or with Yarn:
`bash`
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:
`javascript
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.
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.
The ad object manages advertisements.
#### activateAd(id: IdType, config?: AxiosRequestConfig) => Promise
Activates an ad.
- Parameters:
- id _IdType_ config
_The ID of the ad to activate._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- See: Activate an Ad
#### deactivateAd(id: IdType, config?: AxiosRequestConfig) => Promise
Deactivates an ad.
- Parameters:
- id _IdType_ config
_The ID of the ad to deactivate._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- See: Deactivate an Ad
#### createAd(params: ICreateAdParams, config?: AxiosRequestConfig) => Promise
Creates an ad.
- Parameters:
- params _ICreateAdParams_ config
_The parameters for creating an ad._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- ICreateAdParams Fields:
- type _AdType_ title
_The type of the advertisement._
- _string_ - _min: 1_ position
_The title of the advertisement._
- _AdPosition_ - _min: 1_ targetURL
_The display position of the advertisement (e.g., homepage-top, sidebar)._
- _string_ description
_The target URL that the ad points to when clicked. uri - min: 1_
- _string_ tags
_The description of the advertisement._
- _string_ startDate
_The tags of the advertisement._
- _DateType_ endDate
_The start date and time when the advertisement becomes active. Format: yyyy-MM-dd HH:mm:ss date-time_
- _DateType_ metadata
_The end date and time when the advertisement expires. Format: yyyy-MM-dd HH:mm:ss date-time_
- _string_ languageCodes
_The metadata of the advertisement._
- _string[]_ countryCodes
_The list of supported language codes (ISO 639-1, e.g., "en", "vi"). If null, available for all languages._
- _string[]_ status
_The list of supported country codes (ISO 3166-1 alpha-2, e.g., "US", "VN"). If null, available in all countries._
- _AdStatus_ imageURLs
_The status of the advertisement._
- _string[]_ brandDomainIds
_The list of image URLs. Allowed formats: JPG, PNG, GIF. Maximum: 5._
- _IdType[]_
_The list of brand domains for the advertisement._
- See: Create an Ad
#### deleteAd(id: IdType, config?: AxiosRequestConfig) => Promise
Deletes an ad.
- Parameters:
- id _IdType_ config
_The ID of the ad to delete._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- See: Delete an Ad
#### getAdsClientView(position: AdPosition, config?: AxiosRequestConfig) => Promise
Gets ads with the client view.
- Parameters:
- position _AdPosition_ config
_The position for getting ads._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- See: Get Ads Client View
#### getAds(params?: IGetAdsParams, config?: AxiosRequestConfig) => Promise
Gets ads.
- Parameters:
- params _IGetAdsParams_ config
_The parameters for getting ads._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- IGetAdsParams Fields:
- type _AdType_ title
_The type to filter._
- _string_ position
_The title to filter._
- _AdPosition_ targetURL
_The position to filter._
- _string_ description
_The target URL to filter._
- _string_ status
_The description to filter._
- _AdStatus_ keywords
_The status to filter._
- _string_
_The keywords to filter._
- See: Get Ads
#### getAd(id: IdType, config?: AxiosRequestConfig) => Promise
Gets an ad.
- Parameters:
- id _IdType_ config
_The ID of the ad to get._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- See: Get an Ad
#### updateAd(params: IUpdateAdParams, config?: AxiosRequestConfig) => Promise
Updates an ad.
- Parameters:
- params _IUpdateAdParams_ config
_The parameters for updating an ad._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- IUpdateAdParams Fields:
- id _IdType_ type
_The ID of the ad to update._
- _AdType_ title
_The type of the advertisement._
- _string_ - _min: 1_ position
_The title of the advertisement._
- _AdPosition_ - _min: 1_ targetURL
_The display position of the advertisement (e.g., homepage-top, sidebar)._
- _string_ description
_The target URL that the ad points to when clicked. uri - min: 1_
- _string_ tags
_The description of the advertisement._
- _string_ startDate
_The tags of the advertisement._
- _DateType_ endDate
_The start date and time when the advertisement becomes active. Format: yyyy-MM-dd HH:mm:ss date-time_
- _DateType_ metadata
_The end date and time when the advertisement expires. Format: yyyy-MM-dd HH:mm:ss date-time_
- _string_ languageCodes
_The metadata of the advertisement._
- _string[]_ countryCodes
_The list of supported language codes (ISO 639-1, e.g., "en", "vi"). If null, available for all languages._
- _string[]_ status
_The list of supported country codes (ISO 3166-1 alpha-2, e.g., "US", "VN"). If null, available in all countries._
- _AdStatus_ imageURLs
_The status of the advertisement._
- _string[]_ brandDomainIds
_The list of image URLs. Allowed formats: JPG, PNG, GIF. Maximum: 5._
- _IdType[]_
_The list of brand domains for the advertisement._
- See: Update an Ad
The appIntegration object manages various app integrations.
#### getAppIntegrations(params?: IGetAppIntegrationsParams, config?: AxiosRequestConfig) => Promise
Lists all app integrations by type.
- Parameters:
- params? _IGetAppIntegrationsParams_ config?
_The parameters for getting app integrations._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- IGetAppIntegrationsParams Fields:
- type? _AppIntegrationType_ status?
_The type of the app integration to get._ enum
- _AppIntegrationStatus_ keywords?
_The status of the app integration to filter._ enum
- _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
Creates a new app integration analytics record.
- Parameters:
- params _ICreateAppIntegrationAnalyticsParams_ config?
_The parameters for creating analytics._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- ICreateAppIntegrationAnalyticsParams Fields:
- appIntegrationId _IdType_ trackingId
_The app integration provider ID of the analytics._ min: 1
- _string_ - min: 1 apiKey
_This ID is used to track and associate events/data with a specific analytics property or project._
- _string_ - min: 1 apiSecret?
_This is usually embedded in the frontend to initialize and send data to the analytics platform._
- _string_ metadata?
_Gets or sets the API secret or verification URL used to authorize or validate requests from the Jframework._
- _string_ accountConfigNotes?
_This can include environment-specific data, custom flags, or platform-specific information._
- _string_ isDefault?
_Gets or sets any additional notes or identifiers related to the account or setup that manages this Analytics configuration._
- _boolean_ status
_Flag to indicate if the analytics integration is the default._
- _AppIntegrationAnalyticsStatus_
_The status of the app integration._ enum
- See: Creates an App Integration Analytics
##### deleteAppIntegrationAnalytics(id: IdType, config?: AxiosRequestConfig) => Promise
Deletes an app integration analytics record by ID.
- Parameters:
- id _IdType_ config?
_The ID of the analytics record._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- See: Deletes an App Integration Analytics
##### getAppIntegrationAnalytics(id: IdType, config?: AxiosRequestConfig) => Promise
Gets an app integration analytics record by ID.
- Parameters:
- id _IdType_ config?
_The ID of the analytics record._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- See: Gets an App Integration Analytics
##### getAppIntegrationAnalyticsWithBrand(config?: AxiosRequestConfig) => Promise
Lists all app integration analytics associated with a brand.
- Parameters:
- config? _AxiosRequestConfig_
_Optional Axios request configuration._
- See: Get Apps Integration Analytics
##### updateAppIntegrationAnalytics(params: IUpdateAppIntegrationAnalyticsParams, config?: AxiosRequestConfig) => Promise
Updates an app integration analytics record by ID.
- Parameters:
- params _IUpdateAppIntegrationAnalyticsParams_ config?
_The parameters for updating analytics._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- IUpdateAppIntegrationAnalyticsParams Fields:
- id _IdType_ appIntegrationId
_The app integration analytics id._
- _IdType_ - min: 1 trackingId
_The app integration provider ID of the analytics._
- _string_ - min: 1 apiKey
_This ID is used to track and associate events/data with a specific analytics property or project._
- _string_ - min: 1 apiSecret?
_This is usually embedded in the frontend to initialize and send data to the analytics platform._
- _string_ metadata?
_Gets or sets the API secret or verification URL used to authorize or validate requests from the Jframework._
- _string_ accountConfigNotes?
_This can include environment-specific data, custom flags, or platform-specific information._
- _string_ isDefault?
_Gets or sets any additional notes or identifiers related to the account or setup that manages this Analytics configuration._
- _boolean_ status
_Flag to indicate if the analytics integration is the default._
- _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
Creates a new app integration authentication.
- Parameters:
- params _ICreateAppIntegrationAuthenticationParams_ config?
_The parameters for creating authentication._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- ICreateAppIntegrationAuthenticationParams Fields:
- appIntegrationId _string_ - min: 1 code
_The app integration id._
- _string_ - min: 1 name
_The code of the app integration._
- _string_ - min: 1 projectId
_The name of the app integration._
- _string_ - min: 1 clientId
_The project Id of the app integration._
- _string_ - min: 1 clientSecret
_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._
- _string_ - min: 1 redirectURI
_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._
- _string_ - uri - min: 1 scope
_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._
- _string_ - min: 1 authEndpoint?
_The scope of the app integration._
- _string_ - uri tokenEndpoint?
_The authentication endpoint of the app integration._
- _string_ - uri iconURL?
_The token endpoint of the app integration._
- _string_ - uri tags?
_The icon URL of the app integration._
- _string_ description?
_The tags of the app integration._
- _string_ status?
_The description of the app integration._
- _AppIntegrationAuthenticationStatus_ isDefault?
_The status of the app integration._ enum
- _boolean_ false
_Flag to indicate if the authentication integration is the default._ defaultValue
- See: Creates an App Integration Authentication
##### createAppIntegrationAuthenticationWithImportFileSettings(params: ICreateAppIntegrationAuthenticationWithImportFileSettingsParams, config?: AxiosRequestConfig) => Promise
Creates a new app integration authentication with import file settings.
- Parameters:
- params _ICreateAppIntegrationAuthenticationWithImportFileSettingsParams_ config?
_The parameters for creating authentication with import file._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- ICreateAppIntegrationAuthenticationWithImportFileSettingsParams Fields:
- appIntegrationId _IdType_ file
_The app integration id._
- _File_ - min: 1
_The file setting to import._
- See: Create an App Integration Authentication by Import File
##### deleteAppIntegrationAuthentication(id: IdType, config?: AxiosRequestConfig) => Promise
Deletes an app integration authentication by ID.
- Parameters:
- id _IdType_ config?
_The ID of the authentication._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- See: Deletes an App Integration Authentication
##### getAppIntegrationAuthentication(id: IdType, config?: AxiosRequestConfig) => Promise
Gets an app integration authentication by ID.
- Parameters:
- id _IdType_ config?
_The ID of the authentication._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- See: Gets an App Integration Authentication
##### getAppsIntegrationAuthenticationWithBrand(params?: IGetAppIntegrationAuthenticationsWithBrandParams, config?: AxiosRequestConfig) => Promise
Gets app integration authentications for a brand.
- Parameters:
- params? _IGetAppIntegrationAuthenticationsWithBrandParams_ config?
_The parameters for getting authentications._
- _AxiosRequestConfig_
_Optional Axios request configuration._
- IGetAppIntegrationAuthenticationsWithBrandParams Fields:
- appIntegrationId? _string_ code?` _string_
_The app integration id to filter._
-
_The code to filter._
-