Web Application Examples
Add the MetaMap button to your web app
Web Applications
MetaMap offers the example applications for the following frameworks to show how you can add the MetaMap button to your existing web applications:
JavaScript
The JavaScript example uses no framework to add the button to your site.
To run this example, you will need to:
-
Download the files
-
Add your Client ID and Metamap (Flow) ID for your MetaMap to the
body
tag in theindex.html
file:<div class="container"> <metamap-button clientid="YOUR_CLIENT_ID" flowid="YOUR_FLOW_ID"></metamap-button> </div>
-
Open the
index.html
file in your browser.
Angular
The Angular example uses the Angular CLI. To run this example:
-
Download the Angular files
-
Add your Client ID and Metamap (Flow) ID for your MetaMap to the
src/app/app.component.html
file:<div class="container"> <metamap-button appVerification [attr.clientid]="YOUR_CLIENT_ID" [attr.flowid]="YOUR_FLOW_ID" > </metamap-button> </div>
-
In the Angular CLI, run the following command:
npm run start
React
The React example uses the React CLI. To run this example:
-
Download the React files
-
Add your Client ID and Metamap (Flow) ID for your MetaMap to the
src/App.js
file in theApp()
function:function App() { const button = useRef(null); const [clientid] = useState('YOUR_CLIENT_ID'); const [flowid] = useState('YOUR_FLOW_ID');
-
In the React CLI, run the following command:
npm run start
Vue
The Vue example uses the Vue CLI. To run this example:
Updated about 2 years ago