• Resolved akshatjiwan

    (@akshatjiwan)


    Hi,

    I was looking at wordpress client-js library and I couldn’t find any information on how the library can be used outside of wordpress. To be more specific I want to understand:-

    1. How authentication is handled by the client? (I don’t see any methods/api calls that verify or create a new session for the user )

    2. Whether it would be possible for me to use this library from a non-wordpress site. It would be a static page and if so how can I make sure that the calls to the api are authenticated?

    It would be great if you could point me to some resource that helps me understand this.

    Thanks,
    Akshat

    • This topic was modified 7 years, 6 months ago by akshatjiwan.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    When using default cookie authentication, the API requires the user to be logged in, so the authentication is managed by the cookie sent with the request. The client does not need to do anything special.

    This is specifically meant for use with the WP REST API, so non-WP use would need to identically mimic what WP does, including verifying the cookie sent with the request is valid in the same manner that WP would.

    Thread Starter akshatjiwan

    (@akshatjiwan)

    Thank you @bcworkz for your response. I also asked this question on github and the reply I got there, along with your answer, gives me a clearer picture of what the library can do.

    I also found out about wordpress node api which has built in support for authentication and can be used on the client side. Although you’d need to install the basic auth plugin on the server side.

    Thanks,
    Akshat

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using client-js library in a third party website’ is closed to new replies.