Trial Token
If you are evaluating DS Server and you are using a trial token, you can skip the Prerequisites - DS Server Installation and the DS Server Setup part and continue with the integration.
This article shows how to setup a new project with DS Server and how to use the document editor npm package in a React application.
If you are evaluating DS Server and you are using a trial token, you can skip the Prerequisites - DS Server Installation and the DS Server Setup part and continue with the integration.
In order to follow these tutorials, DS Server must be successfully installed and licensed on a server. To learn how to do that, read the following articles:
In the DS Server admin portal, a new security profile needs to be added.
Select Security Profiles from the main menu to open the security profile overview. Click on Create new profile to create a new security profile:
Type in a name and confirm with Create:
The profile details are shown including the Client ID and Client Secret values required for the OAuth authentication flow:
In the next step, a new React Application is created.
Open a Command Prompt and install create-react-app by running this command in your terminal:
npm install -g create-react-app
Run the following command to create a React application named my-ds-react-viewer-app:
npx create-react-app my-ds-react-viewer-app
Change into the created folder by typing in the following command:
cd my-ds-react-viewer-app
Install the TX Text Control document viewer package by typing in the following command:
npm install --save @txtextcontrol/tx-react-ds-document-viewer
Open this folder in Visual Studio Code using this command:
code .
In Visual Studio Code, open the file src -> App.js, replace the content with the following code and save it. Replace yourtoken with your actual access token you created at the beginning of this tutorial.
import DocumentViewer from '@txtextcontrol/tx-react-ds-document-viewer'
function App() {
return (
<DocumentViewer
width="1024px"
height="1024px"
serviceURL="https://trial.dsserver.io"
clientId="dsserver.u5NQQHkgjmCRAOeChUVc19zNFJ9aivKz"
clientSecret="tPGgkutg8oYuSHPbfuRfE5DMf9arUCEg"
documentData="SGVsbG8gdGhlcmU="
userNames={['user1', 'user2']}>
</DocumentViewer>
);
}
export default App;
Back in the command prompt, start the React application by typing in the following commands:
npm install -g serve