npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

strapi-azerothcore

v1.6.0

Published

AzerothCore integration for Strapi.

Downloads

9

Readme

Strapi AzerothCore plugin

AzerothCore integration in Strapi CMS.

NPM Version

✨ Features

  • Multi-realm support out of the box
  • Registration that also creates an in-game account with the same credentials
  • Login with the same credentials as the in-game account
  • Password reset and password change, which also change the in-game account password
  • Account confirmation
  • Linking of CMS accounts for existing in-game accounts

📋✔️ Requirements

🛠️ Installation

Install the plugin in your Strapi project:

# using npm
npm install strapi-azerothcore

# using yarn
yarn add strapi-azerothcore

Using a text/code editor, open config/plugins.js (or config/plugins.ts if applicable), add a "strapi-azerothcore" object with an enabled property set to true:

module.exports = ({ env }) => ({
	// ...
	"strapi-azerothcore": {
		enabled: true,
	},
	// ...
});

After installing the plugin, you must rebuild the admin dashboard for it to include the plugin.
Use the build script to rebuild Strapi, or use develop if you'd like to start it as well:

# using npm
npm run build
# or
npm run develop

# using yarn
yarn build
# or
yarn develop

The AzerothCore plugin should now appear in the left pane of your Strapi dashboard: Strapi dashboard left pane plugin

⚙️ Setup

General settings

In the leftmost pane of the Strapi dashboard, go to "AzerothCore", then "General" under the Settings category

  • Allow linking existing game accounts
    Check this to enable creating CMS user accounts for existing AzerothCore accounts. To use this feature, users will need to go through the registration process on your website and make sure to provide the account name and password they're using to log into the game server.

Realms settings

In the leftmost pane of the Strapi dashboard, go to "AzerothCore", then "Realms" under the Settings category

This is where you define your different realms.
Typically you need to have one entry for each row in the realmlist table of your acore_auth database.

You can click the "➕ Create realm" button on the top right corner of the page to add an entry, click one of the table's rows to edit an entry, or click the 🗑️ button on the right to delete an entry.

Each entry has the following settings:

Characters Database

  • Host: the hostname on which your MySQL database server is running
  • Port: the port on which your MySQL database server is listening, usually 3306
  • Database: the name of the database, usually acore_characters
  • User: the MySQL user to connect with. Make sure that the user has access to the specified database.
  • Password: the user's password

You can press the "🔌 Test Connection" button to ensure Strapi is able to connect to your database properly.

SOAP

  • Host: the hostname on which your AzerothCore worldserver is running.
    See SOAP.IP in your worldserver.conf.
  • Port: the port on which your AzerothCore worldserver is listening for SOAP connections, usually 7878.
    See SOAP.Port in your worldserver.conf.
  • Username: the AzerothCore account name to connect with.
    Make sure that the account has a security level of 3:
    • If you don't have an account for SOAP already, type this command in the worldserver console:
      account create soap mypassword (change soap and mypassword to your liking, they are the account name and password, respectively)
    • Change the security level to 3 for your SOAP account by typing this command in the worldserver console:
      account set gmlevel soap 3 -1 (change soap to the name of your SOAP account)
    • See AzerothCore's wiki on account creation for more info
  • Password: the SOAP account's password

You can press the "🔌 Test Connection" button to ensure Strapi is able to connect to your AzerothCore server via SOAP properly.

Auth Database

In the leftmost pane of the Strapi dashboard, go to "AzerothCore", then "Auth Database" under the Settings category

  • Host: the hostname on which your MySQL database server is running
  • Port: the port on which your MySQL database server is listening, usually 3306
  • Database: the name of the database, usually acore_auth
  • User: the MySQL user to connect with. Make sure that the user has access to the specified database.
  • Password: the user's password

You can press the "🔌 Test Connection" button to ensure Strapi is able to connect to your database properly.

Permissions

In the leftmost pane of the Strapi dashboard, go to "AzerothCore", then "Permissions" under the Settings category

This page displays permission issues that would prevent standard usage of the AzerothCore plugin. Press the "🔨 Fix" button to fix the permissions.
Feel free to ignore the recommendations on this page if you know what you're doing and would like to disable some of the plugin's features via the permissions system.

