@grabjs/superapp-sdk
    Preparing search index...

    Function isRedirection

    • Type guard to check if a JSBridge response is a redirect (status code 302).

      Type Parameters

      Parameters

      • response: T

        The JSBridge response to check

      Returns response is Extract<T, { status_code: 302 }>

      True if the response is a redirect (302), false otherwise

      const response = await someBridgeMethod();
      if (isRedirection(response)) {
      console.log('Redirecting...');
      }