Local Hosting
A Pro or Enterprise plan is required to host WebAR projects on your own web servers.
To purchase a Pro plan, please see https://www.8thwall.com/docs/guides/account-settings/#purchase-plan
Getting started
Follow the getting started guide by cloning self-hosted sample projects from the 8th Wall Github Repository.
To develop locally you need Node.js and npm installed. If you don't already have Node.js and npm installed, get it here.
- Download the source code from the 8th Wall Github Repository and
cd
into an example of your choice (aframe is recommended for beginners). - Replace the app key in
index.html
with your app key from the project settings page in the 8th Wall console. - Authorize access to your app key on your device by authorizing the device or whitelisting the domain (localhost / IP address).
- Serve a project directory on your local network over HTTPS with http-server. See Serve projects over HTTPS.
- Connect to your sever from your device, accept certificate warnings and camera permissions. See View Project on iOS or View Project on Android.
Serve projects over HTTPS
Browsers require HTTPS certificates to access the camera. Use http-server to serve project directories with HTTPS.
First, you need to make sure that openssl is installed, and you have key.pem and cert.pem files. You can generate them using this command:
openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
You will be prompted with a few questions after entering the command. Use 127.0.0.1 as value for Common name if you want to be able to install the certificate in your OS's root certificate store or browser so that it is trusted.
This generates a cert-key pair and it will be valid for 3650 days (about 10 years).
Then you can run http-server
with -S
for enabling SSL and -C
for your certificate file:
npx http-server [project-path] -S -C cert.pem
Example:
npx http-server gettingstarted/aframe/ -S -C cert.pem
NOTE: The first IP address listed is 127.0.0.1:8080 (which is the loopback device aka "localhost") and your mobile phone won't be able to connect to that IP address directly. Please use one of the other IP addresses.
WINDOWS USERS: Run the http-server command using a standard Command Prompt window (cmd.exe). The script may generate errors if run from PowerShell.
Learn more in the http-server documentation.
View Project on iOS
- Open Safari on iOS 11+, and connect to one of the “Available on” URLs. Note: Safari will complain about the SSL certificates, but you can safely proceed.
IMPORTANT: Make sure to copy the entire "Available on" URL into your browser, including both the "https://" at the beginning and port number at the end.
Example: https://10.0.0.99:8080
- Click "visit this website":
- Click "Show Details":
- Click "Visit Website":
- Finally, click "Allow" to grant camera permissions and start viewing the sample AR experience:
View Project on Android
- Open Chrome, a Chrome-variant (e.g. Samsung browser) or Firefox
IMPORTANT: Make sure to copy the entire "Available on" URL into your browser, including both the "https://" at the beginning and port number at the end.
Example: https://10.0.0.99:8080
- Chrome Example: The browser will complain that the cert is invalid, simply click
'ADVANCED'
to proceed:
- Click "PROCEED TO ... (UNSAFE)":