Skip to content

Enhance user engagement by allowing your app to be directly accessed and interacted with from within Discord. With easy setup and customizable options, get your Playcanvas project connected to Discord in no time!

License

Notifications You must be signed in to change notification settings

MushAsterion/playcanvas-discord-embedded-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord Activities Integration for Playcanvas Apps

This repository provides a template for integrating a Playcanvas application within Discord Activities. By following the instructions below, you can easily set up your Playcanvas app to be displayed within Discord's Embedded Apps.

Getting Started

Follow these steps to set up the template for your Playcanvas application:

  1. Clone the Repository: Clone this repository to your local machine.

    git clone https://github.com/MushAsterion/playcanvas-discord-embedded-app.git
  2. Set Environment Variables:

    Open the .env file and update the following environment variables:

    • NEXT_PUBLIC_DISCORD_APP_CLIENT_ID: Set this to your Discord application's client ID.
    • DISCORD_APP_CLIENT_SECRET: Set this to your Discord application's client secret.
    • NEXT_PUBLIC_DISCORD_AUTH_BACKGROUND (Optional): Set this to change the background displayed until the user authorizes the game. Will default to #000 (plain black background).
  3. Add Playcanvas Build:

  4. Update Index.html (Optional):

    If your index.html file is different from the default one provided by Playcanvas Editor, update it within src/pages/_document.jsx file to match the content, except for the scripts __start__.js and __loading__.js that will be loaded after user is authenticated.

  5. Deploy the Application:

    Deploy your application using your preferred method.

Usage

Once you've completed the setup, users can interact with your Playcanvas application directly within Discord Activities. Please refer to Discord's official documentation to use the SDK.

SDK is available directly from window.discordSdk, and authentication is available directly from window.discordSdkAuth.

Contributing

Contributions are welcome! If you have any improvements or suggestions, feel free to open an issue or pull request.

License

This project is licensed under the MIT License.

About

Enhance user engagement by allowing your app to be directly accessed and interacted with from within Discord. With easy setup and customizable options, get your Playcanvas project connected to Discord in no time!

Topics

Resources

License

Stars

Watchers

Forks