Example of a Discord Activity built with the fastest 3D engine for the web.
Retrieve a "Discord Client ID" and "Discord Client Secret" via the Discord Developer Portal, by creating a new app.
- Copy the
example.envas.env - Replace the
DISCORD_CLIENT_IDandDISCORD_CLIENT_SECRETin the.envfile with your app's. npm ito install package dependencies
- Run via
cd server && npm run devandcd server && npm run tunnel - Update URL mapping of your Discord app to map
/to the URL provided by the cloudflare tunnel. - Open
DiscordActivityExample.wlpin Wonderland Editor. - Enable developer mode on your Discord client.
The npm server run via npm run dev will reverse proxy Wonderland Editor's webserver and websockets
through the cloudflare tunnel.
- In
src/index.js, replace theDISCORD_CLIENT_IDwith your app's ID. - Build your project via Wonderland Editor
- Create a new Docker image of your server via
npm run build-server(make sure to replace the image name to yours, example image tag would look like this:alexkiriwle/discord-activity:v1)Caution
You should avoid using the :latest tag when deploying containers in production as it is harder to track which version of the image is running and more difficult to roll back properly.
- Publish this image via
npm run push - Create a new Wonderland Apis deployment via
npm run create-apireplaceApiNameandImageTagwith your own values - Publish the Wonderland project as a Wonderland Cloud Page via
npm run create-activity-pagethis will publish your Discord activity to the web - Now you need to connect the Discord Activity to your API deployment, this can be done by using the
npm run create-api-pathcommand just make sure that the values are updated with your actual values forPageNameandApiName
That's it! Now you can use the projectDomain of your deployed Wonderland Cloud Page as a target for your URL mapping
