Hey Karim. Currently there is no way to import a function into cy.origin, but support should be added in the future with
https://github.com/cypress-io/cypress/issues/19974. If you do define the function inside a cy.origin block, it will persist to other cy.origin invocations.