{"id":22872020,"url":"https://github.com/yiskang/forge-proxy-server","last_synced_at":"2025-06-14T23:35:49.334Z","repository":{"id":44109564,"uuid":"196525475","full_name":"yiskang/forge-proxy-server","owner":"yiskang","description":"This sample is demonstrating how to host a proxy server to forward all requests from the Forge Viewer to this backend without showing access token in your viewer frontend","archived":false,"fork":false,"pushed_at":"2022-12-10T22:09:38.000Z","size":49,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T17:41:26.611Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yiskang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-12T06:54:49.000Z","updated_at":"2019-07-12T06:56:00.000Z","dependencies_parsed_at":"2023-01-26T12:01:06.566Z","dependency_job_id":null,"html_url":"https://github.com/yiskang/forge-proxy-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiskang%2Fforge-proxy-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiskang%2Fforge-proxy-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiskang%2Fforge-proxy-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yiskang%2Fforge-proxy-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yiskang","download_url":"https://codeload.github.com/yiskang/forge-proxy-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246465218,"owners_count":20781919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T13:32:39.048Z","updated_at":"2025-03-31T11:45:37.062Z","avatar_url":"https://github.com/yiskang.png","language":"JavaScript","readme":"[![Node.js](https://img.shields.io/badge/Node.js-8.9.4-blue.svg)](https://nodejs.org/)\n[![npm](https://img.shields.io/badge/npm-5.8.0-blue.svg)](https://www.npmjs.com/)\n![Platforms](https://img.shields.io/badge/platform-windows%20%7C%20osx%20%7C%20linux-lightgray.svg)\n[![License](http://img.shields.io/:license-mit-blue.svg)](http://opensource.org/licenses/MIT)\n\n# Autodesk Forge Proxy Server\n\n## Overview\n\nThis sample is demonstrating how to host a proxy server to forward all requests from the Forge Viewer to this backend without showing access token in your viewer frontend.\n\n## Requirements\n\n* node.js v8.9.4 or later\n\n\u003ca name=\"setup\"\u003e\u003c/a\u003e\n## Setup\n\n1. Download and install [Node.js](http://nodejs.org/) (that will install npm as well)\n2. Download this repo anywhere you want\n3. Execute 'npm install', this command will download and install the required node modules automatically for you. \u003cbr /\u003e\n   ```bash\n   npm install\n   ```\n\n\u003ca name=\"UseOfTheSample\"\u003e\u003c/a\u003e\n## Use of the sample\n\nBefore starting the server, you have to set the Forge credentials up.\n\n- Mac OSX/Linux (Terminal)\n   ```bash\n   export FORGE_CLIENT_ID=\u003c\u003cYOUR_CLIENT_ID_FROM_DEVELOPER_PORTAL\u003e\u003e\n   export FORGE_CLIENT_SECRET=\u003c\u003cYOUR_CLIENT_SECRET\u003e\u003e\n   ```\n\n- Windows (use **Node.js command line** from Start menu)\n   ```bash\n   set FORGE_CLIENT_ID=\u003c\u003cYOUR_CLIENT_ID_FROM_DEVELOPER_PORTAL\u003e\u003e\n   set FORGE_CLIENT_SECRET=\u003c\u003cYOUR_CLIENT_SECRET\u003e\u003e\n   ```\n\n\n- Windows (use **Powershell** from Start menu)\n   ```bash\n   $env:FORGE_CLIENT_ID=\"\u003c\u003cYOUR_CLIENT_ID_FROM_DEVELOPER_PORTAL\u003e\u003e\"\n   $env:FORGE_CLIENT_SECRET=\"\u003c\u003cYOUR_CLIENT_SECRET\u003e\u003e\"\n   ```\n\n\nThen Run the server \u003cbr /\u003e\n   ```bash\n   npm start\n   ```\n\n- Configure viewer endpoint\nInitialize your viewer app in this way:\n\n```JavaScript\nconst options = {\n   env: 'AutodeskProduction',\n   accessToken: 'eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5X2RldiJ9.eyJjbGllbnRfaWQiOiJjWTFqcm1rQXhPSVptbnNsOVhYN0puVURtVEVETGNGeCIsImV4cCI6MTQ4NzU2NzgwMSwic2NvcGUiOlsiZGF0YTpyZWFkIl0sImF1ZCI6Imh0dHBzOi8vYXV0b2Rlc2suY29tL2F1ZC9qd3RleHAzMCIsImp0aSI6InJZcEZZTURyemtMOWZ1ZFdKSVVlVkxucGNWT29BTDg0dFpKbXlmZ29ORW1MakF0YVVtWktRWU1lYUR2UGlnNGsifQ.uzNexXCeu4efGPKGGhHdKxoJDXHAzLb28B2nSjrq_ys' //!\u003c\u003c\u003c Pass a expired token to avoid initializing auth issue on the Forge Viewer v7.x\n};\n\nAutodesk.Viewing.Initializer( options, () =\u003e {\n  // Change derivative endpoint to Proxy endpoint\n  Autodesk.Viewing.endpoint.setApiEndpoint( 'http://127.0.0.1:8085/forge-proxy', 'derivativeV2' );\n\n  Autodesk.Viewing.Document.load(documentId, onDocumentLoadSuccess, onDocumentLoadFailure);\n});\n```\n\n## License\n\nThis sample is licensed under the terms of the [MIT License](http://opensource.org/licenses/MIT).\nPlease see the [LICENSE](LICENSE) file for full details.\n\n## Written by\n\nEason Kang \u003cbr /\u003e\nForge Partner Development \u003cbr /\u003e\nhttps://developer.autodesk.com/ \u003cbr /\u003e\nhttps://forge.autodesk.com/blog \u003cbr /\u003e","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiskang%2Fforge-proxy-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyiskang%2Fforge-proxy-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyiskang%2Fforge-proxy-server/lists"}