Integration of Notice
Overview
Concur provides several functions to integrate consent notices into your application. These notices can be displayed in various positions to ensure compliance with consent management policies. Below are the functions available for integrating notices:
Functions
1. morajNoticeCenter
morajNoticeCenterDisplays a notice in the center of the application.
Function Signature:
morajNoticeCenter(cp_id, app_id, org_id, org_key, org_secret)Parameters:
cp_id(string): The unique identifier of the collection point.app_id(string): Your application ID, retrieved from the.envfile.org_id(string): Your organization ID, retrieved from the.envfile.org_key(string): Your organization key, retrieved from the.envfile.org_secret(string): Your organization secret, retrieved from the.envfile.
Usage Example:
morajNoticeCenter(
"cp_id(from yaml)",
process.env.CON_APP_ID,
process.env.CON_ORG_ID,
process.env.CON_ORG_KEY,
process.env.CON_ORG_SECRET
);morajNoticeCenter(
"cp_id(from yaml)",
process.env.REACT_APP_CON_APP_ID,
process.env.REACT_APP_CON_ORG_ID,
process.env.REACT_APP_CON_ORG_KEY,
process.env.REACT_APP_CON_ORG_SECRET
);morajNoticeCenter(
"cp_id(from yaml)",
process.env.NEXT_PUBLIC_CON_APP_ID,
process.env.NEXT_PUBLIC_CON_ORG_ID,
process.env.NEXT_PUBLIC_CON_ORG_KEY,
process.env.NEXT_PUBLIC_CON_ORG_SECRET
);Setting Up Environment Variables in different libraries and framework
When working with JavaScript and React.js, it is crucial to manage environment variables effectively to ensure a smooth development process. Follow these steps to set up your environment variables:
Install
dotenvPackage: To load environment variables in your application, first, ensure you have thedotenvpackage installed. You can install it via npm:Configure
.envFile: Create a.envfile at the root of your project directory. This file will store your environment variables. For React.js and Next.js applications, you need to follow specific naming conventions for these variables to ensure they are accessible in your code.For React.js: Prefix your environment variables with
REACT_APP_. This ensures that React can expose these variables to your application.
For example:
For Next.js: Prefix your environment variables with
NEXT_PUBLIC_. This is necessary for Next.js to expose these variables to both the server and client-side code.
For example:
Accessing Environment Variables in Your Code:
In React.js: You can access these variables using
process.env.REACT_APP_{VARIABLE_NAME}in your React components or other JavaScript files. For example:In Next.js: Access these variables using
process.env.NEXT_PUBLIC_{VARIABLE_NAME}in your Next.js components or other files. For example:
By following these steps and properly configuring your .env file, you ensure that your environment variables are securely loaded and available throughout your application.
2. morajNoticeLeft
morajNoticeLeftDisplays a notice on the left side of the application.
3. morajNoticeBottom
morajNoticeBottomDisplays a notice at the bottom of the application.
Implementation Steps
Install Required Packages: Ensure that you have all necessary npm packages installed in your project.
Configure Environment Variables: Make sure your
.envfile contains the correct values forcon_app_id,con_org_id,con_org_key, andcon_org_secret.Add Notice Functionality: Use one of the provided functions (
morajNoticeCenter,morajNoticeLeft,morajNoticeBottom) to integrate the notice into your application at the desired location.Test Integration: Verify that the notice appears as expected in the center, left side, or bottom of the application.
Last updated