Skip to content

how to consume API from wordpress Public API ? #381

Description

@yann-yinn

Hello !
First, thanks for this awesome client, which , i love so much the simplicity of it * - *

const posts = await wpapi
      .posts()
      .tags(tag.id)
      .perPage(10)
      .embed()
      .page(currentPage);

My question : I am working on Reactpress and would like to consume a wordpress public api, like this one , for testing purposes :

https://public-api.wordpress.com/wp/v2/sites/yinrun.wordpress.com

I tried this with no luck

import WPAPI from "wpapi";
import config from "./publicConfig";
export default new WPAPI({
  endpoint: "https://public-api.wordpress.com/wp/v2/sites/yinrun.wordpress.com"
});

I know there is a trick with namespace, but it means every request has to be rewritten : #329

Any suggestions ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions