Add <script src="https://cdn.3dcloud.io/mxt-ar-sdk/<version>/MxtWebAR-<version>.min.js"></script>
to the <head>
of your document.
Example code should look like this:
<head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>WebAR CDN</title> <script src="https://cdn.3dcloud.io/mxt-ar-sdk/<ask-for-latest-version>/MxtWebAR-<ask-for-latest-version>.min.js"></script> </head> |
So if using 7.5.0, for example, you would add: <script src="https://cdn.3dcloud.io/mxt-ar-sdk/7.5.0/MxtWebAR-7.5.0.min.js"></script>
.npmrc
file in the root directoryNavigate to the root directory of your web application where you want to use our SDK.
Create a new file and name it .npmrc
Copy and paste this code into the .npmrc
file exactly as is:
email=support@marxent.com always-auth=true registry=https://nexus.3dcloud.io/repository/npm-group/ _auth=<insert token here> |
Save the file. NOTE: It won’t be functional yet, now we need to generate the auth token.
Generate the _auth
token
If you already have an account on Marxent’s private nexus NPM repository, you will use your username and password.
If you need a NEW account on Marxent’s private nexus NPM repository: contact your Marxent Account Director to get your username and password.
If you’re ready to dive in right now, try a CDN Implementation.
Open a new Unix or Linux terminal shell.
Run the command echo -n 'myuser:mypassword'| openssl base64
to get your auth token.
Replace 'myuser:mypassword'
with the username and password that you retrieved above.
This command will output an encoded key that you will use to replace <insert token here>
in your .npmrc
file.
Open your .npmrc
file and replace the <insert auth token here>
with the output from above. Example: c2VhdHRsZTp3bT1AMl80QipQN3Z0JHUl
Example NEW .npmrc
file:
email=support@marxent.com always-auth=true registry=https://nexus.3dcloud.io/repository/npm-group/ _auth=c2VhdHRsZTp3bT1AMl80QipQN3Z0JHUl |
Open your package.json
in the root directory where you want to use our SDK
Navigate to the "dependencies":
section
Add our package as a dependency.
Ask your Account Director for the latest and greatest version to use!
In your package.json, under "dependencies":
section, add "@mxt/mxt-webar-sdk": "7.5.0",
When completed, your dependencies package will look something like this:
"dependencies": { ... "@mxt/mxt-webar-sdk": "7.5.0", ... } |
Run npm install
If this doesn’t work, please note that we have had some problems with certain versions of NPM accessing our nexus repository. In this case:
NPM version MUST be 6.x.x because 7.x.x will NOT connect to our nexus repo
To check: open your terminal, and run the command npm -v
NOTE: If using a Mac with a M1 processor, a newer version of node than 8 is required because 8 is not compatible with the ARM architecture. In this case, use node v14.18.3
, as it is the last version of node to ship with npm v6.x (in this case, v6.14.15
), also found on this page.