At DrupalCon Pittsburgh, a team of interested community members submitted The Drupal API Client Project to be considered for funding as part of the Pitchburgh Innovation Contest. (If you missed it, check out our pitch video below, along with the original proposal.)
We were lucky enough to be selected by a panel of judges and the Drupal community to recieve funding. Since then, we've made some exciting progress on making our pitch a reality and wanted to share some updates.
Initial Goals and Vertical Slice POC
Our initial focus is what we've been calling the vertical slice POC for our JSON:API Client. As a checkpoint on the way to our eventual 1.0 release, we saw value in focusing deeply on a narrow portion of the client. Specifically, we decided to focus on the ability to get a collection of resources from the API.
Alongside that functionality, we also wanted to cover some level of implementation for all of our planned configuration options:
- Custom fetch method #3376929
- Authentication (basic authentication for the POC) #3376937
- Local caching #3377144
- Deserialization of API responses #3377191
- Basic localization support #3377803
- Adding query parameters to API requests #3383578
Going this deep on our method to get a collection should provide groundwork that will help simplify the remaining implementation on the way to 1.0. And possibly more importantly, having a functional POC early should allow us to engage with the community and gather real world feedback.
Speaking of the POC, we're excited to announce that we've published our first release! You can install it right now using npm (or your package manager of choice):
npm i @drupal-api-client/json-api-client
API documentation for the package is available on GitLab pages.
Included below is a CodeSandbox including a simple example of using the client to get a collection of nodes from a Drupal site. Feel free to fork it and play around!
For the more adventurous, here's a live TypeScript example from our project readme that demonstrates more of the available configuration options:
This 0.1.0 release represents the initial POC, but we're planning on having continued 0.x releases as we approach 1.0.
Thanks to all who contributed to this release, including: coby.sher, pratik_kamble, mitchellmarkoff, shrutishende, elber, abhisekmazumdar, alexmoreno and the many others who provided feedback in the issue queue or dropped in on one of our Slack meetings.
Obligatory Call for Help
The Drupal API Client Project is rolling along, but we're still looking for help from the community to make it a success. With the release of this POC, one of the biggest areas we need help is getting general feedback on our work thus far. The wider the feedback we get from the community, the better chance we have to ship something that meets a wide array of decoupled Drupal use cases.
We've created a feedback issue to help guide the conversation, but we're also open to feedback in any form. We're you able to get up and running? Does the current API make sense to you? Is there a particular use case you're hoping to see supported? Let us know!
You also may have noted that many of our primary contributors work together at Pantheon. While we greatly appreciate Pantheon's support and sponsorship of this project, we're also looking for help from the broader community. We're doing a decent job keeping focused on the generic use cases that this project is intended to solve, but having a more diverse array of contributors can only help the end result.