Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add Client in Wordpress? #13

Open
schudav opened this issue Apr 3, 2018 · 1 comment
Open

How to add Client in Wordpress? #13

schudav opened this issue Apr 3, 2018 · 1 comment

Comments

@schudav
Copy link

schudav commented Apr 3, 2018

On the main description it says "Use this client if you need to connect to Rocket Chat with a software written in PHP, such as WordPress or Drupal."

I don't really understand how one would use this with Wordpress. I know we can add custom actions to the Wordpress functions.php file, but how would you go about installing this package to Wordpress when it uses composer?

@pandymic
Copy link

pandymic commented May 1, 2019

Composer is just a package manager that helps developers to better manage deployment of third-party libraries in their projects. Similar to npm/yarn for Node.js, or gems for Ruby or pip for Python. The platform or framework for which you're building has no bearing on whether you can use Composer or not, it's simply a development tool.

The public-facing REST APIoffered by Rocket.Chat is a very powerful tool. This project simplifies authentication and calls made to that API by wrapping them around a series of standardized methods.

You mentioned actions/hooks in your comment. One very simple use case for this library as part of a WordPress plug-in or theme is as follows:

You hook into the user_register action that is fired after a WordPress user is registered. At that time you send a request to the Rocket.Chat API that creates a user with the same username and e-mail address. Similarly on delete_user you may send a request to the API that purges the user from your Rocket.Chat database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants