wp_json_api 5.0.2
wp_json_api: ^5.0.2 copied to clipboard
WordPress and WooCommerce JSON API for Flutter Mobile. API allows you to login, register new users, get users info and more.
5.0.2 - 2026-10-12 #
- Update links to the WP JSON API plugin page and documentation on woosignal.com
5.0.1 - 2026-10-12 #
- Allow
flutter_secure_storage11, so the package installs alongside current Nylo 7 (nylo_support7.30+) andwoosignal4.5+
5.0.0 - 2026-10-12 #
Requires the WP JSON API WordPress plugin 5.0 or later. All requests now use the plugin's wpapp/v4 API. See "Migrating from 4.x" in the README.
Breaking changes #
- All requests go to
/wp-json/wpapp/v4/.... The v3 routes are no longer used - The token is sent in the
Authorization: BearerandX-WPApp-Tokenheaders, never in the request body - Removed nonce support:
wpNonce(),wpNonceVerify(),WPNonceResponse,WPNonceVerifiedResponse,WPRouteType.AuthNonceandWPRouteType.AuthVerify - Removed
wpUserAddRole(),wpUserRemoveRole(),WPUserAddRoleResponse,WPUserRemoveRoleResponse,WPRouteType.UserAddRoleandWPRouteType.UserRemoveRole. Roles must be managed on the server wpLogin()sends a singleloginfield. Passlogin:(username or email), oremail:/username:as before. Removed theauthTypeparameter and theWPAuthTypeenumwpLogin(),wpRegister()andwcRegister(): replacedtokenExpiryAt/expirywithexpiresIn(seconds) and addeddeviceNamewpRegister()andwcRegister(): replacedargswithfirstName,lastNameandmetaData(allow-listed keys only). The username is no longer generated on the device; the server generates one when it is emptywpResetPassword()requirescurrentPasswordwpUserDelete()requirespassword. RemovedreassignwpLogout()now callsPOST /auth/logoutto revoke the token, then clears the stored user even if the request fails. ReturnsFuture<bool>(true if the server revoked the token)WPUserLoginResponse.dataandWPUserRegisterResponse.dataare the v4 Auth object:token,expiresAtanduser. ReplacesuserId,userToken,expiry,email,username,firstName,lastName,avatarandcreatedAtWPUserInfoResponse.data: removeduserNicenameanduserStatus;metaDataonly contains allow-listed keysWPUserInfoUpdatedResponse.datais the updated user andWCCustomerUpdatedResponse.datais the updated customerwcUpdateCustomerInfo(): removedshippingEmail(not a WooCommerce shipping field)WpMetaData.uniqueis now abool?wpGetUserInfo(),wcCustomerInfo()andwcPointsAndRewardsUser()useGET- A request is successful only on an HTTP 2xx response. Errors throw typed exceptions mapped from the WordPress REST error
code(see the README) WPJsonAPI.wpUserLoggedIn()returns false when the stored token has expired, or has no expiry (a session saved by 4.x), so users log in again once after upgrading- Removed
InvalidNonceException,EmptyUsernameException,ExistingUserLoginException(useUsernameTakenException),ExistingUserEmailException(useUserAlreadyExistException) andInvalidUsernameException(useInvalidCredentialsException)
Added #
- Exceptions:
InvalidCredentialsException,LoginBlockedException,PrivilegedUserException,TooManyAttemptsException(withretryAfter),RegistrationDisabledException,WeakPasswordException,MetaKeyNotAllowedException(withkey),PointsAndRewardsNotFoundException,WPServerException(withcode,statusanddata) andWPNetworkException(no response from the server) - Existing exceptions accept the server's message, and all exceptions implement
toString() WpUser.expiresAt,WpUser.expiresAtDateTime,WpUser.isTokenExpiredandWPJsonAPI.wpUserTokenExpiresAt()WPRouteType.UserLogoutWCCustomerInfoResponse.data:id,createdAtandshipping.phone
Fixed #
meta_datasent as an empty JSON list ([]) no longer throws, andtoJson()writesmeta_databack as a map- Passwords and tokens are hidden in debug logs
- Logging out without Nylo now clears flutter_secure_storage instead of only
NyStorage
4.3.8 - 2026-09-12 #
Changed #
- Added
analysis_options.yamlusing thevibe_checkNylo lint preset - Resolved analyzer lints across the package and tests: explicit type annotations, null-aware assignments, braces in flow control, initializing formals and an unnamed
librarydirective WPAppNetworkManager.wpLogout()now declares aFuture<void>return type- Dependency updates:
dio^5.9.2,nylo_support^7.17.0 - Dev dependency updates:
mockito^5.6.4,build_runner^2.13.1
Fixed #
- Fixed
getMetaDataArrayWheredoc comments renderingList<dynamic>as HTML
4.3.7 - 2026-02-10 #
Fixed #
- Fixed
WCCustomerUpdatedResponse.fromJson()incorrectly resetting data field - Fixed potential null pointer exceptions in metadata helper methods
- Corrected return type documentation for
wpUserAddRole,wpUserRemoveRole, andwpResetPasswordmethods
Changed #
- Modernized Dart syntax throughout codebase (removed deprecated
newkeyword) - Added explicit return types to methods for better type safety
- Refactored
toJson()methods to avoid variable shadowing - Replaced string concatenation with interpolation
- Used
for-inloops instead offorEachfor better readability - Improved null safety in metadata retrieval methods
Removed #
- Removed unused
UserExistsExceptionclass (duplicate ofUserAlreadyExistException)
Added #
- Comprehensive unit test suite (177 tests)
- Added
mockitoandbuild_runnerdev dependencies for testing
4.3.6 - 2025-12-13 #
- Dependency updates
4.3.5 - 2025-09-06 #
- Dependency updates
4.3.4 - 2025-07-17 #
- Dependency updates
4.3.3 - 2025-05-23 #
- Dependency updates
4.3.2 - 2025-05-13 #
- Fix #7
- Dependency updates
4.3.1 - 2025-04-09 #
- Dependency updates
4.3.0 - 2025-03-27 #
- Dependency updates
4.2.1 - 2025-01-05 #
- Dependency updates
4.2.0 - 2024-12-31 #
- Update copyright year
- Dependency updates
4.1.0 - 2024-12-16 #
- Update
initfor package - Support Nylo v6
- Dependency updates
4.0.5 - 2024-11-27 #
- Fix
wpAuthmethod
4.0.4 - 2024-11-27 #
- Fix auth issue
- Dependency updates
4.0.3 - 2024-11-25 #
- Dependency updates
4.0.2 - 2024-11-23 #
- Dependency updates
4.0.1 - 2024-11-08 #
- Dependency updates
4.0.0 - 2024-11-06 #
- Update package to use nylo_support v6
- Dependency updates
3.5.13 - 2024-07-14 #
- Dependency updates
3.5.12 - 2024-07-06 #
- Dependency updates
3.5.11 - 2024-06-21 #
- Readme update
- Dependency updates
3.5.10 - 2024-06-15 #
- Dependency updates
3.5.9 - 2024-05-14 #
- Dependency updates
3.5.8 - 2024-05-06 #
- Dependency updates
3.5.7 - 2024-05-02 #
- Dependency updates
3.5.6 - 2024-04-26 #
- Dependency updates
3.5.5 - 2024-04-23 #
- Dependency updates
3.5.4 - 2024-04-02 #
- Dependency updates
3.5.3 - 2024-03-28 #
- Dependency updates
3.5.2 - 2024-03-27 #
- Dependency updates
3.5.1 - 2024-03-21 #
- Dependency updates
3.5.0 - 2024-03-18 #
- Breaking change
WPJsonAPI.initWithis nowWPJsonAPI.init - Refactor project
- Ability to save user token for future requests
- New WpUser model for user data
- New wcRegister method for networking class
- Add more data to
WpUserLoginResponseandWpUserInfoResponse - Added
versiontoWpJsonAPIclass - New
WPJsonAPI.wpLoginmethod to login a user - New
WPJsonAPI.wpLogoutmethod to logout a user - New
WPJsonAPI.wpUserLoggedInmethod to check if a user is logged in - New
WPJsonAPI.wpUsermethod to get the current user - New
WPJsonAPI.wpUserIdmethod to get the current user's ID - New
WPJsonAPI.wpUserTokenmethod to get the current user's token - New
WPJsonAPI.wpAuthmethod to authenticate the previously logged in user - Added Storage key to
WPJsonAPIclass - New docs added to Readme
- Dependency updates
3.4.0 - 2024-03-15 #
- Added new networking methods for WooCommerce Points and Rewards
- Dependency updates
3.3.4 - 2024-01-01 #
- Update license date
- Dependency updates
- Add GitHub actions
3.3.3 - 2023-10-05 #
- Use Dio instead of the http library
- Dependency updates
3.3.2 - 2022-02-20 #
- Add logo to package.
3.3.1 - 2022-12-28 #
- Fix updating meta for users
- Dependency updates
3.3.0 - 2022-09-01 #
- Dependency updates
3.2.0 - 2022-07-08 #
- New API to delete an account
- Update code docs
3.1.3 - 2021-09-03 #
- Add roles to wp_user_info_response
3.1.2 - 2021-09-02 #
- Ran flutter format
3.1.1 - 2021-09-02 #
- Update readme
3.1.0 - 2021-09-02 #
- Ability to add and remove roles from a user
- Dependency updates
3.0.0 - 2021-04-10 #
- Added null safety support
- Dependency updates
2.0.0 - 2020-11-18 #
- Support for v2.0.0 wp-json-api WordPress plugin
0.1.4 - 2020-06-16 #
- Meta data now is returned for users
- Ability to store, update and delete meta data on WP_User
- Throw exceptions for requests
- Handle async await in callback
- Updated models
- Refactor model file names
- More documentation added in code
0.1.3 - 2020-06-03 #
- pubspec.yaml update
0.1.2 - 2020-05-01 #
- Readme update
0.1.1 - 2020-04-30 #
- Readme update
0.1.0 - 2020-04-30 #
- pubspec.yaml desc change, updates to networking class and readme
0.0.1 - 2020-04-06 #
- Initial Release
