Inside the public folder where you created the index.html file add the HTML setup code.
<!DOCTYPE html>
<html>
<head>
<title>TinyMCE with Export to Word</title>
<script
src="https://cdn.tiny.cloud/1/no-api-key/tinymce/8/tinymce.min.js"
referrerpolicy="origin"
crossorigin="anonymous">
</script>
<script>
tinymce.init({
selector: 'textarea',
plugins: 'exportword',
toolbar: 'exportword',
exportword_converter_options: {
'document': {
'size': 'Letter'
}
},
// exportword_token_provider fetches a token from the `/jwt` endpoint.
exportword_token_provider: () => {
return fetch('http://localhost:3000/jwt', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
}).then(response => response.json());
},
});
</script>
</head>
<body>
<h1>TinyMCE Export to Word Demo</h1>
<textarea>
Welcome to TinyMCE! Try the Export to Word feature.
</textarea>
</body>
</html>