https://github.com/petrbroz/aps-viewer-react-demo
Simple React app with experimental wrapper for Autodesk Platform Services Viewer.
https://github.com/petrbroz/aps-viewer-react-demo
Last synced: 6 months ago
JSON representation
Simple React app with experimental wrapper for Autodesk Platform Services Viewer.
- Host: GitHub
- URL: https://github.com/petrbroz/aps-viewer-react-demo
- Owner: petrbroz
- Created: 2023-02-20T16:35:54.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-20T16:37:49.000Z (over 2 years ago)
- Last Synced: 2025-02-17T20:41:25.294Z (8 months ago)
- Language: TypeScript
- Size: 31.3 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# aps-viewer-react-demo
Simple [React](https://reactjs.org) application with an experimental wrapper for [Autodesk Platform Services](https://aps.autodesk.com) Viewer.
## Running locally
### Prerequisites
In order to test this application you'll need two things:
- access token for accessing models in APS (only the `viewables:read` scope is needed)
- URN of a model that's been converted to the SVF2 format> If you don't know how to get these, start by [creating an APS application](https://aps.autodesk.com/en/docs/oauth/v2/tutorials/create-app/),
> install [Visual Studio Code](https://code.visualstudio.com/), and add our [extension](https://marketplace.visualstudio.com/items?itemName=petrbroz.vscode-forge-tools)
> to it. The extension allows you to do various tasks within Autodesk Platform Services, incl. uploading models, translating them, and generating access tokens.### Steps
- clone this repository
- install Node.js dependencies: `npm install`
- hard-code your access token and model URN in [./src/index.tsx](./src/index.tsx#L6-L7)
- build the React app: `npm run build`
- serve the built app locally: `npm run preview`
- open your browser and go to http://127.0.0.1:4173/## Reusing the wrapper
If you want to use the `` component in your own React application, copy the following two files to your source code:
- [./src/components/Viewer.tsx](./src/components/Viewer.tsx)
- [./src/components/Viewer.utils.ts](./src/components/Viewer.utils.ts)And don't forget to add Viewer dependencies to your markup:
```html
```