Skip to content

4.0.0

Latest
Compare
Choose a tag to compare
@stevenclouston stevenclouston released this 08 Dec 22:00
68c9dce

Release Notes

Changes have been made so that conventions used in the PHP SDK align with Authsignal's general SDK conventions.

Breaking Changes

  1. track Method

    • Old Signature:
      public static function track(string $userId, string $action, array $payload)
    • New Signature:
      public static function track(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user you are tracking the action for.
      • action (string): The action code that you are tracking.
      • attributes (array): An array of attributes to track.
    • Changes:
      • The method now accepts a single associative array parameter named $params.
      • The payload parameter has been replaced with attributes in the implementation.
  2. getAction Method

    • Old Signature:
      public static function getAction(string $userId, string $action, string $idempotencyKey)
    • New Signature:
      public static function getAction(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user you are tracking the action for.
      • action (string): The action code that you are tracking.
      • idempotencyKey (string): The idempotency key for the action.
    • Changes:
      • The method now accepts a single associative array parameter named $params.
  3. getUser Method

    • Old Signature:
      public static function getUser(string $userId, string $redirectUrl = null)
    • New Signature:
      public static function getUser(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user you are tracking the action for.
    • Changes:
      • The method now accepts a single associative array parameter named $params.
      • Removed redirectUrl from the params.
  4. updateUser Method

    • Old Signature:
      public static function updateUser(string $userId, array $data)
    • New Signature:
      public static function updateUser(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user to update.
      • attributes (array): The attributes to update for the user.
    • Changes:
      • The method now accepts a single associative array parameter named $params.
  5. enrollVerifiedAuthenticator Method

    • Old Signature:
      public static function enrollVerifiedAuthenticator(string $userId, array $authenticator)
    • New Signature:
      public static function enrollVerifiedAuthenticator(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user you are tracking the action for.
      • attributes (array): The authenticator object to enroll.
    • Changes:
      • The method now accepts a single associative array parameter named $params.
  6. deleteUser Method

    • Old Signature:
      public static function deleteUser(string $userId)
    • New Signature:
      public static function deleteUser(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user you want to delete.
    • Changes:
      • The method now accepts a single associative array parameter named $params.
  7. deleteAuthenticator Method

    • Old Signature:
      public static function deleteAuthenticator(string $userId, string $userAuthenticatorId)
    • New Signature:
      public static function deleteAuthenticator(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user.
      • userAuthenticatorId (string): The userAuthenticatorId of the authenticator to delete.
    • Changes:
      • The method now accepts a single associative array parameter named $params.
  8. validateChallenge Method

    • Old Signature:
      public static function validateChallenge(string $token, string $userId = null, string $action = null)
    • New Signature:
      public static function validateChallenge(array $params)
    • Parameters in Associative Array:
      • token (string): The JWT token string returned on a challenge response.
      • userId (string|null): The userId of the user you are tracking the action for (optional).
      • action (string|null): The action code that you are tracking (optional).
    • Changes:
      • The method now accepts a single associative array parameter named $params.
  9. RenamesetApiKey Method to setApiSecretKey

  10. RenamegetApiKey Method to getApiSecretKey

  11. Rename setApiHostname to setApiUrl

  12. Rename AUTHSIGNAL_SERVER_API_ENDPOINT env var to AUTHSIGNAL_API_URL

  13. Remove setApiVersion and getApiVersion

  • The version should be set when the URL is set with setApiUrl or the AUTHSIGNAL_API_URL env variable.

Non Breaking Changes

  1. Add updateAction Method

    • Signature:
      public static function updateAction(array $params)
    • Parameters in Associative Array:
      • userId (string): The userId of the user to update the action for.
      • action (string): The action code to update.
      • idempotencyKey (string): The idempotency key for the action.
      • attributes (array): Additional attributes for the action.
  2. ** getAuthenticators Method**

  • Signature:
    public static function getAuthenticators(array $params)
  • Description: Retrieves the list of authenticators for a specified user.
  • Parameters in Associative Array:
    • userId (string): The userId of the user whose authenticators you want to retrieve.
  • Returns: An array containing the list of user authenticators.
  • Throws:
    • AuthsignalApiException if the request fails.

Example Usage:

$params = [
    'userId' => '12345' // The userId of the user whose authenticators you want to retrieve
];

$authenticators = Authsignal::getAuthenticators($params);