@calvinorg/khoros-aurora-sdk-test
v24.4.6
Published
The Aurora SDK allows you to customize various plugin points using a Git repository for your community. You can preview changes made to the repository through Aurora's Plugin Preview tool, which uses Node to synchronize your local development environment
Downloads
2
Readme
Using the Aurora SDK
Start by ensure you have NodeJS installed. Node versions 16 and 17 are currently supported. Using NVM
(https://github.com/nvm-sh/nvm) will make it easier to use newer version of NodeJS in the future. If you have
NVM installed, simply run nvm use
in the terminal to ensure you're using the correct version of NodeJS.
Once NodeJS is installed, open a terminal shell, and run npm i
from this directory . This will ensure the
necessary dependencies are available, including the Aurora SDK.
Setting up the environment
- In a text editor, edit the
.env
file in the root your plugin's filesystem. If you don't see it, note that the file may be hidden by default by your OS (Mac: https://www.macworld.com/article/671158/how-to-show-hidden-files-on-a-mac.html, Windows: https://support.microsoft.com/en-us/windows/view-hidden-files-and-folders-in-windows-97fbc472-c603-9d90-91d0-1166d1d9f4b5). If you still don't see this file, create it. - Add an entry for
LIA_URL
. This is the base URL of your community (for example,LIA_URL=https://community.bigco.com
) - Add an entry for
SDK_KEY
to be the value of the SDK Key found in the Dev Tools (/admin/dev
) section of your community's admin console (for example,SDK_KEY=abcd1234
) - Save your changes to the
.env
file. - Install all the dependencies by running
npm install
ornpm i
. Once the dependencies are installed successfully, please runnpm run init
command to set up the required files.
Using Plugin Preview
Plugin Preview synchronizes the assets in your plugin with your community. The changes are kept in memory and are only visible to admin users.
- Open a terminal shell, and run
npm run start
. This will start the Plugin Preview process. - At this point, any changes you make to the files in your plugin repository will be synchronized with your community. Reload the page in the community where the asset is used to see the changes. To undo the changes, revert the file you changed.
- On Plugin Preview startup, any currently changed files are synced into memory. All changes are cleared from memory once the Plugin Preview process is stopped. The process can be done using
Ctrl-C
.
Developing a Custom React Component
- Clone the git repo at https://github.com/community-khoros-internal/aurora-plugin-example
- Copy over the
res/components/ReactSample
directory to your plugin's filesystem - Copy over the
src/components/ReactSample
directory to your plugin's filesystem - Commit and push these changes to a branch of your plugin of your choosing
- Create a pull request to pull these changes into the main branch of your plugin (
<phase>-main
, notmain
) - Once the pull request is merged, in a browser, go into Designer in the admin console of your community
- From there, go to "Page Templates" and select the page where you want to add the custom component
- Click on the "+" symbol to add the component, then select "Custom" under "Other"
- Select "ReactSample". This should add the sample component to your page.
- Click Save and Publish
- In your browser, navigate back to the page where the component was published
- Now that the sample React component is on your page, start up the Plugin Preview process (see above)
- In a new terminal shell, run
npm run dev
. This will start the dev server process. The process can be stopped usingCtrl-C
. - Edit the
res/components/ReactSample/ReactSample.component.json
file (you can simply add a space to the description in the "defaults" section). This tells the community to load the plugin from your local dev server. - In your browser, reload the page where the component . The sample React component should now load from your local dev server.
- Edit the
src/components/ReactSample/Component.tsx
file (you can simply change some text). - In your browser, reload the page where the component. Your changes should be reflected on the component.
- To continue development on a separate branch, create a new branch of your plugin from
qa-main
. - Once this is done, you can safely remove the custom component from the page where it was added using Designer. It will still appear on the page as long as you specify your branch as the Active Branch in Dev Tools (
/admin/dev
in your community).