Official Elixir library for the WordPress.com REST API.
def deps do
[
{:wpcom, "~> 1.0.0"}
]
end
Some WordPress.com REST API endpoints are publicly accessible. For instance, retrieving a list of posts from a public site can be done without any credentials.
However, many API operations do require authentication. So if your application needs to access protected endpoints, you'll need to obtain an OAuth2 token. For detailed instructions on acquiring a token, refer to the OAuth2 Authentication guide in the WordPress.com Developer Resources.
Once you've obtained your token, you can configure your application to use it by adding the following line to your runtime.exs
file:
config :wpcom, :oauth2_token: "_YOUR_OAUTH2_TOKEN_HERE_"
mix test
mix dialyzer
mix credo