1

I'm trying to run examples-browser/staging/stage-scene-structure in local server, i've created publishableApiKey and added it in the io3d.config. On selection of a area console displays following error

HomeStaging error: You are not authorized to access this method. Please use your API key to use this method or get a free API key at 3d.io

How to resole this?

Note: I'm using free quotas

Thanks

Community
  • 1
  • 1
Sunil
  • 13
  • 3

1 Answers1

4

I'm sorry to hear you're having issues. The first thing that comes to mind is that the allowed domains associated with your publishable API key are incorrect.

When setting the domains you have to set them without quotes, i.e. only the domains separated by spaces:

localhost *.3d.io mypage.com

The solution for now while the leading/trailing quotes are not ignored by the library is to generate a new API key with the correct list of domains.

When it comes to running the application locally, all you need to do is to follow the installation guidelines here

git clone https://github.com/archilogic-com/3dio-js.git ; cd ./3dio-js
npm install rollup -g ; npm install lite-server -g
npm install

Now you can edit the index.html file, adding your publishable API key to config. Then you can go back to terminal and start the server:

npm start

This will automatically open the examples in the browser:

enter image description here

where you can click through to the example you'd like to test out:

enter image description here

m-ke
  • 130
  • 2
  • 7
  • Still the same issue, i created a new key and added `localhost *.3d.io`(without quotes) in allowed domains. In **stage-scene-structure** example, console displays the same error – Sunil Oct 24 '17 at 12:28
  • I have just tested the app locally using your publishable API key and it worked as expected (don't worry, it won't affect your quotas :) ). To try to reproduce your issue I followed the installation guidelines here https://github.com/archilogic-com/3dio-js#contribute, edited config in the index.html file and opened the file in the browser. Can you maybe tell me in more detail how exactly you were testing it, what browser you used? – m-ke Oct 24 '17 at 13:12
  • Following are the details Operating System: Windows 10 Pro Web Server: Apache 2.4.27 Browser: Chrome Version 62.0.3202.62 (Official Build) (64-bit) I've placed the index.html in a sub-directory and try to access via localhost. – Sunil Oct 24 '17 at 13:37
  • _I've placed the index.html in a sub-directory and try to access via localhost_ -> this might be the issue, although I don't know how exactly you're trying to access it. If you follow the instructions [here](https://github.com/archilogic-com/3dio-js#contribute) including running npm start from the root directory, the application opens automatically in the browser and you can click through to the example you'd like to run. Then everything works as expected. I'll update the answer with screenshots. – m-ke Oct 24 '17 at 13:48