Users & permissions plugin

In the leftmost pane of the Strapi dashboard, go to "⚙️ Settings", then visit the links under the "Users & permissions plugin" section:

Roles

This section allows you to manage which API endpoints are accessible for logged-in users ("Authenticated" role) and unauthenticated users ("Public" role).

Email templates

You can customize the emails sent to your users here.

Advanced settings

Make sure to change the "Reset password page" and "Redirection url" links:

  • Reset password page: when using the "forgot password" feature, an email is sent with the specified URL. Make sure to input a link to an existing page of your frontend, which needs to call the reset-password API endpoint.
  • Enable email confirmation: enable this if you'd like the CMS to send a confirmation email when registering an account.
  • Redirection url: when registering, a verification email is sent with a link that will redirect to the specified URL. Make sure to input a link to an existing page of your frontend, where you can notify the user that the account was successfully verified, for instance.

🔌 API endpoints

Your frontend can query the following API endpoints:

Auth

  • Register
    POST /api/strapi-azerothcore/auth/register

    {
    	"username": "myaccount",
    	"email": "[email protected]",
    	"password": "mypassword",
    	"repeatPassword": "mypassword"
    }
  • Login
    POST /api/strapi-azerothcore/auth/login

    {
    	"identifier": "myaccount",
    	"password": "mypassword"
    }

    You can also use the email address to log in:

    {
    	"identifier": "[email protected]",
    	"password": "mypassword"
    }

    Example response:

    {
    	"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NzMsImlhdCI6MTcxOTE1MTY0MiwiZXhwIjoxNzIxNzQzNjQyfQ.IoEBek2debDordaC0y1X_mlksjFPx_roi-BoJUeYfIg",
    	"user": {
    		"id": 73,
    		"username": "myaccount",
    		"email": "[email protected]",
    		"provider": "local",
    		"confirmed": true,
    		"blocked": false,
    		"createdAt": "2024-06-20T10:51:14.841Z",
    		"updatedAt": "2024-06-20T10:51:14.841Z"
    	}
    }

    Use the provided jwt in the Authorization header (Authorization: Bearer <your jwt> without the brackets) for the endpoints that need authentication.

  • Forgot Password
    POST /api/auth/forgot-password
    This will send an email to the provided email address if a user is found. The email will contain a link with a code as a query parameter (?code=xxxxx) which is needed for the reset-password endpoint.

    {
    	"email": "[email protected]"
    }
  • Reset Password
    POST /api/strapi-azerothcore/auth/reset-password

    {
    	"code": "xxxxxxxxxxxxxxxxxxxxxxx",
    	"password": "mynewpassword",
    	"passwordConfirmation": "mynewpassword"
    }

    The code is from a link sent via email when using the reset-password endpoint.
    password is the new password to set, and passwordConfirmation must be the value of a "repeat password" field in the form on your frontend.

  • Change Password
    POST /api/strapi-azerothcore/auth/change-password
    🔐 Requires authentication

    {
    	"currentPassword": "password",
    	"password": "mynewpassword",
    	"passwordConfirmation": "mynewpassword"
    }
  • Change Email
    POST /api/strapi-azerothcore/auth/change-email
    🔐 Requires authentication

    {
    	"email": "[email protected]"
    }

Characters

  • My Characters
    GET /api/strapi-azerothcore/characters/:realmId/my-characters
    🔐 Requires authentication
    Returns data about the account's characters for a given realm

  • My Guilds
    GET /api/strapi-azerothcore/characters/:realmId/my-guilds
    🔐 Requires authentication
    Returns data about the account's owned guilds for a given realm

Realms

  • Realms
    GET /api/strapi-azerothcore/realms
    Returns data about the realms

User Activity

  • User Activity
    GET /api/strapi-azerothcore/user-activity
    🔐 Requires authentication
    💭 You can use query parameters to control sorting and paging
    Returns data about activity for the account, such as logins, failed logins, password changes, etc.

🤝 Contributing

Contributions are greatly appreciated.

If you have a suggestion that would make this project better, feel free to fork the repository and create a Pull Request. You can also open a Feature Request.

⭐️ Show your support

⭐️ Give the project a star if you like it!

🔗 Links

🌎 Community support